astropy / photutils

Astropy package for source detection and photometry. Maintainer: @larrybradley
https://photutils.readthedocs.io
BSD 3-Clause "New" or "Revised" License
248 stars 138 forks source link

Add option to set the method for aperture photometry measurements in the PSF photometry loop #497

Open eteq opened 7 years ago

eteq commented 7 years ago

Right now the PSF photometry machinery depends on doing CircularAperture photometry to make initial flux estimates. That makes sense for many use cases, but there are some situations where you don't want to do that. E.g., if your model is highly elliptical, or you know the image is very crowded, or you just don't like the default aperture sizes.

So I'd suggest taking the code that currently does it (For example https://github.com/astropy/photutils/blob/97e38c3e507871af5d18219012b345c15509b9ce/photutils/psf/photometry.py#L256 , although it also appears 2 other places), and replacing it with a new attribute aperture_photometry, a la the finder and group_maker attributes. The current situation could be left as the default (It could just be a function given that it's really quite simple), but then the user has the option to swap in there own way of doing it.

Does this make sense to you @mirca ? (I can try to implement it myself if you don't think you'll have time, but either way it'd be good to get your opinion...)

bsipocz commented 7 years ago

I really like this idea, and if @mirca thinks it makes sense, then I'll make sure it gets into 0.4 (either by bugging the two of you with it or try to implement it myself :))

mirca commented 7 years ago

@eteq @bsipocz It absolutely makes sense! Let the user customize it as much as possible :) I will prioritize #471, and then I can come to this :)