spacetelescope / jwst

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

asn_generator rules for WFSS source catalog name #1893

Closed hbushouse closed 6 years ago

hbushouse commented 6 years ago

Issue

DMS has processed a test APT proposal that contains a NIRISS WFSS observation, made up of both direct image and grism exposures. Results of the processing can be seen on the C-string ("owlc-2" server) at:

/ifs/int/jwstc/store/rspencer/tests/spectralDithers/cstring/JWSTDP-2018_1-180405/2018-04-12-162801/sdp/archive/

In the "asnTable" subdirectory are 3 ASN files, 1 for level-2b processing of the direct images, 1 for level-3 processing of the direct images, and 1 for level-2b processing of the grism exposures. The level-3 processing of the direct images (in subdirectory "level3") shows that the 2 expected source-based products:

jw87800-o017_t002_niriss_f200w_i2d.fits jw87800-o017_t002_niriss_f200w_cat.ecsv

However, the level-2b grism ASN file ("jw87800-o017_20180412t163456_spec2_003_asn.json") was constructed with an expected source catalog file name based on the grism exposure properties:

            "members": [
                {
                    "exptype": "catalog",
                    "expname": "jw87800-o017_t002_niriss_**gr150r**.ecsv"
                },
                {
                    "exptype": "science",
                    "expname": "jw87800017001_02102_00008_nis_rate.fits",
                    "exposerr": "null"
                }
            ],
            "name": "jw87800017001_02102_00008_nis"

Note that the catalog file name has the name of the grism used for the grism exposures, while of course the actual catalog produced has the name of the filter used in the direct images ("jw87800-o017_t002_niriss_f200w_cat.ecsv"). The level-2b processing of the grism exposures never got initiated, presumably because the catalog file it was expecting never showed up.

So we apparently need an update to the asn rules governing the construction of WFSS level-2b ASN's.

Resources

Implementation

Design issue: Presumption that NIRCam and NIRISS WFSS would behave the same is wrong. Will need to develop two different sets of Level2 and Level3 WFSS rules for the different instruments. Note #655 will handle the NIRCam WFSS mode.

stscieisenhamer commented 6 years ago

Question

So, the grism specification seems to be appearing in different keywords. As far as I can divine, the mapping is as follows:

Note that in the keyword dictionary, for NIRISS, the two grisms are not listed as possible values for filter. Is this an oversight?

hbushouse commented 6 years ago

Yes, the lack of the grism names in the FILTER enum list in the Keyword Dictionary is a known deficiency and is in the process of being corrected (as part of a larger effort to update the enum lists for all keywords like FILTER, PUPIL, SUBARRAY with the real truth list of allowed values).

stscieisenhamer commented 6 years ago

Question

According to APT, for NIRISS, the direct image optical path is fixed: The filter wheel is set to clear and the pupil wheel is fixed to whatever position is being used for the grism exposures.

However, for NIRCam, at least with APT 26.0.1, this is not the case. The direct image exposures can be assigned any filter position; it does not have to be the same as the grism exposures.

Question is: Is this "truly" the case for NIRCam? Or is this a bug in APT? @sosey thoughts?

sosey commented 6 years ago

As far as I know, for both NIRCAM and NIRSS, the direct image can be planned with any filter, and in fact the catalog for the WFSS may be pulled from resampled images from multiple filters coadded in some fashion.

Here's some backup info:

WFSS observations are obtained by using one or both of the grisms in combination with a wide- or medium-band blocking filter located in the pupil wheel (PW). The blocking filters limit the wavelength coverage and therefore the extent of spectra on the detector, which reduces the blending of spectral traces from objects distributed throughout the FOV.

https://jwst-docs.stsci.edu/display/JTI/NIRISS+Wide+Field+Slitless+Spectroscopy

An observation in the WFSS mode proceeds as follows:

  • A blocking filter is selected in the PW; the FW is set to "CLEAR."
  • single (i.e., non-dithered) image of the scene is taken, called the the "pre-image."
  • One of the GR150 grisms is selected, either GR150C or GR150R.
  • Dithered grism images are taken.
  • The CLEAR element is selected again and a single image of the scene is taken, called the "post image."
  • Optional: select a different blocking filter and repeat steps 1–5 with the same grism.
  • Optional: select the other GR150 grism and repeat steps 1–6.

https://jwst-docs.stsci.edu/display/JTI/NIRCAM+Wide+Field+Slitless+Spectroscopy

Direct LW images are required for at least the last grism-filter combination requested in the observation. imultaneous direct imaging with the SW channel is obtained simultaneously with the LW grism exposures. The SW imaging field of view remains unchanged when the grisms are in use. The SW images enable precise determination of dither offsets, and provide extended wavelength coverage as well as supporting production of the source catalog needed for calibration of the LW grism spectra.

sosey commented 6 years ago

@npirzkal @gbrammer may have insights as well

hbushouse commented 6 years ago

The question is does "the last grism-filter combination" implicitly imply that the direct image(s) will be taken using the same filter as the grism-filter combination? The current APT does not seem to enforce that for NIRCam. It seems to allow you to select any filter for use with the direct image(s).

sosey commented 6 years ago

Right, as far as I understand, the direct image can be through any filter, not necessarily the grism-filter combo

stscieisenhamer commented 6 years ago

Understood: Direct images' filter is not constrained by the grism filter (except for APT restriction on NIS).

Now, to the bigger question...

stscieisenhamer commented 6 years ago

Question

For spec3 wfss work, both grism orientations and related direct images are provided. Currently, the grism exposures are limited to those exposure sharing the same filter; there will be a different grism product for each blocking filter.

Question is: Should the filter be a constraint? Or, should spec3 be given all grism exposures, regardless of filter? Put another way: Should a grism combined product be on a per-filter basis or not?

Note that this question extends to all level 3 spectral products: Should any Level3 spectral product be produced on a per-filter basis, or should that be filter-combined?

hbushouse commented 6 years ago

Need WFSS experts input for grism modes, but for NIRSpec IFU, for example, I believe they DO want data spanning multiple filters in grating-filter combinations combined at level 3. For example, IFU exposures for G140M+F100LP and G140M+F170LP. Not sure if they would also want such combinations combined for other NIRSpec modes, like MOS and FS.

None of the other spectroscopic modes offer multiple filter settings (e.g. MIRI MRS, MIRI LRS, NIRISS SOSS).

sosey commented 6 years ago

related: https://github.com/STScI-JWST/jwst/issues/1488

npirzkal commented 6 years ago

I was indeed told that for NIRCAM, we will not force people to take imaging in the same filter that is used with the grism exposure. There is a small chance that will change in the future but that is the case right now and APT allows it on purpose.

stscieisenhamer commented 6 years ago

Turns out another angle on the above conversation has taken place in #655. This issue now comes full circle and will finish dealing with the original issue statement plus related refactoring and solidification of how NIRISS WFSS has been implemented in APT version 26.0.1

Another issue will be opened for the IFU/MOS/FS to confirm multiple filter combination or not.