tcv package

Module contents

This library provides easy access to TCV experimental data using Python. Here’s a quick example how to get the plasma current in the latest experiment:

>>> import tcv
>>> conn = tcv.shot()
>>> ip = conn.tdi(r'tcv_ip()')
<xarray.DataArray 'tcv_ip()' (dim_0: 16384)>
array([  2229.64526367,   2116.44580078,   2209.29492188, ...,
       -23054.24414062, -22913.67578125, -23049.359375  ], dtype=float32)
Coordinates:
  * dim_0    (dim_0) float32 -0.318 -0.3178 -0.3176 -0.3174 -0.3172  ...
Attributes:
    units: A
    query: tcv_ip()
    shot: 0
tcv.shot(shotnum=0, tree='tcv_shot', server='tcvdata.epfl.ch')[source]

Create an MDS connection to the TCV shot database

Parameters:
  • shotnum (int or MDSConnection instance) – Shot number or an open MDS connection
  • tree (str, optional) – Name of the tree to open
  • server (str, optional) – MDS database server
tcv.tcvview(shotnum, time, vessel=True, ports=False, tiles=True)[source]

Popular way to display TCV.

Parameters:
  • shotnum (int, or MDSConnection) – Shot number or an open MDS connection instance.
  • time (float) – Time of the equilibrium.
  • vessel (bool, optional) – Draw vessel.
  • ports (bool, optional) – Draw ports
  • tiles (bool, optional) – Draw tiles.

Example

>>> import tcv
>>> tcv.tcvview(42660, 1)