Skip to content
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

Fix original MC nsb reading #1272

Merged
merged 6 commits into from
Jul 8, 2024
Merged

Fix original MC nsb reading #1272

merged 6 commits into from
Jul 8, 2024

Conversation

gabemery
Copy link
Collaborator

@gabemery gabemery commented Jul 3, 2024

closes #1271

Change the behaviour of extract_simulation_nsb to identify the nsb entries used with the telescopes and ignore other entries (for prod5 and LSTprod2). Return a dictionary to be accessed by tel_id.

Replace the access to simtel object by hand in favour of SimTelFile.history.

@gabemery gabemery added the bug Something isn't working label Jul 3, 2024
@gabemery gabemery self-assigned this Jul 3, 2024
tel_id = 1
with SimTelFile(filename) as f:
try:
for _, line in f.history:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems very brittle. Don't we have a better way to understand which option is the correct one to use other than the one that follow STORE_PHOTOELECTRONS?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see one. But I am not an expert of simtel so maybe I am missing something. As far as I know the information is only located here and there is no clear indication of its usage.

What I checked is that, for whatever reason, the nsb entries corresponding to the final config of each telescope follow this pattern for the two latest MC productions (in the files I checked). But not other entries.

I agree it is brittle and the use of the new metadata available in Simtel will be better once we use it for MC productions. Until then, we have to hope that the config used are somewhat consistent...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no better option as of now.
Perhaps you can add a clear warning log message stating what value will be used, so that the user can eventually check on the simtel config files that it is what it should be.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, this info is currently given in a info level message without warning the user to check it. I will add a dedicated warning message.

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.27%. Comparing base (7f92595) to head (88eb930).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1272      +/-   ##
==========================================
- Coverage   73.28%   73.27%   -0.01%     
==========================================
  Files         134      134              
  Lines       14084    14074      -10     
==========================================
- Hits        10321    10313       -8     
+ Misses       3763     3761       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@moralejo
Copy link
Collaborator

moralejo commented Jul 4, 2024

Ok from my side! Unless @maxnoe has further comments, I am fine with this.

@maxnoe
Copy link
Member

maxnoe commented Jul 4, 2024

Seems like this is the best we can do for now

lstchain/io/io.py Outdated Show resolved Hide resolved
@gabemery gabemery requested a review from morcuended July 5, 2024 11:29
Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thx!

@rlopezcoto rlopezcoto merged commit 27ce931 into main Jul 8, 2024
8 of 9 checks passed
@rlopezcoto rlopezcoto deleted the Fix_mc_nsb_reading branch July 8, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong base nsb level used in tuning at waveform level
5 participants