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

Better warning message in R0 to R0G #1285

Merged
merged 4 commits into from
Sep 5, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions lstchain/scripts/lstchain_r0_to_r0g.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,15 @@
# If a relevant fraction of FF-like events were not tagged as FF...:
max_frac = 0.1
if num_FF_like > 0:
if ((num_FF_like_with_no_FF_type / num_FF_like > max_frac) &
(use_flatfield_heuristic == False)):
log.warn('More than %d percent of FF-like events '
'have wrong event_type!', int(100*max_frac))
log.warn('You should use heuristic identification of FF events!')
else:
log.info('R0 to R0G conversion finished successfully!')
frac_untagged_ff_like = num_FF_like_with_no_FF_type / num_FF_like
if frac_untagged_ff_like > max_frac:
log.warn('%d percent of FlatField(FF)-like events are not tagged as FF',

Check warning on line 208 in lstchain/scripts/lstchain_r0_to_r0g.py

View check run for this annotation

Codecov / codecov/patch

lstchain/scripts/lstchain_r0_to_r0g.py#L208

Added line #L208 was not covered by tests
int(100*frac_untagged_ff_like))
log.warn('This may be due to anomalous events, like car flashes or LIDAR shots')
log.warn('More rarely, it could result from mis-tagging of FF events')
log.warn('A thorough inspection of the data check plots is recommended\n')

Check warning on line 212 in lstchain/scripts/lstchain_r0_to_r0g.py

View check run for this annotation

Codecov / codecov/patch

lstchain/scripts/lstchain_r0_to_r0g.py#L210-L212

Added lines #L210 - L212 were not covered by tests
moralejo marked this conversation as resolved.
Show resolved Hide resolved

log.info('R0 to R0G conversion finished successfully!')

def get_event_type(wf_hg, offset, evtype):

Expand Down
Loading