-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Last updated scripts (4-LSTs): Torino group #180
base: master
Are you sure you want to change the base?
Conversation
Hi, many changes are in the documentation of the functions, but most of them, they should not have been changed. I.e. the spaces removed between the name of the parameter and the colon. I think you have some setting in your editor which is removing them automatically, but that makes the lint and docs checks fail. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #180 +/- ##
==========================================
- Coverage 76.17% 75.36% -0.82%
==========================================
Files 21 21
Lines 2493 2419 -74
==========================================
- Hits 1899 1823 -76
- Misses 594 596 +2 ☔ View full report in Codecov by Sentry. |
Hi, we had to substitute some of the functions/whole scripts with the newer
version, thus loosing some spaces in the copy paste (only in the Doc
strings; I checked the scripts and no previous analysis update has been
lost). But fixing them now is much easier than trying to integrate all the
updates in the master to preserve the doc strings (we changed a lot of code
lines, and on a fork created months ago, so even the automatic git merge
fails and manual merging is a pain in the neck, as we discovered during the
first PR). But I will fix them tomorrow: BTW, they do not interfere with
the code tests and the scripts (need only to be fixed before the merge just
not to 'propagate' do string issues to the next PRs)
Il mar 5 dic 2023, 17:34 codecov[bot] ***@***.***> ha scritto:
… Codecov
<https://app.codecov.io/gh/cta-observatory/magic-cta-pipe/pull/180?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory>
Report
Attention: 4 lines in your changes are missing coverage. Please review.
Comparison is base (5a2e33b)
<https://app.codecov.io/gh/cta-observatory/magic-cta-pipe/commit/5a2e33bb70b2a4e5011d81d6adf533c08d4496b0?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory>
76.13% compared to head (f2d39a9)
<https://app.codecov.io/gh/cta-observatory/magic-cta-pipe/pull/180?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory>
75.32%.
Files
<https://app.codecov.io/gh/cta-observatory/magic-cta-pipe/pull/180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory> Patch
% Lines
magicctapipe/io/io.py
<https://app.codecov.io/gh/cta-observatory/magic-cta-pipe/pull/180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory#diff-bWFnaWNjdGFwaXBlL2lvL2lvLnB5>
86.20% 4 Missing
--
------------------------
Indirizzo istituzionale di posta elettronica
degli studenti e dei laureati dell'Università di TorinoOfficial University
of Turin email address for students and graduates
|
Fixed :) |
I do not have any major comment. @jsitarek can you also have a look? it should be fast anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comment/questions
magicctapipe/io/io.py
Outdated
|
||
logger.info(f"\nExtracting the events of the '{event_type}' type...") | ||
|
||
if event_type == "software": | ||
# The events of the MAGIC-stereo combination are excluded | ||
df_events.query("(combo_type > 0) & (magic_stereo == True)", inplace=True) | ||
df_events.query( | ||
f"(combo_type < {combo_types[-1]}) & (magic_stereo == True)", inplace=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking into account the other problem that we had with the combo_type it might be safer to access this combination by name "M1_M2"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
magicctapipe/io/io.py
Outdated
elif event_type == "software_only_3tel": | ||
df_events.query("combo_type == 3", inplace=True) | ||
elif event_type == "software_6_tel": | ||
df_events.query(f"combo_type < {combo_types[-1]}", inplace=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
magicctapipe/io/io.py
Outdated
|
||
elif event_type == "magic_only": | ||
df_events.query("combo_type == 0", inplace=True) | ||
df_events.query(f"combo_type == {combo_types[-1]}", inplace=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
magicctapipe/io/io.py
Outdated
@@ -1032,24 +876,36 @@ def load_dl2_data_file(input_file, quality_cuts, event_type, weight_type_dl2): | |||
If the input event type is not known | |||
""" | |||
|
|||
TEL_NAMES, TEL_COMBINATIONS = telescope_combinations(config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same 6 lines are also in load_mc_dl2_data_file
better to extract them in a separate function to make sure that the same code is used for data and MCs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the only difference is that in real data we do not ask for magic_stereo == True in the 'software' because standard MAGIC + LST-1 data are always collected with MAGIC stereo trigger, but we can take this into account easily
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
magicctapipe/io/io.py
Outdated
|
||
elif event_type == "magic_only": | ||
event_data.query("combo_type == 0", inplace=True) | ||
event_data.query(f"combo_type == {combo_types[-1]}", inplace=True) | ||
|
||
elif event_type == "hardware": | ||
logger.warning( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hardware trigger is already implemented in ctapipe_io_magic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
for the events of the any 2-tel combinations except the MAGIC-stereo | ||
combination at the moment. The "software_only_3tel" type allows for only | ||
the events of the 3-tel combination. The "magic_only" type allows for | ||
The "software_3tels_or_more" type stands for the software event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we modify the types following my earlier comment they need to be updated here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
combo_type = list(TEL_COMBINATIONS.values()).index(tel_ids) | ||
df_events = event_data.query(f"combo_type == {combo_type}") | ||
# Extract the events with the same telescope ID | ||
df_events = event_data.query(f"tel_id == {tel_ids[0]}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand why do you always take the first tel_id here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the tel_ids list (i.e., the dictionary in 'estimator') only contains one element (we create one RF file per telescope and this 'list' will contain the ID of the telescope corresponding to the used RF file). So we take always the first because ti is the only tel_id
Due to the large number of conflict with the master (and the 'timescale' of the commits both here and in the master, which will probably cause a mess if we try to merge them), I will open a new branch from the current master (ctapipe 0.19) to implement 'manually' the changes in the RFs; we can then merge this new branch. This PR will be kept open as a draft to allow us to solve the open conversations |
Here the last updated analysis steps (RFs, DL2, DL3): new RF implementation (one per telescope instead of one per telescope per combination).
Again a huge PR, and it would be great if we could merge it before the LST school (to remove hardcoded variables and duplicated functions due to the new-old glueing at the DL1-stereo level).
The Doc strings must still be fixed a bit (to pass the tests), but you can already take a look into it.
Thanks