Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
Ievgen Vovk
ctapipe_io_magic
Commits
02212890
Commit
02212890
authored
Dec 19, 2019
by
Moritz Huetten
Browse files
updated readme
parent
2624f035
Pipeline
#65844
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
02212890
...
...
@@ -25,15 +25,15 @@ python setup.py install --user
import
ctapipe
from
ctapipe_io_magic
import
MAGICEventSource
with
MAGICEventSource
(
input_url
=
file_name
)
as
source
:
for
event
in
source
:
with
MAGICEventSource
(
input_url
=
file_name
)
as
event_
source
:
for
event
in
event_
source
:
...
some
processing
...
```
The reader also works with multiple files parsed as wildcards, e.g.,
```
python
MAGICEventSource
(
input_url
=
'data_dir/*.root'
)
event_source
=
MAGICEventSource
(
input_url
=
'data_dir/*.root'
)
```
This is necessary to load and match stereo events, which are automatically created if data files from M1 and M2 for the same run are loaded.
...
...
@@ -44,6 +44,27 @@ The reader is able to handle data or Monte Carlo files, which are automatically
Note that currently, when loading multiple runs at once, the event ID is not unique.
##### More usage
Select a single run:
```
python
run
=
event_source
.
_set_active_run
(
event_source
.
run_numbers
[
0
])
for
n
in
range
(
run
[
'data'
].
n_stereo_events
):
run
[
'data'
].
get_stereo_event_data
(
n
)
for
n
in
range
(
run
[
'data'
].
n_mono_events_m1
):
run
[
'data'
].
get_mono_event_data
(
n
,
'M1'
)
for
n
in
range
(
run
[
'data'
].
n_pedestal_events_m1
):
run
[
'data'
].
get_pedestal_event_data
(
n
,
'M1'
)
```
Select mono/pedestal events over event generator:
```
python
mono_event_generator
=
event_source
.
_mono_event_generator
(
telescope
=
'M1'
)
for
m1_mono_event
in
mono_event_generator
:
...
some
processing
...
pedestal_event_generator
=
event_source
.
_pedestal_event_generator
(
telescope
=
'M1'
)
...
```
#### Changelog
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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