-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Initial support for PSFEx PSF #1913
base: main
Are you sure you want to change the base?
Conversation
Hello @navii98! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-10-06 15:09:27 UTC |
@navii98 Thanks for the pull request. I've never used PSFEx.
It depends on the size of the images, but generally it's more expensive to create the interpolator than to evaluate it. I recently changed the implementation of
For image-based models, how would you create a non-integer oversampled image? Typically, an oversampled PSF model is evaluated by sampling every (integer)
I think you misunderstood. The docs state:
The sum of the values in the PSF model can be less than 1, but that PSF should represent a total flux of 1 when a source is fit. In the PSF photometry tools, the
Yes, the origin corresponds to the coordinates within the image which will be placed at the model If you are having trouble with the linter and style checks, I recommend that you install Since this PR is still in progress, I'm going to convert it to draft status. |
I had written the basic information about output PSF from PSFEx in the related issue.
Oh, that's interesting. I just assumed it would be the other way around. But I'll try to edit the code so that the arithmetic is done on interpolated instances and see if there are any performance enhancements.
PSFEx, with it's default configuration samples the PSF at intervals of FWHM/4.
Thanks for the clarification. I understand the rationale behind having the PSF normalized to a flux of 1.0
Okay. I asked in the case we have a PSF with even number of pixels. But 1/2 a pixel shift out of 25 shouldn't cause that much of an issue. Since this PR is still in progress, I'm going to convert it to draft status. |
Closes #1728
I've tried to implement support for the most straightforward case of variable psf model from PSFEx.
PSFEx can model variation for any image/header parameter, but I've only implemented variation in
x
andy
(X_IMAGE
andY_IMAGE
from SExtractor).This pull request is not complete, but I just wanted to get feedback on the early stages. I've based it on current master after the
ImagePSF
andGriddedPSFModel
classes.The core functionality is in the for functions
_calc_poly_coeffs
,_calc_image_weights
,_calc_model_values
, andevaluate
. I've tried to create a PSF model using this and perform photometry on an image for which the PSF was modeled by PSFEx, and it worked, to my surprise.Although it should be able to handle the case of a constant psf (variation deg=0), I believe that would be better handled by the ImagePSF class. This can be done in the reader.
Some things still left to do -
_validate_data
function_validate_data
function_cls_info
with more useful information.psf
(fits) file, and output the psf_modelI had some questions regarding the implementation of PSFmodel classes in general -
_calc_model_values
,-polynomial coefficient from x and y are calculated
-multiplied with a stack of images (see Support PSFEx variable psf #1728 for details)
-these images are then summed
-An interpolator is defined using the summed images, and (xi, yi) are passed to the interpolator
In your experience, would it be more efficient to create an interpolator for every image, interpolate first on (xi, yi) using every interpolator (6 interpolators for vardeg=2; 1, x, x^2, y, xy, y^2), and then sum?
So the question is if creating an interpolator instance is more expensive or if the interpolation itself is more expensive.
oversampling
to an integer?x_fit
andy_fit
parameters?