MDSplus Access to ITPA Data • • • • • •
Introduction to MDSplus How to get and install software How to access data Local vs. Remote access Miscellaneous MDSplus information Resources
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
1
MDSplus • Initial implementation 1987-1991 • Hierarchical Data Storage • Rich data types – http://www.mdsplus.org/gettingstarted/datatypes.html
• Powerful Expression Evaluator • Widely used by Fusion Community
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
2
MDSplus Data Types • Scalars and Arrays of most integer and floating point data types as well as text • Advanced types – – – – –
signals (value,optional raw data,dim0,dim1…) with_units (value,units) with_error (value,error) range (start : end : increment) expressions
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
3
MDSplus
Location 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
M IT, C am bridg e, MA C NR, P a dova , Italy E P F L, La usanne , S witzerland M IT, C am bridg e, MA Ta ejeon , S outh K ore a Gen era l A to mic s, S an D iego , C A P P P L , P rinc eton , NJ U o f W ashin gton , S ea ttle, W A U o f W ashin gton , S ea ttle, W A U o f W ashin gton , S ea ttle, W A A NU, C a nbe rra, A ustralia F ra sc ati,Italy EFDA Tianjin University o f C h ina , P RC NIF S , Tajim i, J apan UC S D , S a n D ie go, C A S A IC , S a n D ie go, C A M IT, C am bridg e, MA C olum bia U, NY , NY C olum bia U, NY , NY K u rc ato v Institute , M osc o w, Ru ssia LA NL , L os A lam os, NM LA NL , L os A lam os, NM U o f W ashin gton , Red mo nd, W A LB L, Oakland , C A U o f W isc on sin, Ma dison , W I LB L, Oakland , C A A NL, A rgo nne , IL Garc hing, Ge rm any
April 10, 2002
Installations
M achine/ First P latform s Code Used C -Mo d RF X TC V P TF HA NB IT D III-D NS TX Za P HIT TIP H1 F TU JET HT-7 U C HS P IS C E S NIM ROD LD X HB T-E P C TX T-10 M TF F RX -L TC S NIM ROD MST Globu s Globu s ASDEX
19 91 19 91 19 92 19 95 19 96 19 97 19 97 19 98 19 98 19 98 19 99 19 99 20 00 20 00 20 00 20 00 20 00 20 01 20 01 20 01 20 01 20 01 20 01 20 01 20 01 20 01 20 01 20 01 20 02
OV MS ,W NT,L inu x,Tru 64,M ac OS OV MS ,Tru 64,S olaris,Linu x,W NT,vxW orks OV MS ,Lin ux OV MS OV MS ,S olaris Tru64 ,HP UX ,L inu x,W NT,IRIX ,OV MS ,Ma c OS OV MS ,S olaris,Tru64 ,Linu x,W NT Linux,W NT,OV MS ,Tru 64 " " OV MS ,Tru 64,L inux,W NT Tru64 Linux,S olaris W NT OV MS ,Tru 64,W NT W NT Linux, S GI Irix, C ray Unic os OV MS ,MA C OV MS ,W NT " Linux S u nOS " W NT,MA C ,OV M S C ray T3 E OV MS Linux, S olaris Linux, S olaris S o laris
MDSplus access to ITPA Data Thomas Fredian
4
MDSplus Usage Growth 30
Sites
25 20 15 10 5 0 1991
April 10, 2002
1993
1995
1997
MDSplus access to ITPA Data Thomas Fredian
1999
2001
5
Installing MDSplus • Distributions at: http://www.mdsplus.org/mdsplus/install_kits.html • RPM’s for several Unix platforms • Install kit for Windows (95+) • CVS repository (:pserver:
[email protected]:/mdsplus/repos ---- password: MDSguest)
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
6
Accessing Data 1) 2) 3) 4) 5) 6)
Connect to Data Server Open MDSplus Data File (Tree) Read Data Read Associated Data Close Tree Disconnect from Server
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
7
1) Connect to Data Server IDL> mdsconnect, ‘tokamak-profiledb.ukaea.org.uk’
Program Test Include ‘mdslib.inc’ Integer status status = MdsConnect(‘tokamak-profiledb.ukaea.org.uk’//char(0))
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
8
2) Open MDSplus Tree IDL> mdsopen,‘pr98_tftr’, 102257 [,status=status,/quiet]
status = MdsOpen(‘pr98_tftr’//char(0),102257)
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
9
3) Read Data IDL> zeff = mdsvalue(‘\top.oned:zeff’) Real*4 zeff(2000) Integer*4 samples_returned Integer*4 status … status = MdsValue2(‘\\top.oned:zeff’//char(0), + descr2(IDTYPE_FLOAT,2000,0),zeff,0,samples_returned)
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
10
4) Read Associated Data IDL> time = mdsvalue(‘dim_of(\top.oned:zeff)’) IDL> units = mdsvalue(‘units_of(\top.oned:zeff)’) Real*4 time(2000) Integer*4 samples_returned Integer*4 status Character*12 units … status = MdsValue2(‘dim_of(\\top.oned:zeff)’//char(0), + descr2(IDTYPE_FLOAT,2000,0),time,0,samples_returned) status = MdsValue2(‘units_of(\\top.oned:zeff)’//char(0), + descr2(IDTYPE_CSTRING,0,12),units,0,samples_returned) April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
11
5) Close Tree IDL> MdsClose,’pr98_tftr’, 102257
status = MdsClose(‘pr98_tftr’//char(0),102257)
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
12
6) Discconect from Server IDL> mdsdisconnect
status = MdsDisconnect()
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
13
Status checking • Odd status value equals success • Text of message obtained by expression: ‘getmsg(status-value)’ IDL> msg=mdsvalue(‘getmsg(42)’)
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
14
Writing Data IDL> mdsput, ‘\top.oned:zeff’, ‘build_signal($,*,$)’,zeff,time Real*4 zeff(2000) Real*4 time(2000) Integer*4 status Character*12 units … status = MdsPut2(‘\\top.oned:zeff’//char(0), + build_signal($,*,$)//char(0)’, + descr2(IDTYPE_FLOAT,2000,0),zeff,0),zeff, + descr2(IDTYPE_FLOAT,2000,0),time,0) April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
15
Writing Data (advanced) IDL> mdsput, ‘\top.oned:zeff’, $ ‘build_signal(build_with_units($, “amperes”), $ *, $ build_with_units(.5 : 1.5 : .01, “seconds”))’,zeff
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
16
Compiling and Linking # f77 –o myapp –I/usr/local/mdsplus/include myapp.f \ -L/usr/local/mdsplus/lib -lMdsLib
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
17
Local versus Remote • Trees can reside on remote system or on local file system • Local tree location defined by environment variables or Windows registry entries – mytree_path=/home/twf/mytreedir – HKEY_LOCAL_MACHINE\SOFTWARE\MIT\MDSplus\mytree_path=C:\mytree
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
18
Tools for Accessing Data • API for programming languages (C, Fortran) • High level languages (IDL, MATLAB, Visual Basic, LABVIEW) • General purpose visualization tools – Reviewplus – Dwscope and jScope – Traverser and jTraverser April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
19
Traverser Icons for Node usage
Expandable Node
Right button popup menu Command Window April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
20
Scope
Auto tracking crosshairs
Middle button menu
Pointer Mode
shot number
Tree Creation • Traverser and/or jTraverser • mdstcl command language • Model tree replication
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
22
Data Server Access Control • Mapping file for mapping remote clients to local accounts • Coming soon: Secure connections using X509 certificates with Globus/Akenti enhancements
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
23
Useful links • Getting started http://www.mdsplus.org/gettingstarted/table_of_contents.html
• Graphical Interfaces http://www.mdsplus.org/gettingstarted/graphicinterfaces.html
• Fortran Interface http://www.mdsplus.org/mdslib/mdslib.html
• MDSplus Speak http://www.mdsplus.org/glossary/glossary.pdf April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
24
Resources • Documentation/papers found at http://www.mdsplus.org/ • FusionGrid work http://www.fusiongrid.org/ •
[email protected]
April 10, 2002
MDSplus access to ITPA Data Thomas Fredian
25