Connecting to the JET database


In [1]:
import MDSplus as mds

Connect to the JET MDSplus server


In [2]:
conx = mds.Connection('mdsplus.jet.efda.org')
print(conx.hostspec)


mdsplus.jet.efda.org

Read data

The list of recommended signals in the JET database can be found here: http://users.jet.efda.org/openwiki/index.php/List_of_Recommended_Signals

1D signal


In [3]:
y = conx.get('_sig=jet("ppf/magn/ipla", 80812)') # plasma current in SI unit [A]
t = conx.get('dim_of(_sig)') # time vector

In [4]:
plot(t, abs(y)/1e6, lw=2)
xlabel('t [s]')
ylabel('Ip [MA]')
grid()



In [13]:
tets=conx.get('_sig=jet("jpf/DA/C2E-EFCC<15", 80812)')

In [16]:
plot(tets)


Out[16]:
[<matplotlib.lines.Line2D at 0xa388a58>]

2D signal

Let's have a look to a more complicated data, 2D dimensionals


In [9]:
ne = conx.get('_sig=jet("ppf/KY6/NER", 80812)') # Li beam ne measurement
ne_R = conx.get('dim_of(_sig,0)') # major radius in meter
ne_t = conx.get('dim_of(_sig,1)') # time in second

In [54]:
print(shape(ne), shape(ne_R), shape(ne_t))


(494L, 48L) (48L,) (494L,)

In [17]:
toffset=40 # plasma breakdown offset time
RR, tt = meshgrid(ne_R, ne_t-toffset)
pcolormesh(RR, tt, ne.value, shading='gouraud') # pcolormesh is faster and recommanded vs pcolor (from matplotlib doc)
xlabel('Major Radius [m]')
ylabel('Time [s]')


Out[17]:
<matplotlib.text.Text at 0xa234908>