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))
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()
# -*- 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()
def test_load_date(): nstx = fdp.nstx() nstx.adddate(date='20160506') assert len(nstx) == 30
def test_load_xp(): nstx = fdp.nstx() nstx.addxp(xp=1038) assert len(nstx) == 24
def setup_nstx(): nstx = fdp.nstx() nstx.addshot(shotlist=shotlist) return nstx