Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

getgetSlice


Code Block
languagepy
titleIMAS Python :: get
linenumberstrue
#system libraries
import sys
import numpy
import os
 
#UAL library
import imas

# Gets user name and data (major) version
user = os.environ['USER']
imasVersion = os.environ['IMAS_VERSION'][:1]
database = 'test'

#Open a database
imas_obj = imas.ids(11, 22)
imas_obj.open_env(user, database, imasVersion)  

ids = imas_obj.core_profiles

#Get data
ids.get()

# SCALARS (!)
for i in range(len(ids.time)):
    print 'Time   =' + str(ids.time[i]) 
    print 'Value  =' VECTORS OF SIZE N
print ('Time  = '  + str(ids.x.y[i])

# VECTORS (!time))
print 'Time  = '  + str(ids.time)
print 'Value  = ' + str(ids.x.y)
global_quantities.ip))

#close the pulse file
imas_obj.close()



Code Block
languagepy
titleIMAS Python :: getSlice
linenumberstrue
#system libraries
import sys
import numpy
import os
 
#UAL library
import imas
 
 # Gets user name and data (major) version
user = os.environ['USER']
imasVersion = os.environ['IMAS_VERSION'][:1]
database = 'test'

#Open a database
imas_obj = imas.ids(11,22)
imas_obj.open_env(user, database, imasVersion) 
 

ids = imas_obj.core_profiles
 
#Get data
ids.getSlice(23, 12)
 
#VECTORS of SIZE 1 (!)
print ('Time : ' + str(ids.time))
print ('VALUE = ' + str(ids.x.yglobal_quantities.ip))
 
#close the pulse file
imas_obj.close()


...