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

calculate SI WFE header keyword over just the JWST aperture, not the full array #427

Merged
merged 1 commit into from
Apr 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions webbpsf/webbpsf_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,13 @@ def get_optical_system(self, fft_oversample=2, detector_oversample=None,
optsys.add_pupil(aberration_optic)

try:
inst_rms_wfe_nm = np.sqrt(np.mean(aberration_optic.opd[aberration_optic.amplitude == 1] ** 2)) * 1e9
# Calculate SI WFE over just the OTE entrance pupil aperture,
# though with a flip in the Y axis to account for entrance vs. exit pupil conventions
exit_pupil_mask = pupil_optic.amplitude[::-1] == 1
inst_rms_wfe_nm = np.sqrt(np.mean(aberration_optic.opd[exit_pupil_mask] ** 2)) * 1e9
self._extra_keywords['SI_WFE'] = (inst_rms_wfe_nm, '[nm] instrument pupil RMS wavefront error')
except TypeError:
except (TypeError, IndexError):
# Currently the above does not work for Roman, but fixing this is deferred to future work
pass

if hasattr(aberration_optic, 'header_keywords'):
Expand Down