c3-time-domain / SeeChange

A time-domain data reduction pipeline (e.g., for handling images->lightcurves) for surveys like DECam and LS4
BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

Better circle edges in photometry #228

Open rknop opened 6 months ago

rknop commented 6 months ago

Right now (ass of PR 213), the aperture phtoometry class makes a circle by including all pxiels whose center is within the circle. We need to weight the pixels around the edge based on the intersection of the pixel square and the circle.

One possibility is the shapely library; I haven't used this before, so I don't know it's the right answer, but it looks promising:


>>> circle = shapely.Point( [ 10.2, 10.5 ] ).buffer( 3.2 )
>>> square = shapely.Polygon( [ (11.5, 7.5), (12.5, 7.5), (12.5, 8.5), (11.5, 8.5) ] )
>>> circle.intersection(square).area
0.6191305416936494
>>> square.area
1.0