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

Updating FOV filters to use #538

Open
mschwamb opened this issue Aug 22, 2023 · 1 comment
Open

Updating FOV filters to use #538

mschwamb opened this issue Aug 22, 2023 · 1 comment
Labels
enhancement New feature or request version 2.0 tasks we delegate for after first software release

Comments

@mschwamb
Copy link
Collaborator

From @mjuric

My high-level note (maybe for future upgrade): it looks like this implements point-in-polygon to test whether an object falls within the camera footprint? I'd advocate against implementing this manually -- use an existing (optimized) library. I did a bit of googling and Shapely seems promising (https://www.matecdev.com/posts/point-in-polygon.html, https://pypi.org/project/shapely/).

Alternatively, I have code from LSD that wraps a C implementation (it's fast): https://github.com/EUPSForge/polygon. Hasn't been updated since Python 2.7, but the math hasn't changed :). That said, think of this as a last resort; (much) better to use a strong 3rd-party library.

It would be good to explore these possibilities and see whether these are faster/better optimized than what we currently have implemented in the FOV filter and the FOV edge case filter

@mschwamb mschwamb added enhancement New feature or request version 2.0 tasks we delegate for after first software release labels Aug 22, 2023
@bernardinelli
Copy link
Collaborator

Matplotlib's patches.Patch can do this: https://matplotlib.org/stable/api/_as_gen/matplotlib.patches.Patch.html (contains_points), but my experience is that it's not particularly fast. Is this for the general camera footprint or for each CCD? (In the CCD case, if we can live with the assumption that it's a rectangle in a tangent plane, this can be done very efficiency with, eg, kD trees)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request version 2.0 tasks we delegate for after first software release
Projects
None yet
Development

No branches or pull requests

2 participants