Accessing PPPL's TRANSP data in MDSplus with IDL

TRANSP runs are on the MDSplus Server transpgrid.pppl.gov

Look what's in the tree

mdstcl,'dir'
mdstcl,'dir .transp_out:*'
mdstcl,'dir .transp_out:cur:*'
mdstcl,'decompile .transp_out:cur:rplabel'
mdstcl,'dir .inputs:*'

labels = mdsvalue('getnci(".inputs:*:label","record")')
ufiles = mdsvalue('getnci(".inputs:*:filename","record")')

Read TRANSP output data

;Read Q on Axis
   q0=mdsvalue('.transp_out:q0')
   help,q0
;Read Time axis
   t1=mdsvalue('dim_of(.transp_out:q0)')
   help,t1
;Read Time axis (for 2D profiles, Time is 2nd dimension)
   t=mdsvalue('dim_of(.transp_out:cur,1)')
   help,t
;Read time units
   tu=mdsvalue('units_of(dim_of(.transp_out:q0))')
   print,tu
   plot,t1,q0,title=label,xtitle=tu
;Read plasma current
   cur=mdsvalue('.transp_out:cur')
   help,cur
;Read Time axis (for 2D profiles, Time is 2nd dimension)
   t2=mdsvalue('dim_of(.transp_out:cur,1)')
   help,t2
;Read X axis
   x=mdsvalue('dim_of(.transp_out:cur)')
   help,x
:Read rplot label
   label=mdsvalue('.transp_out:cur:rplabel')
   print,label
;Read units of current
   units=mdsvalue('units_of(.transp_out:cur)')
   print,units
;Read time units
   tu=mdsvalue('units_of(dim_of(.transp_out:cur,1))')
   print,tu
   surface,cur,x,t2,title=label,ztitle=units,ytitle=tu

Read input data (Ufiles)

;Read plasma current scalars
   sclab=mdsvalue('.inputs:CUR:SCLAB')  
   scval=mdsvalue('.inputs:CUR:SCVAL')
   print,sclab   
   print,scval

;Read current
   cur=mdsvalue('.inputs:cur')
   help,cur
;Read time axis
   time=mdsvalue('dim_of(.inputs:cur)')
   help,time
;Read label
   label=mdsvalue('.inputs:cur:label')
   print,label
;Read units
   cu=mdsvalue('units_of(.inputs:cur)')
   print,cu
;Read units of time axis
   tu=mdsvalue('units_of(dim_of(.inputs:cur))')
   print,tu
   plot,time,cur,title=label,ytitle=cu,xtitle=tu
;Read measured Plasma current
   pcur=mdsvalue('.transp_out:pcur')
   oplot,t1,pcur,psym=4


Home