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 uncertainty calculation in StereoMeanCombiner #2658

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LukasBeiske
Copy link
Contributor

@LukasBeiske LukasBeiske commented Nov 22, 2024

This fixes a problem with the uncertainties calculated by StereoMeanCombiner where the mapping of telescope events to array events did not work correctly. This resulted in many nan values in e.g. the RandomForestRegressor_energy_uncert column.

In doing so, I added a new module (ctapipe.vectorization) for the helper functions I implemented. This module also contains a faster (numba) alternative to np.unique, ctapipe.vectorization.get_subarray_index.

This is part of #2497, but I think this should be fixed regardless of the other content of that PR.

@@ -0,0 +1,145 @@
"""Helper functions for vectorizing numpy operations."""

import numpy as np
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need a full new submodule for this? This looks like it could be in ctapipe/reco/telescope_event_handling or similar

Copy link
Contributor Author

@LukasBeiske LukasBeiske Nov 22, 2024

Choose a reason for hiding this comment

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

I think I put it in ctapipe.utils initially, but that module is already pretty large.
But putting it in ctapipe.reco would be fine with me. Alternatively, what about ctapipe.reco.utils?

Copy link
Member

Choose a reason for hiding this comment

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

Sure, that also fits

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

Successfully merging this pull request may close these issues.

2 participants