Skip to content

Commit

Permalink
Merge 571ff6c into e268d3d
Browse files Browse the repository at this point in the history
  • Loading branch information
JarronL committed May 2, 2019
2 parents e268d3d + 571ff6c commit e92e17b
Show file tree
Hide file tree
Showing 5 changed files with 1,005 additions and 76 deletions.
675 changes: 675 additions & 0 deletions dev_utils/WFE_extrapolation.ipynb

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions dev_utils/wfe_benchmark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Note: meant to just copy/paste into ipython command line

# Import WebbPSF and setup multliprocessing
import webbpsf
webbpsf.webbpsf_core.poppy.conf.use_fftw = False
webbpsf.webbpsf_core.poppy.conf.use_multiprocessing = True
ncores = 8
webbpsf.webbpsf_core.poppy.conf.n_processes = ncores

inst = webbpsf.NIRCam()
inst.filter = "F430M"
inst.detector_position = (1024,1024)

# Baseline test: No SI WFE, no distortion
inst.include_si_wfe = False
%timeit psf = inst.calc_psf(add_distortion=False, monochromatic=4.3e-6)
# Result: 911 ms ± 5.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit psf = inst.calc_psf(add_distortion=False, nlambda=ncores)
# Result: 5.62 s ± 177 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

# Turn on SI WFE at center of detector (will use interpolation)
inst.include_si_wfe = True
%timeit psf = inst.calc_psf(add_distortion=False, monochromatic=4.3e-6)
# Result: 1.41 s ± 12.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit psf = inst.calc_psf(add_distortion=False, nlambda=ncores)
# Result: 6.1 s ± 96.9 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

# Use pixel (0,0) to force extrapolation algorithm
inst.detector_position = (0,0)
%timeit psf = inst.calc_psf(add_distortion=False, monochromatic=4.3e-6)
# Result: 1.8 s ± 12.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
%timeit psf = inst.calc_psf(add_distortion=False, nlambda=ncores)
# Result: 6.53 s ± 85.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
33 changes: 23 additions & 10 deletions docs/jwst.rst
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,6 @@ easily actually achieve that pointing with the flight hardware.
for that mask's field point. Note, this will also invoke the automatic pixelscale functionality
to get the right scale for SW or LW, too.

.. warning:: Coronagraph field point WFE not yet included

The coronagraph field points are far off axis, and this comes with significant WFE added compared to
the inner portion of the NIRCam field of view. This is not yet included in WebbPSF, but is work in
progress for the next version expected in 2019.


Weak Lenses for Wavefront Sensing
---------------------------------
Expand All @@ -223,14 +217,33 @@ SI WFE
SI internal WFE measurements are from ISIM CV3 testing (See JWST-RPT-032131 by David Aronstein et al.)
The SI internal WFE measurements are distinct for each of the modules and
channels. When enabled, these are added to the final pupil of the optical
train, i.e. after the coronagraphic image planes.

**Caution** WFE is not yet included for the coronagraph field points; it will use the closest imaging field point. See issue #180.
train, i.e. after the coronagraphic image planes. For field-points outside of
the measurement bounds, WebbPSF performs an extrapolation routine.

The coronagraph field points are far off axis, and this comes with significant WFE
added compared to the inner portion of the NIRCam field of view. While SI WFE for
imaging mode were measured directly from the instrument during ISIM CV3, the
coronagraphic WFE maps were built based on the NIRCam Zemax optical model.
This model was first validated in imaging mode, and then the appropriate optical
elements were inserted to produce the coronagraphic configuration.
In this case, both modules were assumed have the exact same (albeit, mirrored)
field-dependent WFE maps.

Wavelength-Dependent Focus Variations
---------------------------------------

**TODO** Add documentation here for the focus variations vs wavelength and how webbpsf models those.
NIRCam's wavelength-dependent defocus was measured during ISIM CV2 at a given field point
(See JWST-RPT-029985 by Randal Telfer). Overall, the measurements are consistent with
predictions from the nominal optical model. The departure of the data from the
model curve has been determined to be from residual power in individual filters.
In particular, the F323N filter has a significant extra defocus; WebbPSF includes
this measured defocus if the selected filter is F323N.

All SI WFE maps were derived from measurements with the F212N and F323N filters.
WebbPSF utilizes polynomial fits to the nominal focus model to derive focus offset values
relative to these narrowband filters for a given wavelength. The derived delta focus
is then translated to a Zernike focus image, which is subsequently applied to the
instrument OPD map.


NIRSpec
Expand Down

0 comments on commit e92e17b

Please sign in to comment.