#system libraries
import imassys
import numpy
#ual library
import sys imas
# Create a new instance of database
imas_obj = imas.ids(11, 22)
imas_obj.create() # Create a new instance of database
# Define a first generic vector and its time base
time = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]
ids = imas_obj.core_profiles
# allocate the ids fie
ids.global_quantities.ip.resize(len(time10))
ids.time.resize(len(time10))
# Mandatory to define this property
ids.ids_properties.homogeneous_time = 0
#First fill fields which are not time-dependent.
# Fillthe ids fields with data
ids.ids_properties.comment = 'A test ids 'This iscreated by PUT'
# ---- a test ids'loop ----
for i in range(len(time)0,10):
#Fill time-dependent fields
ids.global_quantities.ip[i] = time[i] * 10
#Do not forget time!!
ids.time[i] = time[i]i
# ---- a loop ----
#Save data in the database
ids.put() # <= Called outside the loop
imas_obj.close() |