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

CameraCalibrator warns in case no R1 data is present #2407

Closed
maxnoe opened this issue Oct 4, 2023 · 2 comments · Fixed by #2421
Closed

CameraCalibrator warns in case no R1 data is present #2407

maxnoe opened this issue Oct 4, 2023 · 2 comments · Fixed by #2421

Comments

@maxnoe
Copy link
Member

maxnoe commented Oct 4, 2023

Describe the bug

When running ctapipe-process on DL0 input, the CameraCalibrator throws a warning (python warning, not log message):

ctapipe/camera/calibrator.py:159: UserWarning: Encountered an event with no R1 data. DL0 is unchanged in this circumstance.

However, this is the expected case for almost anything (after all, ctapipe really starts at DL0), there shouldn't be a warning for the expected case.

@LukasNickel
Copy link
Member

There are actually booleans defining whether or not the warnings for missing R1/DL0 should be emitted.
And for some reason they are set to True if the Calibrator encountered an event without R1/DL0:

def _check_r1_empty(self, waveforms):
if waveforms is None:
if not self._r1_empty_warn:
warnings.warn(
"Encountered an event with no R1 data. "
"DL0 is unchanged in this circumstance."
)
self._r1_empty_warn = True
return True
else:

Why would that make any sense? You don't warn when finding an event, but then make sure to emit the warning for the following events?

@maxnoe
Copy link
Member Author

maxnoe commented Oct 25, 2023

Why would that make any sense? You don't warn when finding an event, but then make sure to emit the warning for the following events?

It's the other way around. The name is misleading. It's only raising the warning for the first event and then not again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants