Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ievgen Vovk
ctapipe_io_magic
Commits
474a67b2
Commit
474a67b2
authored
Nov 29, 2021
by
Alessio Berti
Browse files
Make the mono generator the default one.
parent
e2b6036f
Pipeline
#116195
failed with stage
in 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ctapipe_io_magic/__init__.py
View file @
474a67b2
...
...
@@ -122,9 +122,11 @@ class MAGICEventSource(EventSource):
run_info
=
self
.
get_run_info_from_name
(
str
(
input_url
))
run_numbers
=
run_info
[
0
]
is_mc_runs
=
run_info
[
1
]
telescope
=
run_info
[
2
]
self
.
run_numbers
=
run_numbers
self
.
is_mc
=
is_mc_runs
self
.
telescope
=
telescope
# Retrieving the data level (so far HARDCODED Sorcerer)
self
.
datalevel
=
DataLevel
.
DL1_IMAGES
...
...
@@ -194,9 +196,9 @@ class MAGICEventSource(EventSource):
A run number of the file.
"""
mask_data
=
r
".*\d+_M\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_data
=
r
".*\d+_M
(
\d+
)
_(\d+)\.\d+_Y_.*"
mask_mc
=
r
".*_M
(
\d
)
_za\d+to\d+_\d_(\d+)_Y_.*"
mask_mc_alt
=
r
".*_M
(
\d
)
_\d_(\d+)_.*"
if
re
.
findall
(
mask_data
,
file_name
):
parsed_info
=
re
.
findall
(
mask_data
,
file_name
)
is_mc
=
False
...
...
@@ -208,13 +210,14 @@ class MAGICEventSource(EventSource):
is_mc
=
True
try
:
run_number
=
int
(
parsed_info
[
0
])
telescope
=
int
(
parsed_info
[
0
][
0
])
run_number
=
int
(
parsed_info
[
0
][
1
])
except
IndexError
:
raise
IndexError
(
'Can not identify the run number and type (data/MC) of the file'
'{:s}'
.
format
(
file_name
))
return
run_number
,
is_mc
return
run_number
,
is_mc
,
telescope
def
_set_active_run
(
self
,
run_number
):
"""
...
...
@@ -264,7 +267,7 @@ class MAGICEventSource(EventSource):
"""
return
self
.
_
stere
o_event_generator
()
return
self
.
_
mon
o_event_generator
(
telescope
=
f
"M
{
self
.
telescope
}
"
)
def
_stereo_event_generator
(
self
):
"""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment