HiPERCAM / hipercam

Python package for handling HiPERCAM data
3 stars 4 forks source link

PSF photometry just uses circular PSFs #106

Open StuartLittlefair opened 1 year ago

StuartLittlefair commented 1 year ago

As pointed out by @coclar in #80, the PSF photometry option simply fits circularly symmetric PSFs to the stars in the images.

The parameters for these PSFs are simply copied across from those found in moveApers without an extra fitting step. This causes bad results in the case of elliptical PSFs.

In #105 , I introduced new code that uses PSF functions that are - in theory - capable of having different widths in the x and y directions. To implement elliptical PSFs the following steps need doing:

Note the second part cannot be done by simply setting the parameters on the PSF model to variable instead of fixed. This is because if you do that, the photutils PSF fitting code will fit each star independently and obviously the shape parameters cannot be constrained by faint stars.

Instead we will need a separate step using the reference stars to set the PSF model parameters before the PSF photometry step.

StuartLittlefair commented 4 months ago

Some progress on this, based on some experiments I have done with PSF photometry on HiPERCAM data which was marginally successful (see attached script).

The issue with the PSF models as described above is still current and not solved, and if we want to use asymmetric Moffat or Gaussian profiles we still need an additional fitting step. However, there is an alternative that might work, making an effective PSF (EPSF) from the data itself.

Based on this I one way to make PSF photometry useful within the pipeline is this:

1) Make a shiftadd script, which is a version of combine that aligns images based on star positions (I have a rough draft already). shiftadd would be used to make a "master" frame (combine would do for this in the short term).

2) Select bright, isolated reference stars in each image to make a an Effective PSF. This is probably best done selecting those stars with setaper and then running a new command make_epsf that will allow users to tweak the parameters of EPSF creation and view the result. The epsf star list and successful settings are saved to a file.

3) Next another new script make_source_list is run, using the EPSF settings and the master frame. This is based on the attached script and uses Iterative PSF Photometry to create a master source list, including detecting blended stars.

4) Finally, using the EPSF info and the master source list of stars from (3), we can run the reduce where for each frame a new EPSF is created using the EPSF star list, and forced photometry is carried out using the master source list (with a position tweak calculated from the EPSF stars).