Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ctapipe_io_magic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Ievgen Vovk
ctapipe_io_magic
Commits
762e81a8
Commit
762e81a8
authored
4 years ago
by
Federico Di Pierro
Browse files
Options
Downloads
Patches
Plain Diff
Introduced assertion error instead of simple warning print
parent
07efa9a5
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!12
Add general run-wise MC info
Pipeline
#89384
failed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ctapipe_io_magic/__init__.py
+11
-17
11 additions, 17 deletions
ctapipe_io_magic/__init__.py
with
11 additions
and
17 deletions
ctapipe_io_magic/__init__.py
+
11
−
17
View file @
762e81a8
...
...
@@ -334,24 +334,18 @@ class MAGICEventSource(EventSource):
data
.
mon
.
tels_with_data
=
{
1
,
2
}
data
.
mon
.
tel
[
tel_i
+
1
]
=
monitoring_camera
else
:
if
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_nevents
'
]
!=
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M2
'
][
'
sim_nevents
'
]
or
\
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_emin
'
]
!=
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M2
'
][
'
sim_emin
'
]
or
\
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_emax
'
]
!=
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M2
'
][
'
sim_emax
'
]
or
\
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_eslope
'
]
!=
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M2
'
][
'
sim_eslope
'
]
or
\
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_max_impact
'
]
!=
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M2
'
][
'
sim_max_impact
'
]
or
\
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_conesemiangle
'
]
!=
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M2
'
][
'
sim_conesemiangle
'
]:
print
(
"
WARNING!!! Simulation configurations are different for M1 and M2 !!!
"
)
assert
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
]
==
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M2
'
],
"
Simulation configurations are different for M1 and M2 !!!
"
data
.
mcheader
.
num_showers
=
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_nevents
'
]
data
.
mcheader
.
energy_range_min
=
(
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_emin
'
]).
to
(
u
.
TeV
)
# GeV->TeV
data
.
mcheader
.
energy_range_max
=
(
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_emax
'
]).
to
(
u
.
TeV
)
# GeV->TeV
data
.
mcheader
.
spectral_index
=
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_eslope
'
]
data
.
mcheader
.
max_scatter_range
=
(
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_max_impact
'
]).
to
(
u
.
m
)
# cm->m
data
.
mcheader
.
max_viewcone_radius
=
(
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_conesemiangle
'
]).
to
(
u
.
deg
)
# deg->deg
if
data
.
mcheader
.
max_viewcone_radius
!=
0.
:
data
.
mcheader
.
diffuse
=
True
else
:
data
.
mcheader
.
num_showers
=
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_nevents
'
]
data
.
mcheader
.
energy_range_min
=
(
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_emin
'
]).
to
(
u
.
TeV
)
# GeV->TeV
data
.
mcheader
.
energy_range_max
=
(
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_emax
'
]).
to
(
u
.
TeV
)
# GeV->TeV
data
.
mcheader
.
spectral_index
=
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_eslope
'
]
data
.
mcheader
.
max_scatter_range
=
(
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_max_impact
'
]).
to
(
u
.
m
)
# cm->m
data
.
mcheader
.
max_viewcone_radius
=
(
self
.
current_run
[
'
data
'
].
mcheader_data
[
'
M1
'
][
'
sim_conesemiangle
'
]).
to
(
u
.
deg
)
# deg->deg
if
data
.
mcheader
.
max_viewcone_radius
!=
0.
:
data
.
mcheader
.
diffuse
=
True
else
:
data
.
mcheader
.
diffuse
=
False
data
.
mcheader
.
diffuse
=
False
# Loop over the events
for
event_i
in
range
(
self
.
current_run
[
'
data
'
].
n_stereo_events
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment