spacetelescope / pysiaf

Handling of Science Instrument Aperture Files (SIAF) for space telescopes
https://pysiaf.readthedocs.io
BSD 3-Clause "New" or "Revised" License
13 stars 28 forks source link

Incorrect subarray corners for NIRISS SUBSTRIP256 and SUBSTRIP96 in SCI frame? #206

Closed hover2pi closed 2 years ago

hover2pi commented 2 years ago

Hi, I am using pysiaf to predict the contamination of traces in slitless spectroscopy but the NIRISS SOSS subarray corners are much larger than the actual subarray sizes.

When I do:

import pysiaf
siaf = pysiaf.Siaf('NIRISS') 
sub96 = siaf.apertures['NIS_SUBSTRIP96']
sub256 = siaf.apertures['NIS_SUBSTRIP256']
print(sub96.corners('sci'), sub256.corners('sci'))

I get ([0.5, 2098.5 2098.5, 0.5], [0.5, 0.5, 317.5, 317.5]) and ([0.5, 2098.5, 2098.5, 0.5], [0.5, 0.5, 477.5, 477.5]). Shouldn't the dimensions be 2048 x 96 and 2048 x 256 or am I misunderstanding something about what this method is returning?

Here are two plots that show the correct size traces in their correct positions on top of the FULL (grey shaded region) and subarray (blue shaded region) boxes given by pysiaf. Note the FULL frame box is the size I would expect at 2048x2048.

Any clarification would be greatly appreciated. Thanks!

NIS_SUBSTRIP96 NIS_SUBSTRIP356

mgennaro commented 2 years ago

If you look here: https://github.com/spacetelescope/pysiaf/blob/master/pysiaf/source_data/NIRISS/niriss_siaf_aperture_definition.txt#L35 you'll see that the Ysize of those apertures is actually the one that pysiaf is showing. I think these apertures might have a slightly different meaning than simply being the subarray footprint of the observations. Possibly they are APT/Aladdin visualization apertures, or are kept bigger for other reasons (e.g. the direct image falls within them? I am not a NIRISS expert). That does still make it possible for the underlying commanded subarray to be of 96/256 size. But I'd ask @goudfroo for definite words on this

goudfroo commented 2 years ago

The footprint of these two apertures in the SIAF indicates the part of the sky within which a (part of a) star's spectrum (with the GR700XD grism) will be projected onto the associated subarray. (The SIAF footprint of those apertures is larger in Science Y than the footprint of the associated subarray because of the order separation in Science Y.)

hover2pi commented 2 years ago

Awesome, thanks!