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 Ball LookupTableOPD, add support for general defocus, e.g. for MIMF #425

Merged
merged 5 commits into from
Mar 1, 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
15 changes: 14 additions & 1 deletion webbpsf/optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,10 @@ class LookupTableFieldDependentAberration(poppy.OpticalElement):
Remove piston, tip, tilt
rm_center_ptt : bool
If rm_ptt, use the center value for each detector rather than per field point
nwaves: float
Number of waves to defocus SM, if add_sm_defocus_pos or add_sm_defocus_neg is True.
add_sm_defocus: bool
If True, add "nwaves" of SM defocus, measured at a reference wavelength of 2.0 microns.


Usage:
Expand All @@ -1695,7 +1699,8 @@ class LookupTableFieldDependentAberration(poppy.OpticalElement):

def __init__(self, instrument, field_points_file=None, phasemap_file=None,
which_exercise='MIMF_KDP',
add_niriss_defocus=None, rm_ptt=None, rm_center_ptt=None, add_mimf_defocus=False, **kwargs):
add_niriss_defocus=None, rm_ptt=None, rm_center_ptt=None,
add_mimf_defocus=False, add_sm_defocus=False, nwaves=None, **kwargs):
super().__init__(
name="Aberrations",
**kwargs
Expand Down Expand Up @@ -1853,6 +1858,14 @@ def __init__(self, instrument, field_points_file=None, phasemap_file=None,
self.instrument.options['defocus_wavelength'] = 1e-6 # Add 0.8 microns PTV defocus
warnings.warn("Adding defocus=0.8 waves for NIRISS!")

if add_sm_defocus:
if nwaves:
print("ADDING DEFOCUS {:4.1f} WAVES at 2.0 microns".format(nwaves))
self.instrument.options['defocus_waves'] = nwaves
self.instrument.options['defocus_wavelength'] = 2.0e-6
else:
print("Not adding any defocus; set nwaves")


def header_keywords(self):
""" Return info we would like to save in FITS header of output PSFs
Expand Down