Ejemplo n.º 1
0
Archivo: setup.py Proyecto: ktritz/fdp
 def setUp(self, shotnumber=204952):
     """
     Shot 204952: Valid MPTS, CHERS, BES, EFIT01,
     Filterscopes, Neutrons, Magnetics, NBI, USXR, MSE
     """
     self.nstxu = fdp.nstx()
     self.shotnumber = shotnumber
     self.shot = getattr(self.nstxu, 's'+repr(self.shotnumber))
Ejemplo n.º 2
0
def test_shot_management():
    ishot = 0
    # load shot with machine instantiation
    nstx = fdp.nstx(shotlist=shotlist[ishot])
    assert shotlist[ishot] in nstx
    assert isinstance(nstx[shotlist[ishot]], fdp.classes.shot.Shot)
    # load shot with adshot() method
    ishot += 1
    nstx.addshot(shotlist=shotlist[ishot])
    assert shotlist[ishot] in nstx
    assert isinstance(nstx[shotlist[ishot]], fdp.classes.shot.Shot)
    # add shot by attribute reference
    ishot += 1
    shot = getattr(nstx, 's{}'.format(shotlist[ishot]))
    assert shotlist[ishot] in nstx
    assert isinstance(shot, fdp.classes.shot.Shot)
    # check shotlist
    assert len(dir(nstx)) == 4
    assert len(nstx) == 3
    nstx.listshot()
Ejemplo n.º 3
0
def test_shot_management():
    ishot = 0
    # load shot with machine instantiation
    nstx = fdp.nstx(shotlist=shotlist[ishot])
    assert shotlist[ishot] in nstx
    assert isinstance(nstx[shotlist[ishot]], fdp.classes.shot.Shot)
    # load shot with adshot() method
    ishot += 1
    nstx.addshot(shotlist=shotlist[ishot])
    assert shotlist[ishot] in nstx
    assert isinstance(nstx[shotlist[ishot]], fdp.classes.shot.Shot)
    # add shot by attribute reference
    ishot += 1
    shot = getattr(nstx, 's{}'.format(shotlist[ishot]))
    assert shotlist[ishot] in nstx
    assert isinstance(shot, fdp.classes.shot.Shot)
    # check shotlist
    assert len(dir(nstx)) == 4
    assert len(nstx) == 3
    nstx.listshot()
Ejemplo n.º 4
0
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 12 10:59:49 2016

@author: drsmith
"""

import fdp

nstx = fdp.nstx()

shotnumbers = [141000, 204620]
nstx.addshot(shotnumbers)
for shotnumber in shotnumbers:
    shot = nstx[shotnumber]
    shot.magnetics.highf.plot()
    shot.magnetics.derived.midf_oddn.plot()
    shot.magnetics.highn.highn_1.plot()
Ejemplo n.º 5
0
def test_load_date():
    nstx = fdp.nstx()
    nstx.adddate(date='20160506')
    assert len(nstx) == 30
Ejemplo n.º 6
0
def test_load_xp():
    nstx = fdp.nstx()
    nstx.addxp(xp=1038)
    assert len(nstx) == 24
Ejemplo n.º 7
0
def setup_nstx():
    nstx = fdp.nstx()
    nstx.addshot(shotlist=shotlist)
    return nstx
Ejemplo n.º 8
0
def test_load_date():
    nstx = fdp.nstx()
    nstx.adddate(date='20160506')
    assert len(nstx) == 30
Ejemplo n.º 9
0
def test_load_xp():
    nstx = fdp.nstx()
    nstx.addxp(xp=1038)
    assert len(nstx) == 24
Ejemplo n.º 10
0
def setup_nstx():
    nstx = fdp.nstx()
    nstx.addshot(shotlist=shotlist)
    return nstx