import summary
import amns
import antennas
import coredelta
import coreneutrals
import coreimpur
import coreprof
import coresource
import coretransp
import cxdiag
import distribution
import distsource
import ecediag
import edge
import equilibrium
import fusiondiag
import interfdiag
import ironmodel
import langmuirdiag
import launchs
import limiter
import mhd
import magdiag
import msediag
import nbi
import neoclassic
import orbit
import pfsystems
import polardiag
import reference
import sawteeth
import scenario
import toroidfield
import tsdiag
import turbulence
import vessel
import waves
class itm:
def __init__(self, s=-1, r=-1, rs=-1, rr=-1):
[docs] self.shot = s
[docs] self.refShot = rs
self.run = r
self.refRun = rr
self.treeName = 'euitm'
self.connected = False
self.expIdx = -1
self.topinfo = topinfo.topinfo()
self.summary = summary.summary()
self.amns = amns.amns()
self.antennas = antennas.antennas()
self.antennasArray = antennas.antennasArray()
self.coredelta = coredelta.coredelta()
self.coredeltaArray = coredelta.coredeltaArray()
self.coreneutrals = coreneutrals.coreneutrals()
self.coreneutralsArray = coreneutrals.coreneutralsArray()
self.coreimpur = coreimpur.coreimpur()
self.coreimpurArray = coreimpur.coreimpurArray()
self.coreprof = coreprof.coreprof()
self.coreprofArray = coreprof.coreprofArray()
self.coresource = coresource.coresource()
self.coresourceArray = coresource.coresourceArray()
self.coretransp = coretransp.coretransp()
self.coretranspArray = coretransp.coretranspArray()
self.cxdiag = cxdiag.cxdiag()
self.cxdiagArray = cxdiag.cxdiagArray()
self.distribution = distribution.distribution()
self.distributionArray = distribution.distributionArray()
self.distsource = distsource.distsource()
self.distsourceArray = distsource.distsourceArray()
self.ecediag = ecediag.ecediag()
self.ecediagArray = ecediag.ecediagArray()
self.edge = edge.edge()
self.edgeArray = edge.edgeArray()
self.equilibrium = equilibrium.equilibrium()
self.equilibriumArray = equilibrium.equilibriumArray()
self.fusiondiag = fusiondiag.fusiondiag()
self.fusiondiagArray = fusiondiag.fusiondiagArray()
self.interfdiag = interfdiag.interfdiag()
self.interfdiagArray = interfdiag.interfdiagArray()
self.ironmodel = ironmodel.ironmodel()
self.ironmodelArray = ironmodel.ironmodelArray()
self.langmuirdiag = langmuirdiag.langmuirdiag()
self.langmuirdiagArray = langmuirdiag.langmuirdiagArray()
self.launchs = launchs.launchs()
self.launchsArray = launchs.launchsArray()
self.limiter = limiter.limiter()
self.mhd = mhd.mhd()
self.mhdArray = mhd.mhdArray()
self.magdiag = magdiag.magdiag()
self.magdiagArray = magdiag.magdiagArray()
self.msediag = msediag.msediag()
self.msediagArray = msediag.msediagArray()
self.nbi = nbi.nbi()
self.nbiArray = nbi.nbiArray()
self.neoclassic = neoclassic.neoclassic()
self.neoclassicArray = neoclassic.neoclassicArray()
self.orbit = orbit.orbit()
self.orbitArray = orbit.orbitArray()
self.pfsystems = pfsystems.pfsystems()
self.pfsystemsArray = pfsystems.pfsystemsArray()
self.polardiag = polardiag.polardiag()
self.polardiagArray = polardiag.polardiagArray()
self.reference = reference.reference()
self.referenceArray = reference.referenceArray()
self.sawteeth = sawteeth.sawteeth()
self.sawteethArray = sawteeth.sawteethArray()
self.scenario = scenario.scenario()
self.scenarioArray = scenario.scenarioArray()
self.toroidfield = toroidfield.toroidfield()
self.toroidfieldArray = toroidfield.toroidfieldArray()
self.tsdiag = tsdiag.tsdiag()
self.tsdiagArray = tsdiag.tsdiagArray()
self.turbulence = turbulence.turbulence()
self.turbulenceArray = turbulence.turbulenceArray()
self.vessel = vessel.vessel()
self.waves = waves.waves()
self.wavesArray = waves.wavesArray()
def __str__(self, depth=0):
space = ''
[docs] for i in range(depth):
space = space + '\t'
ret = space + 'class itm\n'
ret = ret + space + 'Shot=%d, Run=%d, RefShot%d RefRun=%d\n' % (self.shot, self.run, self.refShot, self.refRun)
ret = ret + space + 'treeName=%s, connected=%d, expIdx=%d\n' % (self.treeName, self.connected, self.expIdx)
ret = ret + space + 'Attribute topinfo\n' + self.topinfo.__str__(depth+1)
ret = ret + space + 'Attribute summary\n' + self.summary.__str__(depth+1)
ret = ret + space + 'Attribute amns\n' + self.amns.__str__(depth+1)
ret = ret + space + 'Attribute antennas\n' + self.antennas.__str__(depth+1)
ret = ret + space + 'Attribute antennasArray\n' + self.antennasArray.__str__(depth+1)
ret = ret + space + 'Attribute coredelta\n' + self.coredelta.__str__(depth+1)
ret = ret + space + 'Attribute coredeltaArray\n' + self.coredeltaArray.__str__(depth+1)
ret = ret + space + 'Attribute coreneutrals\n' + self.coreneutrals.__str__(depth+1)
ret = ret + space + 'Attribute coreneutralsArray\n' + self.coreneutralsArray.__str__(depth+1)
ret = ret + space + 'Attribute coreimpur\n' + self.coreimpur.__str__(depth+1)
ret = ret + space + 'Attribute coreimpurArray\n' + self.coreimpurArray.__str__(depth+1)
ret = ret + space + 'Attribute coreprof\n' + self.coreprof.__str__(depth+1)
ret = ret + space + 'Attribute coreprofArray\n' + self.coreprofArray.__str__(depth+1)
ret = ret + space + 'Attribute coresource\n' + self.coresource.__str__(depth+1)
ret = ret + space + 'Attribute coresourceArray\n' + self.coresourceArray.__str__(depth+1)
ret = ret + space + 'Attribute coretransp\n' + self.coretransp.__str__(depth+1)
ret = ret + space + 'Attribute coretranspArray\n' + self.coretranspArray.__str__(depth+1)
ret = ret + space + 'Attribute cxdiag\n' + self.cxdiag.__str__(depth+1)
ret = ret + space + 'Attribute cxdiagArray\n' + self.cxdiagArray.__str__(depth+1)
ret = ret + space + 'Attribute distribution\n' + self.distribution.__str__(depth+1)
ret = ret + space + 'Attribute distributionArray\n' + self.distributionArray.__str__(depth+1)
ret = ret + space + 'Attribute distsource\n' + self.distsource.__str__(depth+1)
ret = ret + space + 'Attribute distsourceArray\n' + self.distsourceArray.__str__(depth+1)
ret = ret + space + 'Attribute ecediag\n' + self.ecediag.__str__(depth+1)
ret = ret + space + 'Attribute ecediagArray\n' + self.ecediagArray.__str__(depth+1)
ret = ret + space + 'Attribute edge\n' + self.edge.__str__(depth+1)
ret = ret + space + 'Attribute edgeArray\n' + self.edgeArray.__str__(depth+1)
ret = ret + space + 'Attribute equilibrium\n' + self.equilibrium.__str__(depth+1)
ret = ret + space + 'Attribute equilibriumArray\n' + self.equilibriumArray.__str__(depth+1)
ret = ret + space + 'Attribute fusiondiag\n' + self.fusiondiag.__str__(depth+1)
ret = ret + space + 'Attribute fusiondiagArray\n' + self.fusiondiagArray.__str__(depth+1)
ret = ret + space + 'Attribute interfdiag\n' + self.interfdiag.__str__(depth+1)
ret = ret + space + 'Attribute interfdiagArray\n' + self.interfdiagArray.__str__(depth+1)
ret = ret + space + 'Attribute ironmodel\n' + self.ironmodel.__str__(depth+1)
ret = ret + space + 'Attribute ironmodelArray\n' + self.ironmodelArray.__str__(depth+1)
ret = ret + space + 'Attribute langmuirdiag\n' + self.langmuirdiag.__str__(depth+1)
ret = ret + space + 'Attribute langmuirdiagArray\n' + self.langmuirdiagArray.__str__(depth+1)
ret = ret + space + 'Attribute launchs\n' + self.launchs.__str__(depth+1)
ret = ret + space + 'Attribute launchsArray\n' + self.launchsArray.__str__(depth+1)
ret = ret + space + 'Attribute limiter\n' + self.limiter.__str__(depth+1)
ret = ret + space + 'Attribute mhd\n' + self.mhd.__str__(depth+1)
ret = ret + space + 'Attribute mhdArray\n' + self.mhdArray.__str__(depth+1)
ret = ret + space + 'Attribute magdiag\n' + self.magdiag.__str__(depth+1)
ret = ret + space + 'Attribute magdiagArray\n' + self.magdiagArray.__str__(depth+1)
ret = ret + space + 'Attribute msediag\n' + self.msediag.__str__(depth+1)
ret = ret + space + 'Attribute msediagArray\n' + self.msediagArray.__str__(depth+1)
ret = ret + space + 'Attribute nbi\n' + self.nbi.__str__(depth+1)
ret = ret + space + 'Attribute nbiArray\n' + self.nbiArray.__str__(depth+1)
ret = ret + space + 'Attribute neoclassic\n' + self.neoclassic.__str__(depth+1)
ret = ret + space + 'Attribute neoclassicArray\n' + self.neoclassicArray.__str__(depth+1)
ret = ret + space + 'Attribute orbit\n' + self.orbit.__str__(depth+1)
ret = ret + space + 'Attribute orbitArray\n' + self.orbitArray.__str__(depth+1)
ret = ret + space + 'Attribute pfsystems\n' + self.pfsystems.__str__(depth+1)
ret = ret + space + 'Attribute pfsystemsArray\n' + self.pfsystemsArray.__str__(depth+1)
ret = ret + space + 'Attribute polardiag\n' + self.polardiag.__str__(depth+1)
ret = ret + space + 'Attribute polardiagArray\n' + self.polardiagArray.__str__(depth+1)
ret = ret + space + 'Attribute reference\n' + self.reference.__str__(depth+1)
ret = ret + space + 'Attribute referenceArray\n' + self.referenceArray.__str__(depth+1)
ret = ret + space + 'Attribute sawteeth\n' + self.sawteeth.__str__(depth+1)
ret = ret + space + 'Attribute sawteethArray\n' + self.sawteethArray.__str__(depth+1)
ret = ret + space + 'Attribute scenario\n' + self.scenario.__str__(depth+1)
ret = ret + space + 'Attribute scenarioArray\n' + self.scenarioArray.__str__(depth+1)
ret = ret + space + 'Attribute toroidfield\n' + self.toroidfield.__str__(depth+1)
ret = ret + space + 'Attribute toroidfieldArray\n' + self.toroidfieldArray.__str__(depth+1)
ret = ret + space + 'Attribute tsdiag\n' + self.tsdiag.__str__(depth+1)
ret = ret + space + 'Attribute tsdiagArray\n' + self.tsdiagArray.__str__(depth+1)
ret = ret + space + 'Attribute turbulence\n' + self.turbulence.__str__(depth+1)
ret = ret + space + 'Attribute turbulenceArray\n' + self.turbulenceArray.__str__(depth+1)
ret = ret + space + 'Attribute vessel\n' + self.vessel.__str__(depth+1)
ret = ret + space + 'Attribute waves\n' + self.waves.__str__(depth+1)
ret = ret + space + 'Attribute wavesArray\n' + self.wavesArray.__str__(depth+1)
return ret
def __del__(self):
if self.expIdx != -1:
[docs] ull.euitm_close(self.expIdx)
def setShot(self, inShot):
self.shot = inShot
[docs]
def setRun(self, inRun):
self.run = inRun
[docs]
def setRefShot(self, inRefShot):
self.refShot = inRefShot
[docs]
def setRefNum(self, inRefRun):
self.refRun = inRefRun
[docs]
def setTreeName(self, inTreeName):
self.treeName = inTreeName
[docs]
def getShot(self):
return self.shot
[docs]
def getRun(self):
return self.run
[docs]
def getRefShot(self):
return self.refShot
[docs]
def getRefRun(self):
return self.refRun
[docs]
def getTreeName(self):
return self.treeName
[docs]
def isConnected(self):
return self.connected
[docs]
def create(self):
status, idx = ull.euitm_create(self.treeName, self.shot, self.run, self.refShot, self.refRun)
[docs] self.__update_cpo(status, idx)
def create_env(self, user, tokamak, version):
status, idx = ull.euitm_create_env(self.treeName, self.shot, self.run, self.refShot, self.refRun, user, tokamak, version)
[docs] self.__update_cpo(status, idx)
def create_hdf5(self):
status, idx = ull.euitm_create_hdf5(self.treeName, self.shot, self.run, self.refShot, self.refRun)
[docs] self.__update_cpo(status, idx)
def open(self):
status, idx = ull.euitm_open(self.treeName, self.shot, self.run)
[docs] self.__update_cpo(status, idx)
def open_env(self, user, tokamak, version):
status, idx = ull.euitm_open_env(self.treeName, self.shot, self.run, user, tokamak, version)
[docs] self.__update_cpo(status, idx)
def open_hdf5(self):
status, idx = ull.euitm_open_hdf5(self.treeName, self.shot, self.run)
[docs] self.__update_cpo(status, idx)
def __update_cpo(self, status, idx):
if status != 0:
print 'Error opening euitm shot ' + str(self.shot) + ' run ' + str(self.run) + ': ' + ull.euitm_last_errmsg()
else:
self.expIdx = idx
self.connected = True
self.topinfo.setExpIdx(idx)
self.summary.setExpIdx(idx)
self.amns.setExpIdx(idx)
self.antennas.setExpIdx(idx)
self.antennasArray.setExpIdx(idx)
self.coredelta.setExpIdx(idx)
self.coredeltaArray.setExpIdx(idx)
self.coreneutrals.setExpIdx(idx)
self.coreneutralsArray.setExpIdx(idx)
self.coreimpur.setExpIdx(idx)
self.coreimpurArray.setExpIdx(idx)
self.coreprof.setExpIdx(idx)
self.coreprofArray.setExpIdx(idx)
self.coresource.setExpIdx(idx)
self.coresourceArray.setExpIdx(idx)
self.coretransp.setExpIdx(idx)
self.coretranspArray.setExpIdx(idx)
self.cxdiag.setExpIdx(idx)
self.cxdiagArray.setExpIdx(idx)
self.distribution.setExpIdx(idx)
self.distributionArray.setExpIdx(idx)
self.distsource.setExpIdx(idx)
self.distsourceArray.setExpIdx(idx)
self.ecediag.setExpIdx(idx)
self.ecediagArray.setExpIdx(idx)
self.edge.setExpIdx(idx)
self.edgeArray.setExpIdx(idx)
self.equilibrium.setExpIdx(idx)
self.equilibriumArray.setExpIdx(idx)
self.fusiondiag.setExpIdx(idx)
self.fusiondiagArray.setExpIdx(idx)
self.interfdiag.setExpIdx(idx)
self.interfdiagArray.setExpIdx(idx)
self.ironmodel.setExpIdx(idx)
self.ironmodelArray.setExpIdx(idx)
self.langmuirdiag.setExpIdx(idx)
self.langmuirdiagArray.setExpIdx(idx)
self.launchs.setExpIdx(idx)
self.launchsArray.setExpIdx(idx)
self.limiter.setExpIdx(idx)
self.mhd.setExpIdx(idx)
self.mhdArray.setExpIdx(idx)
self.magdiag.setExpIdx(idx)
self.magdiagArray.setExpIdx(idx)
self.msediag.setExpIdx(idx)
self.msediagArray.setExpIdx(idx)
self.nbi.setExpIdx(idx)
self.nbiArray.setExpIdx(idx)
self.neoclassic.setExpIdx(idx)
self.neoclassicArray.setExpIdx(idx)
self.orbit.setExpIdx(idx)
self.orbitArray.setExpIdx(idx)
self.pfsystems.setExpIdx(idx)
self.pfsystemsArray.setExpIdx(idx)
self.polardiag.setExpIdx(idx)
self.polardiagArray.setExpIdx(idx)
self.reference.setExpIdx(idx)
self.referenceArray.setExpIdx(idx)
self.sawteeth.setExpIdx(idx)
self.sawteethArray.setExpIdx(idx)
self.scenario.setExpIdx(idx)
self.scenarioArray.setExpIdx(idx)
self.toroidfield.setExpIdx(idx)
self.toroidfieldArray.setExpIdx(idx)
self.tsdiag.setExpIdx(idx)
self.tsdiagArray.setExpIdx(idx)
self.turbulence.setExpIdx(idx)
self.turbulenceArray.setExpIdx(idx)
self.vessel.setExpIdx(idx)
self.waves.setExpIdx(idx)
self.wavesArray.setExpIdx(idx)
def close(self):
if(self.expIdx != -1):
[docs] ull.euitm_close(self.expIdx)
self.connected = False
self.expIdx = -1