Retrieving Tore Supra data via the Python MDSplus package

Import the python MDSplus package:


In [1]:
import MDSplus as mds

Accessing to a simple signal


In [2]:
conx = mds.Connection('mdsplus.partenaires.cea.fr:8000')
y = conx.get('_sig=gettsbase(34567,"SIPMES")')
t = conx.get('dim_of(_sig)')

In [3]:
plot(t,y, lw=2)
xlabel('t [s]')
ylabel('I_p [MA]')
grid('on')
axis([-1, 20, 0, 0.7])
title('Plasma Current TS#34567')


Out[3]:
<matplotlib.text.Text at 0x615b0b8>

Group of signals

Lower Hybrid injected Power


In [5]:
Phyb = conx.get('_sig=gettsbase(47979, "GPHYB")')
Phyb_t = conx.get('dim_of(_sig)')

In [6]:
plot(Phyb_t.value[0,:], Phyb.value[0,:]) # C3
plot(Phyb_t.value[1,:], Phyb.value[1,:]) # C4


Out[6]:
[<matplotlib.lines.Line2D at 0xa26e1d0>]

LH power in the module #2 of the C3 launcher


In [14]:
Plh = conx.get('_sig=gettsbase(47978,"GPINJC1%1")') 
Plh_t = conx.get('dim_of(_sig)')
shape(Plh)


Out[14]:
(1L, 3584L)

In [15]:
plot(Plh_t.value[0,:], Plh.value[0,:])


Out[15]:
[<matplotlib.lines.Line2D at 0xa766e10>]