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

Add variable PSF option to romanisim and make it the default. #101

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

schlafly
Copy link
Collaborator

@schlafly schlafly commented Mar 4, 2024

Adds support for a linear PSF variation across each SCA.

Formerly we assumed that the PSF was constant in each SCA. This PR adds a new class that makes 4 PSFs at the 4 corners of each detector, and expresses the PSF at any point in the detector as a weighted linear sum of those 4 PSFs. It also adds support in add_objects_to_image to use this new kind of PSF object.

There was an issue with ChromaticSums and convolutions and photon shooting in galsim 2.5.0; this also bumps the galsim requirement to 2.5.1 (the latest version).

This feature was motivated by the fact that romancal uses a gridded PSF that includes variation over each SCA, and astrometric residuals between romanisim and romancal showed best performance in the center of the SCA where the romanisim PSF was instantiated. Using variable PSFs in both romancal and romanisim improves the astrometric agreement by a factor of three or so in F087.

@schlafly schlafly requested a review from a team as a code owner March 4, 2024 14:20
Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.47%. Comparing base (725b7cb) to head (b9fbedf).
Report is 52 commits behind head on main.

Files with missing lines Patch % Lines
romanisim/psf.py 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   92.44%   92.47%   +0.02%     
==========================================
  Files          16       16              
  Lines        1509     1554      +45     
==========================================
+ Hits         1395     1437      +42     
- Misses        114      117       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@schlafly
Copy link
Collaborator Author

schlafly commented Mar 4, 2024

@PaulHuwe , mind giving this a review if you're interested, or a LGTM? The chief thing is adding point spread variation following the approach of roman_imsim, linearly interpolating among the four corners of a chip. I also added a pin to pytest versions <= 8.0, since otherwise 8.1 was causing problems due to pytest plugins that do something with path that was deprecated, dunno.

Copy link
Collaborator

@PaulHuwe PaulHuwe left a comment

Choose a reason for hiding this comment

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

LGTM with a tiny comment


def __init__(self, corners, psf):
self.corners = corners
self.psf = psf
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe labels these psfs, to retain the clarity that this is a set of psfs (rather than a single psf)?

@schlafly schlafly merged commit 69843d3 into spacetelescope:main Mar 7, 2024
22 checks passed
@schlafly schlafly deleted the variable-psf branch March 7, 2024 14:28
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