In [9]:
import MDSplus as mds
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [37]:
# mds.ipp.ac.cn corresponds to public IP 202.127.204.12
# Also working : 202.127.204.42, 202.127.205.8
cnx = mds.Connection('mds.ipp.ac.cn')

In [55]:
shot_nb = 55672
cnx.openTree('east', shot_nb)

In [32]:
Ip = cnx.get('\IPM')
t_Ip = cnx.get('dim_of(\IPM)')

In [33]:
plot(t_Ip, Ip, lw=2)
grid()
xlim(0,8)


Out[33]:
(0, 8)

A more pretty (or Pythonesque) approach from Laurent :


In [53]:
def get_signal(signal_name, shot_nb, mdsplus_connection):
    """
    Retrieves a signal and its associated time vector 
    for a given shot number on EAST
    """
    mdsplus_connection.openTree('EAST', shot_nb)
    return mdsplus_connection.get(signal_name), \
            mdsplus_connection.get('dim_of('+signal_name+')')

In [59]:
Ip, t_Ip = get_signal('\IPM', shot_nb, cnx)

In [61]:
Ne, t_Ne = get_signal('TOP:\dfsdev', shot_nb, cnx)


---------------------------------------------------------------------------
MdsException                              Traceback (most recent call last)
<ipython-input-61-39b5d3911b05> in <module>()
----> 1 Ne, t_Ne = get_signal('TOP:\dfsdev', shot_nb, cnx)

<ipython-input-53-012eb885f444> in get_signal(signal_name, shot_nb, mdsplus_connection)
      5     """
      6     mdsplus_connection.openTree('EAST', shot_nb)
----> 7     return mdsplus_connection.get(signal_name),             mdsplus_connection.get('dim_of('+signal_name+')')

C:\Program Files\WinPython\python-3.3.5.amd64\lib\site-packages\mdsplus-6.3_113-py3.3.egg\MDSplus\connection.py in get(self, exp, *args, **kwargs)
    260             idx=idx+1
    261             self.__sendArg__(arg,idx,num)
--> 262         return self.__getAnswer__()
    263 
    264 

C:\Program Files\WinPython\python-3.3.5.amd64\lib\site-packages\mdsplus-6.3_113-py3.3.egg\MDSplus\connection.py in __getAnswer__(self)
    130                 MdsIpFree(mem)
    131             if isinstance(ans,_scalar.String):
--> 132                 raise MdsException(str(ans))
    133             else:
    134                 raise MdsException(MdsGetMsg(status))

MdsException: %TREE-W-TreeNNF, Node Not Found

A list of various signals

sig_name description
\IPM plasma current
\dfsdev
\plhi1 LHCD 1 Incident power
\plhi2 LHCD 2 Incident power
\plhr1 LHCD 1 Reflected power
\plhr2 LHCD 2 Reflected power
\nbi1lhv BOX1 - LEFT - NBI
\nbi2lhv BOX2
\nbi1rhv BOX1 - RIGHT - NBI
\nbi2rhv BOX2
\icrf9 antenna B - Line 1
\icrf10
\icrf11 antenna B - Line 2
\icrf12
\icrf13 antenna B - Line 3
\icrf14
\icrf15 antenna B - Line 4
\icrf16
\te0_hrs Te0

In [ ]: