Fast 2-D cameras on NSTX look at a variety of important aspects of the plasma edge and in-vessel components. One of these applications is the Gas Puff Imaging (GPI) Diagnostic. Data is taken from a Phantom camera and saved in "cine" files. A variety of tools have been developed at PPPL for viewing and analyzing GPI data, such as for "blob tracking" (also see Visualizing and Quantifying Blob Characteristics on NSTX ) and other purposes.
A popular viewing option for the cine files from Phantom Fast Cameras is the IDL routine FCplayer.pro. "Blobs," related to turbulence in plasmas, may be tracked in FCplayer.pro by using selections near the bottom of the Special Menu:
FCplayer can be invoked with a command like:
IDL> fcplayer, file='nstx_5_137582.cin', $ aveT1=0.329, aveT2=0.333, minXsize=400, FrameAveDeltaMS=0
Once image processing options and interesting times are determined, blob data can be entered into an SQL database (currently hosted on sql2008.pppl.gov) using the IDL routine loadblobs.pro.
This page details the validation procedure for the calculations of blob speed. The steps are:
IDL> image = fastcam_frame( filename, frame )fastcam_frame.pro will read Cine files or NetCDF files that follow a convention, and HDF files produced by Jim Myra from his simulations. gennetcdfblobs.pro will produce NetCDF that follow the expected convention and include 10 frames each that have blobs moving at different speeds. As of 6-Nov-2013, it produced 5 types of files by:
IDL> for i=1,5 do gennetcdfblobs, iThese files have the following names and characteristics:
'circoneup_1.nc' one circular blob moving upwards xVel & yVel = 0 3 pixels/frame -5.86e-06 0.00941 Km/s 'circoneout_2.nc' one circular blob moving outwards xVel & yVel = 3 0 pixels/frame 0.0109 -3.56e-05 Km/s 'circmany_3.nc' many circular blobs moving in different directions xVel & yVel = 0.60 0.378 pixels/frame 0.00214 0.001318 Km/s 'elipseone_4.nc' one circular blob moving upwards and slowly outwards xVel & yVel = 1 3 pixels/frame 0.00374 0.00947 Km/s 'elipsemany_5.nc' three elliptical blobs moving outwards, but up and down xVel & yVel = 1.50 0.333 pixels/frame 0.00545 0.000916 Km/sThe variables and types within these files can be seen with the IDL routine ncdf_cat:
IDL> ncdf_cat,'circoneup_1.nc' Dimensions 3 x 64 y 80 z 10(Unlimited dim) Variables Time (FLOAT ) Dimension Ids = [ 2 ] Attribute units=Sec Attribute long_name=Seconds since T0 Frames (LONG ) Dimension Ids = [ 0 1 2 ] Attribute units=Intensity Attribute long_name=Pixel Values xVel (FLOAT ) Dimension Ids = [ 1 ] Attribute units=Pixels/frame Attribute long_name=velocity in X direction yVel (FLOAT ) Dimension Ids = [ 1 ] Attribute units=Pixels/frame Attribute long_name=velocity in Y directionIf you view one of these NetCDF files in fcplayer, e.g.,
IDL> fcplayer, '/u/bdavis/cvs/idl_cvs/elipsemany_5.nc', horiz=0, minx=400and turn on "blob tracking" and "history" (in the Special Menu), and step through 10 frames, you will see:
You may download the following:
        |
The NetCDF files:
      circoneup_1.nc       circoneout_2.nc       circmany_3.nc       elipseone_4.nc       elipsemany_5.nc |
        |
QuickTime Movies:
      circoneup_1_0_9.mov       circoneout_2_0_9.mov       circmany_3_0_9.mov       elipseone_4_0_9.mov       elipsemany_5_0_9.mov |
The NetCDF files can be read with the IDL routine readnetcdfblobs.pro.
IDL> loadblobs, 'circoneup_1.nc', t1=0., t2=0.010, horiz=0, norm=0 IDL> loadblobs, 'circoneout_2.nc', t1=0., t2=0.010, horiz=0, norm=0 IDL> loadblobs, 'circmany_3.nc', t1=0., t2=0.010, horiz=0, norm=0 IDL> loadblobs, 'elipseone_4.nc', t1=0., t2=0.010, horiz=0, norm=0 IDL> loadblobs, 'elipsemany_5.nc', t1=0., t2=0.010, horiz=0, norm=0The above commands will produce intermediate text files like circoneup_1_blobs_0-9ms.txt, circoneout_2_0-9ms.txt, etc. that show the location and size of the blobs, in pixels.
populateblobs.pro, called from loadblobs, converts from pixels per frame to Km/s, and writes to the database table. Stewart Zweben says that horizontal and vertical pixel distance is approximately the same. The conversion between pixels and centimers is 23.5cm/64 pixels.
IDL> dbaccess, 'blobs'
Average speeds from the database can also be seen by running /u/bdavis/cvs/idl_cvs/checkvaves.pro
IDL> for i=1,5 do checkvaves,i Reading from database table SH1 Average x & y velocities for shot 1= -5.9610376e-06 0.0098332996 Km/s Average x & y velocities for shot 1= -0.0016012501 3.1088427 pixels/frame Reading from database table SH2 Average x & y velocities for shot 2= 0.011117898 -3.7208858e-05 Km/s Average x & y velocities for shot 2= 2.9864827 -0.011763751 pixels/frame Reading from database table SH3 Average x & y velocities for shot 3= 0.0021750933 0.0013772208 Km/s Average x & y velocities for shot 3= 0.58427216 0.43541465 pixels/frame Reading from database table SH4 Average x & y velocities for shot 4= 0.0038055245 0.0098963027 Km/s Average x & y velocities for shot 4= 1.0222375 3.1287614 pixels/frame Reading from database table SH5 Average x & y velocities for shot 5= 0.0055449076 0.00095672607 Km/s Average x & y velocities for shot 5= 1.4894695 0.30247333 pixels/frameThe above compare well with the values printed from the file-generation step, in 1., above.
IDL> dbaccess, 'blobs' select table, SH137582, move Column Names to Work Area and click on Selectin another window:
IDL> fcplayer, file='nstx_5_137582.cin', $ aveT1=0.325, aveT2=0.335, /horiz, /RotCC, $ colorTable=3, minXsize=400, FrameAveDeltaMS=0
2.4 p * 23.5cm * 1000ms * 1 Km --------- ------ ------ -------- = 0.35 Km/s 0.02511ms 64 p sec 100*1000 IDL> print, 2.4/.02511*23.5/64./100 0.350956and the average Y speed would be
-12.06 p * 23.5cm * 1000ms * 1 Km --------- ------ ------ -------- = -1.76 Km/s 0.02511ms 64 p sec 100*1000 IDL> print, -12.06/.02511*23.5/64./100 -1.76355
IDL> inds = where( SH137582_TIME ge 330.062 and SH137582_TIME le 330.09) IDL> help, inds INDS LONG = Array[11] IDL> print, average( SH137582_xvel[inds]) 0.35266491 IDL> print, average( SH137582_yvel[inds]) -1.9471798
X Y Xvel Yvel 330.06619 35.134 65.895 0.176 -1.423 330.06366 35.014 66.870 ------ ------ 0.120 -0.974 For Xvel 0.120 p * 23.5cm * 1000ms * 1 Km --------- ------ ------ -------- = 0.175 0.002511ms 64 p sec 100*1000 IDL> print, 0.120/.002511*23.5/64./100 0.175478 For Yvel -0.974 p * 23.5cm * 1000ms * 1 Km --------- ------ ------ -------- = -1.42430 0.002511ms 64 p sec 100*1000 IDL> print, -0.974/.002511*23.5/64./100 -1.42430 these values show up in the file produced by populateblobs.pro, and that get written to the database: IDL> it=nearesti(time,330.06619) IDL> print, xvel[it], yvel[it] 0.175974 -1.42316
If you have questions about this page, please send email to szweben.