astronomy-commons / lsdb

Large Survey DataBase
https://lsdb.io
BSD 3-Clause "New" or "Revised" License
12 stars 3 forks source link

Support Convex polygons for polygon search #115

Open smcguire-cmu opened 6 months ago

smcguire-cmu commented 6 months ago

Currently, convex polygons will fail when performing a polygon search. This is currently due to healpy and lsst-sphgeom not supporting convex polygons. One approach could be to split a convex polygon into concave polygons, for example something like this. Or to look for other/contribute to dependencies.

nevencaplar commented 6 months ago

I am a bit concerned by a number of comments and discussions within LSST land about this topic; and yet lsst-sphgeom still only support convex polygons, seemingly due to hidden complexity of different shapes. In case that we decided to tackle this, is does seem that the right way to go is via decomposition to convex shapes.

hombit commented 6 months ago

Initially, I was skeptical about concave polygons. However, after Neven's comment, I decided to investigate further. Here's what I found in the LSST Slack:

  1. Rectangular pixel regions in the outer parts of the LSST camera focal plane appear concave when projected onto the sky. I believe this is the most important use case, but we need more discussion about polygons originating from the WSC.
  2. Sometimes, people require unusual configurations, such as regions with holes or a single region to mask multiple spikes of a bright star.
  3. There are more extreme versions of masking - for example, using a single polygon to select LSST's 'Milky Way cadence' region, or to select areas of low extinction. I'm not entirely convinced that polygon search is the right tool for these cases, but we can see that some people are using it in this way.

I still think that concave polygons should not be our first priority. We can ask users to represent their data as a set of convex polygons themselves.