Commit 474a67b2 authored by Alessio Berti's avatar Alessio Berti
Browse files

Make the mono generator the default one.

parent e2b6036f
Pipeline #116195 failed with stage
in 7 seconds
...@@ -122,9 +122,11 @@ class MAGICEventSource(EventSource): ...@@ -122,9 +122,11 @@ class MAGICEventSource(EventSource):
run_info = self.get_run_info_from_name(str(input_url)) run_info = self.get_run_info_from_name(str(input_url))
run_numbers = run_info[0] run_numbers = run_info[0]
is_mc_runs = run_info[1] is_mc_runs = run_info[1]
telescope = run_info[2]
self.run_numbers = run_numbers self.run_numbers = run_numbers
self.is_mc = is_mc_runs self.is_mc = is_mc_runs
self.telescope = telescope
# Retrieving the data level (so far HARDCODED Sorcerer) # Retrieving the data level (so far HARDCODED Sorcerer)
self.datalevel = DataLevel.DL1_IMAGES self.datalevel = DataLevel.DL1_IMAGES
...@@ -194,9 +196,9 @@ class MAGICEventSource(EventSource): ...@@ -194,9 +196,9 @@ class MAGICEventSource(EventSource):
A run number of the file. A run number of the file.
""" """
mask_data = r".*\d+_M\d+_(\d+)\.\d+_Y_.*" mask_data = r".*\d+_M(\d+)_(\d+)\.\d+_Y_.*"
mask_mc = r".*_M\d_za\d+to\d+_\d_(\d+)_Y_.*" mask_mc = r".*_M(\d)_za\d+to\d+_\d_(\d+)_Y_.*"
mask_mc_alt = r".*_M\d_\d_(\d+)_.*" mask_mc_alt = r".*_M(\d)_\d_(\d+)_.*"
if re.findall(mask_data, file_name): if re.findall(mask_data, file_name):
parsed_info = re.findall(mask_data, file_name) parsed_info = re.findall(mask_data, file_name)
is_mc = False is_mc = False
...@@ -208,13 +210,14 @@ class MAGICEventSource(EventSource): ...@@ -208,13 +210,14 @@ class MAGICEventSource(EventSource):
is_mc = True is_mc = True
try: try:
run_number = int(parsed_info[0]) telescope = int(parsed_info[0][0])
run_number = int(parsed_info[0][1])
except IndexError: except IndexError:
raise IndexError( raise IndexError(
'Can not identify the run number and type (data/MC) of the file' 'Can not identify the run number and type (data/MC) of the file'
'{:s}'.format(file_name)) '{:s}'.format(file_name))
return run_number, is_mc return run_number, is_mc, telescope
def _set_active_run(self, run_number): def _set_active_run(self, run_number):
""" """
...@@ -264,7 +267,7 @@ class MAGICEventSource(EventSource): ...@@ -264,7 +267,7 @@ class MAGICEventSource(EventSource):
""" """
return self._stereo_event_generator() return self._mono_event_generator(telescope=f"M{self.telescope}")
def _stereo_event_generator(self): def _stereo_event_generator(self):
""" """
......
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