Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
holds extracted data with condition 2 applied
'''
log = log_error_and_file.Log('Process')
# abbreviate attribute
m = mnemonic_data
returndata = dict()
#########################################################################
con_set_1 = [ \
cond.equal(m['IMIR_HK_IMG_CAL_LOOP'], 'OFF'), \
cond.equal(m['IMIR_HK_IFU_CAL_LOOP'], 'OFF'), \
cond.equal(m['IMIR_HK_POM_LOOP'], 'OFF'), \
cond.smaller(m['IMIR_HK_ICE_SEC_VOLT1'], 1.0), \
cond.greater(m['SE_ZIMIRICEA'], 0.2)]
# setup condition
condition_1 = cond.condition(con_set_1)
# add filtered engineering values of mnemonics given in list mnemonic_cond_1
# to dictitonary
for identifier in mn.mnemonic_cond_1:
data = extract_data.extract_data(condition_1, m[identifier])
if data != None:
returndata.update({identifier: data})
log.log('Check condition 1 Succesful for ' + identifier)
else:
log.log('NO data in condition 1 for ' + identifier, 'Error')
del condition_1
data_cond_1 : dict
holds extracted data with condition 2 applied
'''
#abbreviate attribute
m = mnemonic_data
returndata = dict()
#########################################################################
con_set_1 = [ \
cond.equal(m.mnemonic('IMIR_HK_IMG_CAL_LOOP'),'OFF'), \
cond.equal(m.mnemonic('IMIR_HK_IFU_CAL_LOOP'),'OFF'), \
cond.equal(m.mnemonic('IMIR_HK_POM_LOOP'),'OFF'), \
cond.smaller(m.mnemonic('IMIR_HK_ICE_SEC_VOLT1'),1.0), \
cond.greater(m.mnemonic('SE_ZIMIRICEA'),0.2)]
#setup condition
condition_1 = cond.condition(con_set_1)
#add filtered engineering values of mnemonics given in list mnemonic_cond_1
#to dictitonary
for identifier in mn.mnemonic_cond_1:
data = extract_data(condition_1, m.mnemonic(identifier))
if data != None:
returndata.update( {identifier:data} )
else:
print("no data for {}".format(identifier))
del condition_1
------
FW : dict
holds FW ratio values and times with corresponding positionlabel as key
GW14 : dict
holds GW14 ratio values and times with corresponding positionlabel as key
GW23 : dict
holds GW23 ratio values and times with corresponding positionlabel as key
CCC : dict
holds CCC ratio values and times with corresponding positionlabel as key
'''
#abbreviate attribute
m = mnemonic_data
con_set_FW = [ \
cond.greater(m.mnemonic('IMIR_HK_FW_POS_VOLT'),250.0)]
#setup condition
condition_FW = cond.condition(con_set_FW)
FW = extract_filterpos(condition_FW, mn.fw_nominals, \
m.mnemonic('IMIR_HK_FW_POS_RATIO'), m.mnemonic('IMIR_HK_FW_CUR_POS'))
del condition_FW
con_set_GW14 = [ \
cond.greater(m.mnemonic('IMIR_HK_GW14_POS_VOLT'),250.0)]
#setup condition
condition_GW14 = cond.condition(con_set_GW14)
GW14 = extract_filterpos(condition_GW14, mn.gw14_nominals, \
m.mnemonic('IMIR_HK_GW14_POS_RATIO'), m.mnemonic('IMIR_HK_GW14_CUR_POS'))
del condition_GW14
FW_volt = extract_data(condition_FW, m.mnemonic('IMIR_HK_FW_POS_VOLT'))
returndata.update({'IMIR_HK_FW_POS_VOLT':FW_volt})
del condition_FW
#extract data for IMIR_HK_GW14_POS_VOLT under given condition
con_set_GW14 = [ \
cond.greater(m.mnemonic('IMIR_HK_GW14_POS_VOLT'),250.0)]
#setup condition
condition_GW14 = cond.condition(con_set_GW14)
GW14_volt = extract_data(condition_GW14, m.mnemonic('IMIR_HK_GW14_POS_VOLT'))
returndata.update({'IMIR_HK_GW14_POS_VOLT':GW14_volt})
del condition_GW14
#extract data for IMIR_HK_GW23_POS_VOLT under given condition
con_set_GW23 = [ \
cond.greater(m.mnemonic('IMIR_HK_GW23_POS_VOLT'),250.0)]
#setup condition
condition_GW23 = cond.condition(con_set_GW23)
GW23_volt = extract_data(condition_GW23, m.mnemonic('IMIR_HK_GW23_POS_VOLT'))
returndata.update({'IMIR_HK_GW23_POS_VOLT':GW23_volt})
del condition_GW23
#extract data for IMIR_HK_CCC_POS_VOLT under given condition
con_set_CCC = [ \
cond.greater(m.mnemonic('IMIR_HK_CCC_POS_VOLT'),250.0)]
#setup condition
condition_CCC = cond.condition(con_set_CCC)
CCC_volt = extract_data(condition_CCC, m.mnemonic('IMIR_HK_CCC_POS_VOLT'))
returndata.update({'IMIR_HK_CCC_POS_VOLT':CCC_volt})
del condition_CCC
return returndata
FW = extract_filterpos(condition_FW, mn.fw_nominals, \
m.mnemonic('IMIR_HK_FW_POS_RATIO'), m.mnemonic('IMIR_HK_FW_CUR_POS'))
del condition_FW
con_set_GW14 = [ \
cond.greater(m.mnemonic('IMIR_HK_GW14_POS_VOLT'),250.0)]
#setup condition
condition_GW14 = cond.condition(con_set_GW14)
GW14 = extract_filterpos(condition_GW14, mn.gw14_nominals, \
m.mnemonic('IMIR_HK_GW14_POS_RATIO'), m.mnemonic('IMIR_HK_GW14_CUR_POS'))
del condition_GW14
con_set_GW23 = [ \
cond.greater(m.mnemonic('IMIR_HK_GW23_POS_VOLT'),250.0)]
#setup condition
condition_GW23 = cond.condition(con_set_GW23)
GW23 = extract_filterpos(condition_GW23, mn.gw23_nominals, \
m.mnemonic('IMIR_HK_GW23_POS_RATIO'), m.mnemonic('IMIR_HK_GW23_CUR_POS'))
del condition_GW23
con_set_CCC = [ \
cond.greater(m.mnemonic('IMIR_HK_CCC_POS_VOLT'),250.0)]
#setup condition
condition_CCC = cond.condition(con_set_CCC)
CCC = extract_filterpos(condition_CCC, mn.ccc_nominals, \
m.mnemonic('IMIR_HK_CCC_POS_RATIO'), m.mnemonic('IMIR_HK_CCC_CUR_POS'))
del condition_CCC
------
FW : dict
holds FW ratio values and times with corresponding positionlabel as key
GW14 : dict
holds GW14 ratio values and times with corresponding positionlabel as key
GW23 : dict
holds GW23 ratio values and times with corresponding positionlabel as key
CCC : dict
holds CCC ratio values and times with corresponding positionlabel as key
'''
# abbreviate attribute
m = mnemonic_data
con_set_FW = [ \
cond.greater(m['IMIR_HK_FW_POS_VOLT'], 250.0)]
# setup condition
condition_FW = cond.condition(con_set_FW)
FW = extract_filterpos(condition_FW, mn.fw_nominals, \
m['IMIR_HK_FW_POS_RATIO'], m['IMIR_HK_FW_CUR_POS'])
del condition_FW
con_set_GW14 = [ \
cond.greater(m['IMIR_HK_GW14_POS_VOLT'], 250.0)]
# setup condition
condition_GW14 = cond.condition(con_set_GW14)
GW14 = extract_filterpos(condition_GW14, mn.gw14_nominals, \
m['IMIR_HK_GW14_POS_RATIO'], m['IMIR_HK_GW14_CUR_POS'])
del condition_GW14
condition_3 = cond.condition(con_set_3)
for identifier in mn.mnemonic_cond_3:
data = extract_data.extract_data(condition_3, m[identifier])
if data is not None:
returndata.update({identifier: data})
log.log('Check condition 3 Succesful for ' + identifier)
else:
log.log('NO data in condition 3 for ' + identifier, 'Error')
del condition_3
# Define Condition Set FW
# add filtered engineering values of mnemonics given in list mnemonic_cond_FW
con_set_FW = [
cond.greater(m['IMIR_HK_FW_POS_VOLT'], 250.0)]
condition_FW = cond.condition(con_set_FW)
FW_volt = extract_data.extract_data(condition_FW, m['IMIR_HK_FW_POS_VOLT'])
returndata.update({'IMIR_HK_FW_POS_VOLT': FW_volt})
del condition_FW
log.log('Check condition IMIR_HK_FW_POS_VOLT > 250')
# Define Condition Set GW
# add filtered engineering values of mnemonics given in list mnemonic_cond_GW
con_set_GW14 = [
cond.greater(m['IMIR_HK_GW14_POS_VOLT'], 250.0)]
condition_GW14 = cond.condition(con_set_GW14)
GW14_volt = extract_data.extract_data(condition_GW14, m['IMIR_HK_GW14_POS_VOLT'])
returndata.update({'IMIR_HK_GW14_POS_VOLT': GW14_volt})
del condition_GW14
GW14_volt : list
extracted data for IMIR_HK_GW14_POS_VOLT
GW23_volt : list
extracted data for IMIR_HK_GW23_POS_VOLT
CCC_volt : list
extracted data for IMIR_HK_CCC_POS_VOLT
"""
log = log_error_and_file.Log('Process')
m = mnemonic_data
returndata = dict()
# Define Condition Set 3
# add filtered engineering values of mnemonics given in list mnemonic_cond_3
con_set_3 = [
cond.greater(m['IMIR_HK_ICE_SEC_VOLT1'], 25.0)]
condition_3 = cond.condition(con_set_3)
for identifier in mn.mnemonic_cond_3:
data = extract_data.extract_data(condition_3, m[identifier])
if data is not None:
returndata.update({identifier: data})
log.log('Check condition 3 Succesful for ' + identifier)
else:
log.log('NO data in condition 3 for ' + identifier, 'Error')
del condition_3
# Define Condition Set FW
# add filtered engineering values of mnemonics given in list mnemonic_cond_FW
con_set_FW = [
cond.greater(m['IMIR_HK_FW_POS_VOLT'], 250.0)]
GW14_volt = extract_data(condition_GW14, m['IMIR_HK_GW14_POS_VOLT'])
returndata.update({'IMIR_HK_GW14_POS_VOLT': GW14_volt})
del condition_GW14
# extract data for IMIR_HK_GW23_POS_VOLT under given condition
con_set_GW23 = [ \
cond.greater(m['IMIR_HK_GW23_POS_VOLT'], 250.0)]
# setup condition
condition_GW23 = cond.condition(con_set_GW23)
GW23_volt = extract_data(condition_GW23, m['IMIR_HK_GW23_POS_VOLT'])
returndata.update({'IMIR_HK_GW23_POS_VOLT': GW23_volt})
del condition_GW23
# extract data for IMIR_HK_CCC_POS_VOLT under given condition
con_set_CCC = [ \
cond.greater(m['IMIR_HK_CCC_POS_VOLT'], 250.0)]
# setup condition
condition_CCC = cond.condition(con_set_CCC)
CCC_volt = extract_data(condition_CCC, m['IMIR_HK_CCC_POS_VOLT'])
returndata.update({'IMIR_HK_CCC_POS_VOLT': CCC_volt})
del condition_CCC
return returndata