astropy / photutils

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

PSF photometry on crowded CCD frames #433

Closed Gabriel-p closed 7 years ago

Gabriel-p commented 8 years ago

Hi there. I occasionally need to perform PSF photometry on crowded fields, and I'm looking to get rid of IRAF as soon as possible. This package seems to be ideal replacement, but for what I can gather photutils it is still in a heavy development phase.

Below are the steps needed to complete a full PSF photometry process, and the packages in IRAF used in each step (as described in A User's Guide to Stellar CCD Photometry with IRAF). I was wondering if these features are in the roadmap to be implemented, or if they are not planned at all.

  1. Alignment of CCD images taken with different filters and exposure times (imalign)
  2. Combine images with equivalent exposures to reduce S/N ratio (imcombine)
  3. Standard stars aperture photometry (daophot --> daofind, phot)
  4. Standard stars catalog to convert instrumental magnitudes to standard (photcal --> mkcatalog, mknobsfile, mkconfig, fitparams)
  5. PSF photometry on all filters and exposures observed for the crowded field (daophot --> daofind, phot, psf, nstar, substar, allstar)
  6. Transformation of stars' magnitudes in crowded field to standard system (daophot --> mkobsfile, invertfit)
  7. Combine all exposures into a single observation for all stars in the field (no IRAF task as far as I am aware)

Sorry for the long post.

mirca commented 8 years ago

Hi @Gabriel-p!

2.: I think you may find equivalent python functionalities in astropy/ccdproc.

3.: Photutils has an aperture photometry module, you may check the docs here

Currently, I'm working on refactoring 5. in photutils. You may check here.

I'm not sure about 1., 4., 6., and 7..

I would say that you should open a PR if you have implemented/improved any of these functionalities you mentioned :)

No need to be sorry.

Gabriel-p commented 8 years ago

Thank you for your answer @mirca! One more question if you don't mind. Is photutils able to estimate the average FWHM of sources detected in an observed frame? In IRAF one can obtain it via the psfmeasure task for example.

mirca commented 8 years ago

@Gabriel-p I would say that photutils does not have a direct way to estimate the FWHM of PSFs. It would be a great addition to photutils to have a psfmeasure equivalent :D @bsipocz @eteq @hamogu @larrybradley (pinging the jedi masters)

larrybradley commented 8 years ago

Yes, this would be a nice feature to add to photutils. I'm pinging @SaraOgaz because I think she was working on a python version of psfmeasure.

SaOgaz commented 8 years ago

Hi @Gabriel-p , and all... we have just started an effort at STScI to get down to the nitty gritty of replacing IRAF tasks still used by the community. So first of all, this input is MUCH appreciated. We would like to either have a notebook with python examples for IRAF tasks if they already exist in the python libraries, or if they are still missing, write them. But we're still in the very early stages of this. Long term, we would like to write a psfmeasure replacement if we can't find an existing one.

I will definitely be adding the stellar photometry users guide to our list of examples. If we end up having the time and man-power, we'd like to replace a lot of these guides with the python equivalent walkthrough.

Sorry I don't have a quick solution for you, but just know that we're working on it!

Gabriel-p commented 8 years ago

Thank you all. I'll see if I can come up with some (dirty) script to serve as the base for a proper psfmeasure task.

I guess this issue can be closed now?

Cheers

eteq commented 7 years ago

@Gabriel-p - a bit more on these steps:

2: can be done with ccdproc or just directly on image arrays, or for dithered images, you might want to have a look at reproject (http://reproject.readthedocs.io/), which has various ways of putting them all on the same frame without combing.

One extra bit here, though: in fact in many cases you don't want to do this at all - the mode we're hoping to implement is instead providing the different exposures separately, but doing a simultaneous fit, rather than coadding and then fitting on the coadds. But with the above tools, essentially both are supported.

3: I think in @mirca's last implementation this is done simultaneously with 5, although you can do it separately if you want.

4, 6, 7: The intent is to provide utilities to do all this. The basic idea would be functions that take the tables that the PSF photometry classes from 5 output and add extra columns with instrumental mags, calibration mags, etc. This is an area where contributions would be especially useful because it's mostly just table operations. (Will try to make an issue for this).

I'll close this now because I think the questions are answered, but will try to make another issue to address the 4/6/7 question above.