Accessing MDSplus Data from IDL
Direct MDSplus Calls
server = 'skylark.pppl.gov:8501'
shot = 121031
MDSCONNECT, server
MDSOPEN, 'EFIT01', shot
psirz = MDSVALUE('\EFIT01::TOP.RESULTS.GEQDSK:PSIRZ')
r = MDSVALUE('\EFIT01::TOP.RESULTS.GEQDSK:R')
z = MDSVALUE('\EFIT01::TOP.RESULTS.GEQDSK:Z')
MDSCLOSE
MDSDISCONNECT
The exact tree and node paths depend on the diagnostic or analysis tree you are targeting.
Local Helper Routines
Older PPPL workflows also used local helper routines such as OpenMDSshot and
MDSGetSig to wrap the raw calls.
stat = OpenMDSshot('nstx', shot)
signal = MDSGetSig('\ip1', XAXIS=timebase, XUNITS=xunits, YUNITS=yunits)
Those helper routines are still a legacy dependency for some internal code, but the direct MDSplus calls above are the clearer baseline.
How to Make a Private MDSplus Tree
- Pick a tree name such as
mytesttree. - Define the tree path environment variable and create the target directory.
- Create a model tree in
mdstcl. - Add nodes with Traverser or TCL.
- Create a pulse number and write test data from IDL.
export mytesttree_path=/u/yourname/testtreedir
mkdir testtreedir
mdstcl
TCL> edit/new mytesttree
TCL> set tree mytesttree
TCL> create pulse 10
TCL> exit
IDL> MDSOPEN, 'mytesttree', 10
IDL> x = FINDGEN(10) & data = x^2
IDL> MDSPUT, ':onedim', 'build_signal($,*,$)', data, x