# specify types and explain purpose of the field (-> ask someone with more astronomical background)
# specify types and explain purpose of the field (-> ask someone with more astronomical background)
# todo: check what fields can be implicitely set
# todo: check what fields can be implicitly set
# (e.g. parameter type in dataproduct may be derived from the specific dataproduct class that is used)
# (e.g. parameter type in dataproduct may be derived from the specific dataproduct class that is used)
# Some parameters may also be filled with a reasonable default value. Right now, usually only optional values
# Some parameters may also be filled with a reasonable default value. Right now, usually only optional values
# as per schema definition are optional parameters.
# as per schema definition are optional parameters.
...
@@ -60,11 +56,13 @@ def print_user_warning():
...
@@ -60,11 +56,13 @@ def print_user_warning():
print("!!! might break for you without further warning.")
print("!!! might break for you without further warning.")
print("!!! (You may suppress this warning by setting the flag in the pyxb-related getter/setter functions.)")
print("!!! (You may suppress this warning by setting the flag in the pyxb-related getter/setter functions.)")
# ===============================
# ===============================
# Identifier definition (used for LTA entities, i-e- processes and dataproducts):
# Identifier definition (used for LTA entities, i-e- processes and dataproducts):
classIdentifier(object):
classIdentifier(object):
""" Identifier for LTA entities. """
""" Identifier for LTA entities. """
def__init__(self,
def__init__(self,
source,
source,
userlabel=None,
userlabel=None,
...
@@ -111,6 +109,7 @@ class Identifier(object):
...
@@ -111,6 +109,7 @@ class Identifier(object):
print_user_warning()
print_user_warning()
returnself.__pyxb_identifier
returnself.__pyxb_identifier
# ===============================
# ===============================
# Station definitions:
# Station definitions:
...
@@ -144,13 +143,15 @@ class Station():
...
@@ -144,13 +143,15 @@ class Station():
withopen(STATION_CONFIG_PATH,'r')asf:
withopen(STATION_CONFIG_PATH,'r')asf:
forlineinf.readlines():
forlineinf.readlines():
ifline.strip():
ifline.strip():
field_coords=eval("dict("+line+")")# literal_eval does not accept dict definition via constructor. Make sure config file is not writable to prevent code execution!
field_coords=eval(
"dict("+line+")")# literal_eval does not accept dict definition via constructor. Make sure config file is not writable to prevent code execution!
print("WARNING: There already exists a dataproduct with id",relateddataproduct_sip.__sip.dataProduct.dataProductIdentifier.identifier," - Will try to add any new related items anyway.")
print("WARNING: There already exists a dataproduct with id",