NSTX logo Overview Programming Diagnostics Applications
FAQ Web Tools UNIX & VMS MDSplus
software
  NSTX Data Analysis
What is the easiest way to plot NSTX data?
Is NSTX data available from the web?
Do I have to use IDL to analyze the data? If I decide to learn IDL, where do I start?
What TRANSP runs have been done, and how do I look at them?
Is there anything like MINGL and LOCUS?
What sort of relational database tools are there?
How do I know when the between shot EFIT analysis is finished?
What do the variables from EFIT mean?
My program needs the electron temperature and the plasma current as well as my own data, and I want it to run automatically every shot. How do I do that?
I want to put the results of my analysis in the tree, too. How do I do that?
How do I interpolate a signal to a different timebase?
How can I get postscript or PDF files from the WebTools plots?
How can I make publication quality plots to place into Word and PowerPoint?
How do I run an IDL code, which normally reads from the command line, from a script?
How do I create MPEG movies from IDL?
Why do I get an error accessing IDL on Solaris from Mac OS X?
Why do my IDL graphics get erased when covered up?
What tools are available for MHD spectral plotting?
How can access Fast 2-D Camera data for NSTX?

What is the easiest way to plot NSTX data?

You may access NSTX data in MDSplus through the Web Tools . (From outside PPPL, you will have to be authenticated at the firewall.) This web interface has some limitations, such as no dragging the mouse to select plot ranges. For such interactive features, on the Linux cluster, consider the SCOPE utility, EFITviewer, or other IDL-based programs, such as mdsw.pro.

Is NSTX data available from the web?

You may access NSTX data in MDSplus through the Web Tools . (From outside PPPL, you will have to be authenticated at the firewall).

Jscope is a powerful web-based utility distributed with MDSplus (but not widely used at PPPL).

Do I have to use IDL to analyze the data? If I decide to learn IDL, where do I start?

MDSplus may be analyzed from a variety of stand-alone tools, such as Scope, FAS (actually, an IDL application), or even Excel (see NSTX MDSplus Data Plotting and Listing Tool on the web). There are MDSplus access routines for C, FORTRAN, Visual Basic, Labview, Perl, AVS Express, and probably many other languages. Many people find IDL the best programming language for custom applications. Tutorials and documentation are available.

What TRANSP runs have been done, and how do I look at them?

Use the NSTX Transp Runs Listing Tool web tool.

Is there anything like MINGL and LOCUS?

Most LOCUS features are available from VMS for the NSTX databases , which are MS-SQL databases. Locus was partially ported to Unix, as well.

However, much more friendly tools now exist, and are being supported. See " Relational Database tools", below.

What sort of relational database tools are there?

  • You can access the NSTX databases from IDL -- type dbaccess at the IDL prompt. See the DbAccess manual.

    You will need some special permissions to access databases. See New_NSTX_User_Setup.txt. You will need the appropriate *.sybase_login file in your home directory. The best way to create files needed for NSTX database access is to run the following on the Linux cluster (best to delete old files first, e.g., rm ~/*.sybase_login). If you are running the tcsh shell, typing the following will create the proper files:

    /p/nstxusr1/util/setup/mkmdsplusdbfile.csh
    
  • You can access the NSTX databases on the web from NSTX Tools.
  • You can access the NSTX databases from Excel, which has some powerful statistical tools, if Data Analysis tools have been installed.
  • See Dana Mastrovito or Bill Davis for more information.

How do I know when the between shot EFIT analysis is finished?

EFIT declares the MDSplus event 'phoenixDone_p1' when 'EFIT01' is loaded and 'phoenixDone_p2' when 'EFIT02' is loaded.

What do the variables from EFIT mean?

A brief description is on-line. Tags in the MDSplus tree are also on-line. For more information, contact Steve Sabbagh.

My program needs the electron temperature and the plasma current as well as my own data, and I want it to run automatically every shot. How do I do that?

Standard MDSplus data acquisition declares an event when each CAMAC module is acquired (this event name is typically the one used in Scope files for automatic update). If you know the digitizer of such a signal, you can find the event name in Traverser (or maybe some standard Scope file). When an analyzed signal is stored in an MDSplus tree, the program must explicitly declare an event. This can be anything, and you need to find someone who knows what it is.

Once the appropriate event is known, there are MDSplus routines to wait for it. These are accessible from other languages, such as IDL. For combinations of events, the most general way is to use the MDSplus Event Management System (MEMS).

I want to put the results of my analysis in the tree, too. How do I do that?

If trees are designed with some care and attention to local style, benefits accrue. To create nodes in the NSTX Model Tree, you can use Traverser, TCL, or IDL. See Phyllis Roney for advice and examples.

How do I interpolate a signal to a different timebase?

If signals are on different timebases, mathematical operations on the signals will NOT cause automatic interpolation. Brian Nelson's SigMath TDI routines are probably the easiest way to automatically convert signals to a common timebase.

At PPPL, there is an interpolation function (INTERP.FUN) for TDI that calls a FORTRAN routine built into a shared image on VMS. If you call MDSCONNECT before executing TDI on Unix, this function will work there, as well. Interpolation with this function assumes the signals have been created/built with time as the dimension.

The Web Plotting tools, like mdsplotlist.html, (as of September, 2007) automatically convert to the coarsest time base (using Brian Nelson's SigMath TDI routines).

How can I get postscript or PDF files from the WebTools plots?

After you have made something you like with a web plotting page, you simply check the box labeled "Postscript" or "PDF" below "Plot File", check "E-mail file to:", enter your e-mail in the field beside that, and then click on "Plot". The pathname where the postscript file can be found is also displayed in your web browser.

For printing plots similar to the MDSplus Scope Plotting Tool, you may wish to use printscope.pro from VMS or Unix/Linux.

How can I make publication quality plots to place into Word and PowerPoint?

Bitmaps from a screen capture, Gif files or Jpeg files can be copied and pasted or placed into applications on a personal computer, but these generally look pixelated, and can look horrible when resized. Postscript graphics can look much more professional.

Make a Postscript file from IDL (using !p.font=0 will allow your fonts to be settable in Adobe Illustrator or Canvas, e.g.). You can also make Postscript files from many applications, and many canned IDL programs, by printing to a file. Many Web Plotting tools have an option to have Postscript or PDF files e-mailed to the user.

Open the Postscript file in Adobe Illustrator (if you need to rotate it, "Edit...Select All" and go to "Object...Transform...Rotate...", enter 90 and click "OK". Then select "File...Document Setup..." click on the landscape icon, and then click OK). Select "File...Save a Copy..." and select the file type to be "Illustrator EPS" and click "Save". In the resulting dialog box, under Preview, Format:, select TIFF and click on Opaque. When you insert this .eps file into Word or PowerPoint, it will look good, even when resized.

If you want to make high-quality figures from screen-dumps or bit-maps, see HiRes_JPEGs_from_Bitmaps.txt

How do I run an IDL code, which normally reads from the command line, from a script?

You can use the shell 'here-document' operator <<. E.g,

    $idl << EOF
    create_f90_html_doc, filelist
    exit
    EOF
This also works in shell scripts.
(from Nigel Wade, University of Leicester, Leicester on IDL newsgroup)

See run_idl_from_script.html for another example.

If you want to have an argument (e.g., entering a shot number) for the batch invocation, do the following from Unix at PPPL:

	% cp /p/nstxusr1/util/idl_cvs/idlbatch.pl  .
	% chmod  +x  idlbatch.pl
	% idlbatch.pl  myroutine 111340
Where "myroutine" is the routine (with one required argument) you want to invoke (in this example, passing in 111340 for the argument)

if "myroutine.pro" has multiple arguments, keywords, etc., enclose the argument string in quotes, e.g.,

      % idlbatch.pl  myroutine  "111340, option='hi there'"

How do I create MPEG movies from IDL?

IDL has commands to create MPEG files. /p/nstxusr1/util/idl_cvs/mpeg_from_screen.pro is a simple example of creating a color Mpeg animation with text overlayed, handling both 8- and 24-bit color monitors.

However, the quality and/or speed may not be satisfactory when creating Mpegs using the standard IDL calls. Code may be found on the internet to create AVI files from IDL on a PC. AVI players usually allow speed control, and you may choose from a variety of compression/quality tradeoffs. Examples of better ways to make MPEGs using Unix commands include:

  1. /u/bdavis/Anim/Mpeg/mk_mpeg.pro plots lots of things to a Z buffer, then copies each frame to a PPM file. It creates an input file for mpeg_encode (which must be in your path) and spawns mpeg_encode.
  2. /p/nstxusr1/util/idl_cvs/write_mpeg.pro takes a 3-D array as input, writes gif files to a temporary directory, creates an input file to mpeg_encode, which includes a "INPUT_CONVERT" command for giftoppm, and spawns mpeg_encode.

  3. NOTE: As of July, 2004, mpeg_encode was just installed on the Soloris computers (e.g, taurus) at PPPL. It is a 10-year-old product than only produces mpeg 1 files, so there is probably a better way to do this.

Why do I get an error accessing IDL on Solaris from Mac OS X?

There is a bug or incompatiblity somewhere that causes an error like:

   ld.so.1: /usr/pppl/rsi/idl_5.3/bin/bin.solaris2.sparc/idl: fatal:
   relocation error: file /usr/openwin/lib/libGL.so.1: symbol
   XPanoramiXQueryVersion: referenced symbol not found
   Killed
Use a Linux computer, such as nstxpool (if you are in the "nstx" unix group) or one of the portal computers.

Why do my IDL graphics get erased when covered up?

You need a "backing store." Use the RETAIN keyword to the DEVICE or WINDOW commands. See idl_intro.html#BACKSTORE

What tools are available for MHD spectral plotting?

    combw3.pro plots freq. vs. time of NSTX MHD data. The latest version (on Linux) allows two graphics windows, each of which allows "scrolling back" to previous plots. Any modifications you make to the color palette of each window is retained for later plots to that window.

    See /p/nstxusr1/util/misc/mhd/combw3.pro, or just run combw3 in IDL (it should be in your path if you have done a "module load nstx/mdsplus" or a "module load idl").

How can access Fast 2-D Camera data for NSTX?


Edited 23-Apr-2008 by: Bill Davis