eslavich / jirahub-sandbox

0 stars 0 forks source link

NIRSpec and MIRI IFU master background subtraction: dedicated backgrounds #14

Open eslavichjgbot opened 4 years ago

eslavichjgbot commented 4 years ago

Issue JP-510 was created on JIRA by Howard Bushouse:

Spectroscopic master background subtraction for the NIRSpec IFU and MIRI MRS modes uses one or more dedicated (off-target) background exposures to form the master background, which is then subtracted from the 2-D source exposures.

The dedicated background exposures need to be processed all the way through the calwebb_spec2 pipeline, to form individual 1-D extracted spectral (x1d) products from the IFU cubes (s3d products) that are built for each background exposure. The 1-D spectra get averaged together to form the master 1-D background spectrum, which is then re-projected into the 2-D space of each source exposure and subtracted from it.

The dedicated background exposures are identified via their exptype values of "background" in the input ASN file.

eslavichjgbot commented 4 years ago

Comment by Howard Bushouse on JIRA:

For NIRSpec IFU observations that use dedicated background exposures, there's always the option of doing the background subtraction via the existing calwebb_spec2 background step, which subtracts the 2-D background exposures directly from the 2-D source exposures. However, in cases where the NIRSpec GWA (grating wheel assembly) has moved between the source and background exposures (even if commanded back to the same position), GWA non-repeatability may cause a wavelength shift between the two sets of exposures, in which case direct image-from-image subtraction cannot be done and the master background subtraction approach outlined here must be used. Hence a check needs to be added to either calwebb_spec2 or the background step to see if the GWA positions in the background and source exposures match one another and if they don't, the existing background step should be skipped.

This should not be a problem with MIRI MRS exposures, but the option to do master background subtraction instead of the simple image-from-image subtraction should be available.

eslavichjgbot commented 4 years ago

Comment by Howard Bushouse on JIRA:

The attached document outlines the method of master background subtraction requested by the MIRI team for the MIRI MRS mode. It defines 2 methods:

1) pixel-based - a master background image is constructed by combining the 2-D data for multiple exposures, either from dedicated background exposures or large dithers on the source that leave a sufficient number of background pixels in each image and that 2-D master background is then subtracted from each 2-D "source" exposure. This is equivalent to the existing calspec2 background subtraction step.

2) model-based - master background 3-D cube is created from multiple exposures and a polynomial fit is performed to the cube, resulting in background signal as a function of cube spatial and wavelength coords. The fit is then evaluated in the space of source exposures and subtracted from them.

There is agreement from Karl Gordon (JWST Cal WG lead) that method 2 will NOT be part of the baseline pipeline implementation and hence not developed for B7.3. The baseline will include the existing background subtraction step in calspec2 and the 1-D master background technique being implemented for the NIRSpec IFU mode (which can be applied to MIRI MRS).

eslavichjgbot commented 4 years ago

Comment by Howard Bushouse on JIRA:

JP-514 has been created for the implementation of the MIRI MRS model-based method in a subsequent build.

eslavichjgbot commented 4 years ago

Comment by Howard Bushouse on JIRA:

In the automated pipeline (run within the DMS environment) dedicated backgrounds should always be applied using the existing calwebb_spec2 background step, which combines the multiple background exposures into a 2-D image and subtracts it from each of the target exposures. Consequently, the calspec3 master background step should be set to be skipped by default, except when it's necessary due to NIRSpec GWA movement between the target and background exposures.