Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PSFEx variable psf #1728

Open
navii98 opened this issue Apr 30, 2024 · 0 comments · May be fixed by #1913
Open

Support PSFEx variable psf #1728

navii98 opened this issue Apr 30, 2024 · 0 comments · May be fixed by #1913

Comments

@navii98
Copy link

navii98 commented Apr 30, 2024

Hi,

It would be nice if support for PSFEx psf file can be added in photutils (at least in limited capacity).

The structure of the variable psf file is a fits files containing two extensions and the structure is as follows -
The 2nd extension (hdul[1]) contains the relevant header and PSF data.

The header contains the following import parameters -

  1. PSFvariation_dependent variable (say x, and y)
  2. variation degree
  3. Oversampling factor (float)

The data is an array shaped (1, 1, n, psf_x, psf_y) where n is the coefficient for the polynomials.
e.g. for a 3rd order variation, n=10.
The coefficients, according to the variation degree are in the following order -
vardeg=0 -> [1]
vardeg=1 -> [1, x, y]
vardeg=2 -> [1, x, x2, y, y*x, y2]
vardeg=3 -> [1, x, x2, x3, y, yx, yx2, y2, y*x2, y3]
and so on.

The variation can depend on any image parameter (e.g. flux) or any other fits parameter (e.g. temperature, focus) but that might be difficult to implement. Therefore, I am suggesting a limited support that just covers x and y coordinates of the image.

I looked around the code, and It could just be a subclass of the FitttableImageModel. We would need to implement a new `evaluate' method.
For every x_0 and y_0 we can calculate a coefficient array -> multiply it with psf_array -> sum all arrays together to get the final PSF.
However, I am unsure how it will affect the other internal function of the class.

@navii98 navii98 linked a pull request Oct 5, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants