photutils icon indicating copy to clipboard operation
photutils copied to clipboard

Add polygon aperture

Open larrybradley opened this issue 9 years ago • 4 comments

This is a reminder to implement a polygon aperture based on a polygon region from the regions package. This will occur when regions is ready and we base all photutils apertures on regions.

larrybradley avatar Nov 23 '16 14:11 larrybradley

Any updates on this feature? Arbitrary polygon apertures would be very useful.

cooker33 avatar Oct 05 '18 01:10 cooker33

@cooker33 We first need a polygon region to be implemented in the regions package (https://github.com/astropy/regions) before we can add a polygon aperture in photutils.

larrybradley avatar Oct 05 '18 17:10 larrybradley

@larrybradley That's fair enough. Any advice or tips for performing photometry on fits images inside an HST-WFC3 footprint defined by a ds9 polygon?

cooker33 avatar Oct 05 '18 18:10 cooker33

@cooker33 You can use the pyregion (https://pyregion.readthedocs.io/en/latest/) package to load in a DS9 region file and use its get_mask function (https://pyregion.readthedocs.io/en/latest/api/pyregion.get_mask.html#pyregion.get_mask) to convert it to a boolean mask. You could then put that boolean mask into a photutils ApertureMask object (https://photutils.readthedocs.io/en/stable/api/photutils.aperture.ApertureMask.html) and use its multiply method to do the photometry (i.e. sum the result of multiply).

larrybradley avatar Oct 10 '18 16:10 larrybradley