spacetelescope / jwst

Python library for science observations from the James Webb Space Telescope
https://jwst-pipeline.readthedocs.io/en/latest/
Other
558 stars 164 forks source link

Verify Nirspec instrument model implementation #8232

Open stscijgbot-jp opened 7 months ago

stscijgbot-jp commented 7 months ago

Issue JP-3249 was created on JIRA by Nadia Dencheva:

The pipeline implementation of the Nirspec instrument model was verified before launch by comparing results of the IDT pipeline with the STScI pipeline. The two implementations of the instrument model were evaluated at certain planes and it was confirmed that results agree to e-14. Attached are the IDT team files for FS, MOS, IFU with a grating and IFU with the prism, with results from the model before launch. They are attached to this ticket as an example. 

In order to confirm that the two models still agree to the same level of accuracy  we need to run the same test with the instrument model after commissioning.  The evaluation is done for points in the virtual slit with x,y coordinates


(0, -.5), (0, -.25), (0, 0), (0, .25), (0, .5)```
essentially using the center of the virtual slit in x and sampling in y. The wavelength range used was (2.87e-06, 5.27e-06) m. A sample of wavelengths was used: np.array([2.9, 3.39, 3.88, 4.37, 5]) * 10**-6 m.

The planes (or coordinate frames) at which the models are evaluated are listed in the files. They are:
 * x, y at the msa
 * the output of the collimator transform
 * after the DirectionalCosines are applied
 * at the entrance of the grating
 * at the exit of the grating
 * at the entrance of the camera
 * at the FPA
 * at the SCA
 * at the OTE plane
 * at V2, V3

For the IFU the additional points are
 * at the slicer
 * at the MSA exit
 * the IFU-POST transform

The comparison and results from the pre-launch test are in notebooks in <https://github.com/nden/nrs_testing/tree/master/test_model>

 
stscijgbot-jp commented 4 months ago

Comment by David Law on JIRA:

Nadia Dencheva Following up on this ticket; do you still think there are specific tests that need to be done here?  I'm not familiar with the history here, but my inclination would be to test that the STScI pipeline is giving the right result (to the extent that is possible) rather than testing that it matches the IDT pipeline going forward.

stscijgbot-jp commented 4 months ago

Comment by Peter Zeidler on JIRA:

David Law in my opinion we always should check the IDT/NIPS version against the STScI version since when we fit the model (and in case we every would need to adjust/refit the model) we are and will use the NIPS version and then transfer it to STScI. So all internal consistency checks of the model are done using NIPS not the STScI version.

As for the tests. Last year we discovered the coordinate roundtrip issue for the IFU in the STScI version. For this I basically conducted those tests to find which transform created the issue. I can look into it but given how much changed with the pipeline and without having seen the notebook from 6 years ago  it might be easier to work off what I did last year than trying to update the old notebooks.