Commit 2d1634a2 authored by Daniel Morcuende's avatar Daniel Morcuende
Browse files

Change M1 M2 by LST1 LST2

parent 23944657
......@@ -44,8 +44,8 @@ def closer():
# FIXME: ask_for_reason is not defined anywhere
# ask_for_reason()
# Proceed with a reason
# elif is_raw_data_available() or use_night_summary():
elif use_night_summary():
elif is_raw_data_available() or use_night_summary():
#elif use_night_summary():
# Proceed normally
verbose(tag, f"Checking sequencer_tuple {sequencer_tuple}")
night_summary_output = readnightsummary()
......
......@@ -36,7 +36,7 @@ def writeworkflow(sequence_list):
content += "n{0} -> n{1};\n".format(i.parent_list[0].seq, i.seq)
else:
""" Two parents, stereo mode, assign indexes for each range,
this means 0 - m-1 (for the st), m - 2m-1 (for M1), 2m - 3m-1 (for M2)"""
this means 0 - m-1 (for the st), m - 2m-1 (for LST1), 2m - 3m-1 (for LST2)"""
m = len(sequence_list)
index = i.seq
for j in i.parent_list:
......
......@@ -120,10 +120,10 @@ class Report():
rep_path = "/data/_TEL_/OSA/CC/_DATETIME_/"
# Fill telescope
if "M1" in basename:
TEL = "M1"
elif "M2" in basename:
TEL = "M2"
if "LST1" in basename:
TEL = "LST1"
elif "LST2" in basename:
TEL = "LST2"
rep_path = rep_path.replace("_TEL_",TEL)
......@@ -182,15 +182,15 @@ class Report():
#### FIXME. THIS IS A CHAPUZA !!!!: REMOVE n/a when the missing flatfielding issue is addressed
#known_redHV = [\
# 'n/a',\
# 'HV_M1_flatfielding_4kQ_20131114',\
# 'HV_M2_flatfielding_3750Q_20131114']
# 'HV_LST1_flatfielding_4kQ_20131114',\
# 'HV_LST2_flatfielding_3750Q_20131114']
known_redHV = [\
'HV_M1_flatfielding_4kQ_20131114',\
'HV_M2_flatfielding_3750Q_20131114',\
'HV_M1_flatfielding_reduced_20151112',\
'HV_M2_flatfielding_reduced_20151112',\
'HV_M1_flatfielding_reduced_20160709']
'HV_LST1_flatfielding_4kQ_20131114',\
'HV_LST2_flatfielding_3750Q_20131114',\
'HV_LST1_flatfielding_reduced_20151112',\
'HV_LST2_flatfielding_reduced_20151112',\
'HV_LST1_flatfielding_reduced_20160709']
if self.HV_set in known_redHV or '_reduced_' in self.HV_set:
self.RedHV = True
......@@ -215,10 +215,10 @@ class Report():
rep_path = "/data/_TEL_/OSA/CC/_DATETIME_/"
# Fill telescope
if "M1" in basename:
rep_path = rep_path.replace("_TEL_","M1")
elif "M2" in basename:
rep_path = rep_path.replace("_TEL_","M2")
if "LST1" in basename:
rep_path = rep_path.replace("_TEL_","LST1")
elif "LST2" in basename:
rep_path = rep_path.replace("_TEL_","LST2")
# Fill datetime
rep_path = rep_path.replace("_DATETIME_",\
......
......@@ -58,7 +58,7 @@ def build(rawdir):
from osa.configs.config import cfg
# from mysql import select_db
# We could try to make a mysql call similar to this:
# [analysis@ana7 ~]$ mysql -s -N -uanalysis -hfcana7 -Dmagic_test -e "select DAQ.RUN, DAQ.SUBRUN, 'DATA', DAQ.END, DAQ.SOURCEWOBBLE, -1, -1, -1, -1, -1, 'No_Test', 'No_Moon' FROM DAQ INNER JOIN STORAGE ON STORAGE.FILE_PATH LIKE CONCAT('%',SUBSTRING_INDEX(DAQ.FILE_PATH, '/', -1),'.gz') WHERE STORAGE.NIGHT='2012-12-10' AND STORAGE.TELESCOPE='M1' ORDER BY DAQ.END;"
# [analysis@ana7 ~]$ mysql -s -N -uanalysis -hfcana7 -Dmagic_test -e "select DAQ.RUN, DAQ.SUBRUN, 'DATA', DAQ.END, DAQ.SOURCEWOBBLE, -1, -1, -1, -1, -1, 'No_Test', 'No_Moon' FROM DAQ INNER JOIN STORAGE ON STORAGE.FILE_PATH LIKE CONCAT('%',SUBSTRING_INDEX(DAQ.FILE_PATH, '/', -1),'.gz') WHERE STORAGE.NIGHT='2012-12-10' AND STORAGE.TELESCOPE='LST1' ORDER BY DAQ.END;"
error(tag, "This function is not yet implemented", 2)
##############################################################################
......@@ -132,7 +132,7 @@ def getnightsummaryfile():
nightsummaryfile = join(nightsumdir, basename)
return nightsummaryfile
# Only the closer needs the night summary file in case of 'ST'.
# Since ST has no night summary file, we give him the one from M1
# Since ST has no night summary file, we give him the one from LST1
elif options.tel_id == 'ST':
nightsumprefix = config.cfg.get('LSTOSA', 'NIGHTSUMMARYPREFIX')
nightsumsuffix = config.cfg.get('LSTOSA', 'TEXTSUFFIX')
......
......@@ -23,21 +23,23 @@ def arerawfilestransferred():
tag = gettag()
answer = None
if options.tel_id == 'ST':
answer_M1 = arerawfilestransferredfortel('M1')
answer_M2 = arerawfilestransferredfortel('M2')
answer = answer_M1 * answer_M2
answer_LST1 = arerawfilestransferredfortel('LST1')
answer_LST2 = arerawfilestransferredfortel('LST2')
answer = answer_LST1 * answer_LST2
else:
answer = arerawfilestransferredfortel(options.tel_id)
return answer
def get_check_rawdir():
tag = gettag()
from os.path import exists, join
rawdir = getrawdir()
rawsuffix = config.cfg.get('LSTOSA', 'RAWSUFFIX')
verbose(tag, "raw suffix = {0}".format(rawsuffix))
verbose(tag, f"raw suffix = {rawsuffix}")
compressedsuffix = config.cfg.get('LSTOSA', 'COMPRESSEDSUFFIX')
verbose(tag, "raw compressed suffix = {0}".format(rawsuffix + compressedsuffix))
verbose(tag, f"raw compressed suffix = {rawsuffix + compressedsuffix}")
print(rawdir)
if not exists(rawdir):
# The most sensible thing to do is to quit succesfully after a warning
......@@ -64,7 +66,7 @@ def getrawdir():
from os.path import join
from osa.configs import config
rawdir = None
if options.tel_id == 'M1' or options.tel_id == 'M2':
if options.tel_id == 'LST1' or options.tel_id == 'LST2':
rawdir = join(config.cfg.get(options.tel_id, 'RAWDIR'), options.date)
return rawdir
......
......@@ -60,7 +60,7 @@ def finished_text(ana_dict):
content = "analysis.finished.timestamp={0}\n".format(ana_dict['END'])
content += "analysis.finished.night={0}\n".format(ana_dict['NIGHT'])
content += "analysis.finished.telescope={0}\n".format(ana_dict['TELESCOPE'])
if options.tel_id == 'M1' or options.tel_id == 'M2':
if options.tel_id == 'LST1' or options.tel_id == 'LST2':
content += "analysis.finished.data.size={0} GB\n".format(ana_dict['RAW_GB'])
content += "analysis.finished.data.files={0}\n".format(ana_dict['FILES_RAW'])
content += "analysis.finished.data.files.scalibed={0}\n".format(ana_dict['FILES_SCALIB'])
......@@ -116,7 +116,7 @@ def finished_assignments(sequence_list):
ana_files = glob(join(anadir, '*' + cfg.get('LSTOSA', 'ROOTSUFFIX')))
scalib_file_no = 0
calib_file_no = 0
sorcerer_file_no = 0
merpped_file_no = 0
starred_file_no = 0
......
......@@ -73,17 +73,17 @@ def superstar(run_str, history_file):
root_suffix = cfg.get('OSA', 'ROOTSUFFIX')
input_card = join(cfg.get('OSA', 'CARDDIR'),\
cfg.get(options.tel_id, 'SUPERSTARCONFIGCARD'))
star_dir_M1 = cfg.get('M1', 'STARDIR')
star_dir_M2 = cfg.get('M2', 'STARDIR')
star_dir_LST1 = cfg.get('LST1', 'STARDIR')
star_dir_LST2 = cfg.get('LST2', 'STARDIR')
superstarhistogramprefix = cfg.get('OSA', 'SUPERSTARHISTOGRAMPREFIX')
star_ind_M1 = join(star_dir_M1, night_subdir, "*{0}*{1}*{2}".\
format('M1', run_str, root_suffix))
star_ind_M2 = join(star_dir_M2, night_subdir, "*{0}*{1}*{2}".\
star_ind_LST1 = join(star_dir_LST1, night_subdir, "*{0}*{1}*{2}".\
format('LST1', run_str, root_suffix))
star_ind_LST2 = join(star_dir_M2, night_subdir, "*{0}*{1}*{2}".\
format('M2', run_str, root_suffix))
output_basename = "{0}{1}{2}".\
format(superstarhistogramprefix, run_str, root_suffix)
rc = superstar_specific(full_mars_command, input_card, run_str, star_ind_M1,\
rc = superstar_specific(full_mars_command, input_card, run_str, star_ind_LST1,\
star_ind_M2, output_basename, history_file)
""" Error handling """
......@@ -102,7 +102,7 @@ def superstar(run_str, history_file):
# superstar_specific
#
##############################################################################
def superstar_specific(full_mars_command, input_card, run_str, star_ind_M1,\
def superstar_specific(full_mars_command, input_card, run_str, star_ind_LST1,\
star_ind_M2, output_basename, history_file):
tag = gettag()
import subprocess
......@@ -118,15 +118,15 @@ def superstar_specific(full_mars_command, input_card, run_str, star_ind_M1,\
commandargs.append('-q')
commandargs.append('-b')
commandargs.append('--config=' + input_card)
commandargs.append('--ind1=' + star_ind_M1)
commandargs.append('--ind1=' + star_ind_LST1)
commandargs.append('--ind2=' + star_ind_M2)
commandargs.append('--out=' + options.directory)
commandargs.append('--outname=' + output_basename)
M1_star_files = glob(star_ind_M1)
if len(M1_star_files) == 0:
error(tag, "No M1 star file of the form {0} exists yet".\
format(star_ind_M1), 1)
LST1_star_files = glob(star_ind_LST1)
if len(LST1_star_files) == 0:
error(tag, "No LST1 star file of the form {0} exists yet".\
format(star_ind_LST1), 1)
M2_star_files = glob(star_ind_M2)
if len(M2_star_files) == 0:
error(tag, "No M2 star file of the form {0} exists yet".\
......@@ -165,7 +165,7 @@ def melibea(run_str, history_file):
# --ind="InputDIR/*_S_*.root" \
# --out="OutputDIR/." \
# --rf --rftree=RF.root \
# --calc-disp-rf --rfdisptree=M1/DispRF.root \
# --calc-disp-rf --rfdisptree=LST1/DispRF.root \
# --calc-disp2-rf --rfdisp2tree=M2/DispRF.root \
# --calcstereodisp --disp-rf-sstrained \
# -erec --etab=Energy_Table.root
......@@ -185,7 +185,7 @@ def melibea(run_str, history_file):
cfg.get(options.tel_id, 'MELIBEACONFIGCARD'))
rftree = join(cfg.get('ST', 'RANDOMFORESTMATRIXDIR'),\
cfg.get('ST', 'RANDOMFORESTMATRIX'))
disp1 = join(cfg.get('ST', 'DISPM1MATRIXDIR'),\
disp1 = join(cfg.get('ST', 'DISPLST1MATRIXDIR'),\
cfg.get('ST', 'DISPMATRIX'))
disp2 = join(cfg.get('ST', 'DISPM2MATRIXDIR'),\
cfg.get('ST', 'DISPMATRIX'))
......@@ -234,7 +234,7 @@ def melibea_specific(full_mars_command, input_card, run_str, ind, out,\
# --ind=InputDIR/*_S_*.root \
# --out=OutputDIR/. \
# --rf --rftree=RF.root \
# --calc-disp-rf --rfdisptree=M1/DispRF.root \
# --calc-disp-rf --rfdisptree=LST1/DispRF.root \
# --calc-disp2-rf --rfdisp2tree=M2/DispRF.root \
# --calcstereodisp --disp-rf-sstrained \
# -erec --etab=Energy_Table.root
......
......@@ -481,7 +481,7 @@ def rawcopycliparsing(command):
standardhandle.error(tag, "incorrect number of arguments, type -h for help", 2)
elif args[0] == 'ST':
standardhandle.error(tag, "not yet ready for telescope {0}".format(options.options.tel_id), 2)
elif args[0] != 'LST1' and args[0] != 'M2':
elif args[0] != 'LST1' and args[0] != 'LST2':
standardhandle.error(tag, "wrong telescope id, use 'LST1', 'LST2' or 'ST'", 2)
options.tel_id = args[0]
......
......@@ -19,7 +19,7 @@ def monolith():
# Building the set of days
datadays = None
if options.tel_id == 'M1' or options.tel_id == 'M2':
if options.tel_id == 'LST1' or options.tel_id == 'LST2':
datadays = utils.getrawdatadays()
else:
""" The days in which we have stereo data sequences """
......@@ -112,7 +112,7 @@ if __name__ == '__main__':
if options.tel_id:
tel_array.append(options.tel_id)
else:
tel_array = ['M1', 'M2', 'ST']
tel_array = ['LST1', 'LST2', 'ST']
# Run the routine as many times as required in the telescope array
for tel in tel_array:
options.tel_id = tel
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment