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

HillasIntersection produces error on badly reconstructed events #2264

Closed
gschwefer opened this issue Feb 21, 2023 · 4 comments · Fixed by #2265
Closed

HillasIntersection produces error on badly reconstructed events #2264

gschwefer opened this issue Feb 21, 2023 · 4 comments · Fixed by #2265
Labels

Comments

@gschwefer
Copy link
Contributor

Describe the bug
When using the HillasIntersection algorithm, the direction reconstruction in the nominal frame can lead to reconstructed values of src_fov_lat with an absolute value greater than 90 degrees. This occurs when there are few telescope images (i.e. usually 2) in the reconstruction which have very close values of hillas_psi . The ellipses are then almost parallel and the major axes intersect at great distances from the camera center.

When this results in src_fov_lat with an absolute value greater than 90 degrees, SkyCoord here

nom = SkyCoord(
fov_lon=src_fov_lon * u.rad, fov_lat=src_fov_lat * u.rad, frame=nom_frame
)

throws a corresponding error. In ctapipe-process, the processing will be aborted.

Expected behavior
Since these events are so badly reconstructed that they will be thrown away for any analysis anyway, this case may as well result in an invalid reconstruction for the event. This would allow processing to continue. I'm open to better solutions, that just seems like the easiest.

Additional context

For the HillasReconstructor, this is only a problem if all reconstructed major axes are exactly aligned.

@gschwefer gschwefer added the bug label Feb 21, 2023
@gschwefer
Copy link
Contributor Author

If the fix suggested above is ok, I could open a pull request very quickly. Is this something that should also go in a unit test?

@maxnoe
Copy link
Member

maxnoe commented Feb 21, 2023

, this case may as well result in an invalid reconstruction for the event.

Yes, that's the right thing to do. Check the value of src_fov_lat and if it is larger than 90 degrees return the invalid result container.

The actual threshold could probably be even lower than the threshold that triggers the error in astropy and fov_lon and fov_lat aren't really different in this regard.

Maybe check for 45 degrees in both?

@gschwefer
Copy link
Contributor Author

Yes, sounds good

@kosack
Copy link
Contributor

kosack commented Feb 23, 2023

This looks related to #1200 as well

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

Successfully merging a pull request may close this issue.

3 participants