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

For coronagraph Lyot masks, add reference information on alignment per each mask #675

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

mperrin
Copy link
Collaborator

@mperrin mperrin commented May 31, 2023

This PR implements a capability to have default mask alignment options (pupil_shift_x, pupil_shift_y, pupil_rotation) defined per each coronagraph mask. This is intended to allow WebbPSF to include measured in-flight information on the various masks.

Implementation details:

  • in constants.py add a dict which gives values of these options per each mask, or else None to leave undefined
  • in webbpsf_core.py, update code to look up and use those values.

WORK IN PROGRESS, NOT YET COMPLETE, NOT READY TO MERGE

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.42%. Comparing base (b536111) to head (72c9156).
Report is 25 commits behind head on develop.

❗ Current head 72c9156 differs from pull request most recent head 9274ce2. Consider uploading reports for the commit 9274ce2 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #675      +/-   ##
===========================================
+ Coverage    59.20%   59.42%   +0.21%     
===========================================
  Files           16       16              
  Lines         6955     6931      -24     
===========================================
+ Hits          4118     4119       +1     
+ Misses        2837     2812      -25     

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

@mperrin mperrin self-assigned this Jun 11, 2023
@mperrin mperrin added this to the Release 1.3 milestone Aug 1, 2023
@@ -243,3 +243,15 @@
JWST_INSCRIBED_DIAMETER = 5.47334 # meters. Middle corners of C segments

JWST_TYPICAL_LOS_JITTER_PER_AXIS = 0.0008 # milliarcseconds jitter, 1 sigma per axis. = approx 1 mas rms radial, typically

# Alignment information about instrument internal pupil masks (
INSTRUMENT_PUPIL_MASK_DEFAULT_POSITIONS = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIRCam will need multiple values that depend on channel (SW or LW pupil wheel) and mask (field position):

  • SWA_MASK210R
  • SWA_MASK335R
  • SWA_MASK430R
  • SWA_MASKSWB
  • SWA_MASKLWB
  • LWA_MASK210R
  • LWA_MASK335R
  • LWA_MASK430R
  • LWA_MASKSWB
  • LWA_MASKLWB

We could conceivably have similar values for Module B, but we currently have zero information on those masks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought that physically there is in the SWA wheel and LWA only one each of the bar and round Lyot stops? Such that, for instance, the 210R, 335R, 430R focal plane masks would all be used with the same physical Lyot mask? And likewise the SWA_MASKSWB and SWA_MASKLWB would similarly use the same physical Lyot pupil stop?

I had thought that therefore, the Lyot alignment offsets should be independent of focal plane position? What makes that not the case? Is this from field-position-dependent pupil wander within the instrument?

Copy link
Collaborator

@JarronL JarronL Nov 7, 2023

Choose a reason for hiding this comment

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

Yes, it appears that field-dependent pupil wander changes the best-fit pupil shift values for each of the occulting masks. We found this to be the case during commissioning when tuning the pupil wheel clocking to find a good balance between the M335R and M430R masks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK. This is going to be a minor pain for book-keeping, because it means the pupil alignment depends on the selected image mask (as well as the pupil mask)... but sometimes it's convenient to do coronagraphic calculations with the image mask left out to get an off-axis PSF (i.e. a sim with image_mask=None and pupil_mask=MASKLWB, or similar). For calculations like that, right now there would be no way for webbpsf to know which image mask to use for the pupil alignment parameter lookup.

This feels like a minor practical detail of API and implementation, but it'll need at least a little thought for how we want this to work.

Copy link
Collaborator

@JarronL JarronL Nov 8, 2023

Choose a reason for hiding this comment

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

The pupil shear has negligible impact on the shape of off-axis PSF. The main thing we care about is the morphology of the PSF under the influence of the occulting mask. For on-axis PSFs, the scattered light in the pupil matters (and therefore we care about alignment of the Lyot stop with the telescope pupil), whereas for off-axis PSFs, the pupil is filled. So in the end, we only care about the cases where image_mask is set.

'NIRCam_MASKSWB': {'pupil_shift_x': None, 'pupil_shift_y': None, 'pupil_rotation': None},
'NIRCam_MASKLWB': {'pupil_shift_x': None, 'pupil_shift_y': None, 'pupil_rotation': None},
'NIRCam_MASKRND_SW': {'pupil_shift_x': None, 'pupil_shift_y': None, 'pupil_rotation': None},
'NIRCam_MASKRND_LW': {'pupil_shift_x': -0.012, 'pupil_shift_y': -0.023, 'pupil_rotation': -0.60}, # from K. Lawson, fits to ERS progid 1386 data
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is presumably only for the M335R mask as M430R will have some pupil wander and therefore slightly different values.

@pep8speaks
Copy link

pep8speaks commented Apr 3, 2024

Hello @mperrin, Thank you for updating !

Line 413:126: E501 line too long (151 > 125 characters)
Line 419:2: W292 no newline at end of file

Line 306:126: E501 line too long (148 > 125 characters)
Line 760:1: E266 too many leading '#' for block comment
Line 983:126: E501 line too long (133 > 125 characters)
Line 995:126: E501 line too long (145 > 125 characters)
Line 1014:126: E501 line too long (134 > 125 characters)
Line 1427:126: E501 line too long (200 > 125 characters)
Line 1582:126: E501 line too long (131 > 125 characters)
Line 1817:13: E731 do not assign a lambda expression, use a def
Line 1819:13: E731 do not assign a lambda expression, use a def
Line 1838:9: E266 too many leading '#' for block comment
Line 1869:9: E266 too many leading '#' for block comment
Line 1870:9: E266 too many leading '#' for block comment
Line 1932:126: E501 line too long (127 > 125 characters)
Line 2084:126: E501 line too long (141 > 125 characters)
Line 2369:126: E501 line too long (130 > 125 characters)
Line 2413:126: E501 line too long (130 > 125 characters)
Line 2423:126: E501 line too long (141 > 125 characters)
Line 2447:126: E501 line too long (130 > 125 characters)

Comment last updated at 2024-05-12 04:10:07 UTC

@mperrin mperrin force-pushed the coron_pupil_mask_alignment_defaults branch from 72c9156 to 9274ce2 Compare May 12, 2024 04:10
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.

None yet

3 participants