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

Implement distortion for Roman #668

Merged
merged 14 commits into from
Aug 9, 2023

Conversation

Skyhawk172
Copy link
Collaborator

Implement geometric distortion for Roman using the Roman SIAF. It appears we can use the same infrastructure already set up for JWST can be used for Roman as well.

@Skyhawk172 Skyhawk172 marked this pull request as draft May 11, 2023 19:51
@Skyhawk172 Skyhawk172 added enhancement New feature or request Roman Affects Roman Space Telescope models in WebbPSF labels May 11, 2023
@Skyhawk172 Skyhawk172 self-assigned this May 11, 2023
@Skyhawk172
Copy link
Collaborator Author

Current implementation will require installing Python package soc_roman_tools, which is where the Roman SIAF is stored.

Also will need to remove the hardcoded path to local WFI Zernike file.

@Skyhawk172 Skyhawk172 marked this pull request as ready for review June 28, 2023 18:48
@Skyhawk172
Copy link
Collaborator Author

I've done a bunch of tests and I think this PR is good to go. Feedback appreciated.

One thing I am still unsure of is whether the rotation needs to be applied.

Here are some plots to compare the effect(s) of including distortion on the Roman PSF:

image

image

image

@Skyhawk172
Copy link
Collaborator Author

I also think there is no need to apply a rotation, like what is done for JWST NIRCam, NIRISS, or FGS. (Re-)Reading an email thread with a GSFC optical engineer from 2020, it's mentioned that "Pupil FITS is FPA coordinate and no need of rotation/flip", which suggests the pupil FITS files are already aligned with the detector frame.

Moreover, it also appears the Zernikes as defined in the reference data (see "Zernike NOLL def" tab in the spreadsheet) are properly aligned with the exit (i.e. flipped) pupil, so I don't think we need to do any additional flip/rotation. Confirmation of this would be appreciated.

@Skyhawk172 Skyhawk172 changed the title WIP: Implement distortion for Roman Implement distortion for Roman Jul 21, 2023
@Skyhawk172 Skyhawk172 requested a review from obi-wan76 July 21, 2023 17:43
Copy link
Collaborator

@obi-wan76 obi-wan76 left a comment

Choose a reason for hiding this comment

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

Would you need to add soc_roman_tools as a dependency?

@Skyhawk172
Copy link
Collaborator Author

Yes, I think we'll have to add it to the dependencies.

@obi-wan76
Copy link
Collaborator

@BradleySappington is this as simple as adding this into the toml file? (soc_roman_tools dependency)

@BradleySappington
Copy link
Collaborator

BradleySappington commented Jul 26, 2023

@BradleySappington is this as simple as adding this into the toml file? (soc_roman_tools dependency)

Yes, add it with any preferred versioning to the dependencies section of pyproject.toml

@Skyhawk172
Copy link
Collaborator Author

Skyhawk172 commented Jul 26, 2023

Okay, I can add it to the PR: "soc_roman_tools>=0.1.0",, where v0.1.0 is the current version on pypi.

Copy link
Collaborator

@obi-wan76 obi-wan76 left a comment

Choose a reason for hiding this comment

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

This looks good.

@Skyhawk172
Copy link
Collaborator Author

Other than the approximate V2/V3 location of the Roman Coronagraph, there is not much information available in the SIAF (that information simply does not exist yet), so I had to enforce no distortion for the Roman CGI.

@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Patch coverage: 86.66% and project coverage change: +0.16% 🎉

Comparison is base (34ba8fc) 54.75% compared to head (1dac1fc) 54.91%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #668      +/-   ##
===========================================
+ Coverage    54.75%   54.91%   +0.16%     
===========================================
  Files           16       16              
  Lines         6436     6466      +30     
===========================================
+ Hits          3524     3551      +27     
- Misses        2912     2915       +3     
Files Changed Coverage Δ
webbpsf/gridded_library.py 76.92% <ø> (-0.19%) ⬇️
webbpsf/webbpsf_core.py 73.91% <ø> (-0.07%) ⬇️
webbpsf/distortion.py 74.40% <70.00%> (-0.83%) ⬇️
webbpsf/roman.py 91.19% <100.00%> (+0.59%) ⬆️

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

@Skyhawk172 Skyhawk172 added this to the Release 1.2 milestone Aug 8, 2023
@Skyhawk172
Copy link
Collaborator Author

@obi-wan76 @BradleySappington I think this is one is good to go. If you agree, we can fold it in the next release.

@obi-wan76 obi-wan76 merged commit 11cd172 into spacetelescope:develop Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Roman Affects Roman Space Telescope models in WebbPSF
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants