spacetelescope / webbpsf

James Webb Space Telescope PSF simulation tool
https://webbpsf.readthedocs.io
BSD 3-Clause "New" or "Revised" License
119 stars 63 forks source link

NIRISS GR700XD model PSFs in webbpsf #682

Open obi-wan76 opened 1 year ago

obi-wan76 commented 1 year ago

This is a follow-up from an email about this issue. The model in webbpsf for the GR700XD grating still uses the original prototype Bach grating parameters, not the flight LLNL grating. https://github.com/spacetelescope/webbpsf/blob/develop/webbpsf/optics.py#L280

I'll contact people from the niriss team for assistant on this.

mperrin commented 11 months ago

Note that the optic class in webbpsf does have an option for the LLNL grating, with at least some of the parameters adjusted for that, at least partially, as of ~2014-2015 emails. That gives a starting place for continuing from.

Currently, trying to invoke it runs into a NotImplementedError:

> grating = webbpsf.optics.NIRISS_GR700XD_Grism(which='LLNL')

File ~/Dropbox (Personal)/Documents/software/webbpsf/webbpsf/optics.py:404, in NIRISS_GR700XD_Grism.__init__(self, name, which, **kwargs)
    398 def __init__(self, name='GR700XD', which='Bach',
    399              # cylinder_radius=22.85,  cylinder_sag_mm=4.0, rotation_angle=92.25, rotate_mask=False, transmission=None,
    400              **kwargs):
    401     # Initialize the base optical element with the pupil transmission and zero OPD
    403     if which == 'LLNL':
--> 404         raise NotImplementedError("Rotated field mask for LLNL grism not yet implemented!")
    405     elif which == 'Bach':
    406         transmission = os.path.join(utils.get_webbpsf_data_path(), "NIRISS/optics/MASKGR700XD.fits.gz")

NotImplementedError: Rotated field mask for LLNL grism not yet implemented!

That slightly confuses me though, in two ways. First, maybe that error text is just mislabeled because it needs a pupil mask, not a field mask. Secondly, even though there's a path defined for a mask file for the Bach grating, it doesn't actually use that file at all; instead there's a transmission mask defined analytically in the get_transmission function.

In any case the place to start will be tracking down the relevant as-built information for the optic design of the prism itself and also the pupil stop geometry around it.