Support MIRI LRS slit in aperturename and setup_sim_to_match_file functions #781
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I encountered a bug when trying to use
setup_sim_to_match_file
with a MIRI LRS observation, using SIAF aperture name 'MIRIM_SLIT'. This is a SLIT-type SIAF aperture, which defines V2,V3 coordinates but does not specify a particular set of detector coordinates or subarray (it's read out using the MIRIM full array). You can also reproduce this bug simply with:The necessary code for handling this kind of aperture was previously only present in the NIRSpec class, which has several slit apertures. I'd missed that MIRI SIAF also uses this for the LRS.
This PR refactors the code from the
NIRSpec
classaperturename
and_tel_coords
functions, moving it up to theJWInstrument
class and generalizing it to work on any slit aperture for any instrument.Overall this PR actually makes the code shorter and simpler (more deleted lines than added lines!), which is pretty satisfying.