Skip to content

Add shift of the PSF - #122

Merged
aguinot merged 9 commits into
mainfrom
fix_psf_shift
Sep 25, 2026
Merged

aguinot merged 9 commits into
mainfrom
fix_psf_shift

Conversation

@aguinot

@aguinot aguinot commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

We found that the provided PSF is off-centered by half a pixel (-0.5, -0.5). This implement an external parameter to shift the PSF to the true center of the image. We could also hard code the shift. I don't know what is best here.

aguinot added 2 commits July 25, 2026 16:24
We found that the provided PSF is off-centered by half a pixel (-0.5, -0.5). This implement an external parameter to shift the PSF to the true center of the image.
We could also hard code the shift. I don't know what is best here.
@aguinot

aguinot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

After some discussion on Slack with @rmandelb, I changed the default to the expected shift of (-0.5, -0.5). If nothing is provided in the config, the PSF will be shifted correctly.

@aguinot

aguinot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

The unit tests are failing because the size is now too large. The thing is, it was a coincidence that the tests passed originally. If we oversample the images, with and without the shif I get the same measured size and it does not match the PSF bright.
The PSF profile is not the same which probably the reason why (see below). Ether we accept a larger variation in the PSF size or we found better parameters for the bright PSF. I think @FedericoBerlfein implemented the tests, do you have recommendations?

with_shift without_shift

- Due to the shift of the PSF the returned object from `getPSF` is now a galsim.Transformation we then need to call `.original` to compare to the input image.
- The second test on the bright PSF was passing by "luck". With the new shift in place it now fails. I relaxed the requirement on the size to be within 10% to pass. The objects on which the bright PSF is used are not objects used for science so this is fine.
@aguinot

aguinot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

New commit:

  • Due to the shift of the PSF the returned object from getPSF is now a galsim.Transformation we then need to call .original to compare to the input image.
  • The second test on the bright PSF was passing by "luck". With the new shift in place it now fails. I relaxed the requirement on the size to be within 10% to pass. The objects on which the bright PSF is used are not objects used for science so this is fine.

@rmandelb
rmandelb self-requested a review September 23, 2026 14:46

@rmandelb rmandelb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some very minor things - looks good

Comment thread euclidlike/euclidlike_psf.py Resolved
Comment thread euclidlike/euclidlike_psf.py Resolved
aguinot and others added 2 commits September 25, 2026 13:54
Co-authored-by: Rachel Mandelbaum <rmandelb@andrew.cmu.edu>

@rmandelb rmandelb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some trivial edits

Comment thread euclidlike/euclidlike_psf.py Resolved
Comment thread euclidlike/euclidlike_psf.py Resolved
Comment thread euclidlike/euclidlike_psf.py Resolved
Comment thread euclidlike/euclidlike_psf.py Resolved
aguinot and others added 4 commits September 25, 2026 16:42
Co-authored-by: Rachel Mandelbaum <rmandelb@andrew.cmu.edu>
Co-authored-by: Rachel Mandelbaum <rmandelb@andrew.cmu.edu>
Co-authored-by: Rachel Mandelbaum <rmandelb@andrew.cmu.edu>
Co-authored-by: Rachel Mandelbaum <rmandelb@andrew.cmu.edu>
@aguinot

aguinot commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator Author

@rmandelb I have applied all your suggested changes

@aguinot
aguinot merged commit 0b4348a into main Sep 25, 2026
2 checks passed
@aguinot
aguinot deleted the fix_psf_shift branch September 25, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants