Skip to content

Commit

Permalink
Merge pull request #1285 from cta-observatory/untagged_FF_like_warning
Browse files Browse the repository at this point in the history
Better warning message in R0 to R0G
  • Loading branch information
moralejo authored Sep 5, 2024
2 parents 378a4c3 + ed795b1 commit 4f7ed59
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lstchain/scripts/lstchain_r0_to_r0g.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ def main():
log.info('FF-like events tagged as FF: %d',
num_FF_like_with_FF_type)
else:
log.warn('FF-like events tagged as FF: %d !!',
num_FF_like_with_FF_type)
log.warning('FF-like events tagged as FF: %d !!',
num_FF_like_with_FF_type)

log.info('FF-like events not tagged as FF: %d',
num_FF_like_with_no_FF_type)
Expand All @@ -203,13 +203,15 @@ def main():
# 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.warning('%d percent of FlatField(FF)-like events are not tagged as FF',
int(100*frac_untagged_ff_like))
log.warning('This may be due to anomalous events, like car flashes or LIDAR shots')
log.warning('More rarely, it could result from mis-tagging of FF events')
log.warning('A thorough inspection of the data check plots is recommended\n')

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

def get_event_type(wf_hg, offset, evtype):

Expand Down

0 comments on commit 4f7ed59

Please sign in to comment.