From c5a0371ff54d2bdd33a371b28c6402264d7acf52 Mon Sep 17 00:00:00 2001 From: Howard Bushouse Date: Fri, 1 Dec 2023 11:48:27 -0500 Subject: [PATCH] JP-3455: Fix bug in new MIRI imager photom correction (#8102) --- CHANGES.rst | 3 ++- docs/jwst/photom/main.rst | 8 ++++++++ docs/jwst/references_general/photom_reffile.inc | 10 ++++++++++ jwst/photom/photom.py | 6 +++--- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 67ae78eacb..07e1df9b5c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -64,7 +64,8 @@ imprint photom -------- -- Added time-dependent correction for MIRI Imager data [#8096, spacetelescope/stdatamodels#235] +- Added time-dependent correction for MIRI Imager data. + [#8096, #8102, spacetelescope/stdatamodels#235] pixel_replace ------------- diff --git a/docs/jwst/photom/main.rst b/docs/jwst/photom/main.rst index f2ada56c40..e669014a1e 100644 --- a/docs/jwst/photom/main.rst +++ b/docs/jwst/photom/main.rst @@ -76,6 +76,14 @@ The step also computes the equivalent conversion factor to units of microJy/square-arcsecond (or microjanskys) and stores it in the header keyword PHOTUJA2. +MIRI Imaging +^^^^^^^^^^^^ +For MIRI imaging mode, the reference file can optionally contain a table of +coefficients that are used to apply time-dependent corrections to the scalar +conversion factor. If the time-dependent coefficients are present in the +reference file, the photom step will apply the correction based on the +observation date of the exposure being processed. + NIRSpec Fixed-Slit Primary Slit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The primary slit in a NIRSpec fixed-slit exposure receives special handling. diff --git a/docs/jwst/references_general/photom_reffile.inc b/docs/jwst/references_general/photom_reffile.inc index 7580533cf6..b98b9e5ff7 100644 --- a/docs/jwst/references_general/photom_reffile.inc +++ b/docs/jwst/references_general/photom_reffile.inc @@ -60,6 +60,16 @@ instrument modes, as shown in the tables below. | | | uncertainty | float | scalar | MJy/steradian/(DN/sec) | +------------+-------+----------------+-----------+------------+------------------------+ +The MIRI Imager PHOTOM reference file can contain an optional BINTABLE extension +named "TIMECOEFF", containing coefficients for an time-dependent correction. The format +of this additional table extension is as follows: + +========== ======== ===== =========== ========= +EXTNAME XTENSION NAXIS Dimensions Data type +========== ======== ===== =========== ========= +TIMECOEFF BINTABLE 2 TFIELDS = 3 float32 +========== ======== ===== =========== ========= + :Data model: `~jwst.datamodels.MirLrsPhotomModel` +------------+-------+----------------+-----------+------------+------------------------+ diff --git a/jwst/photom/photom.py b/jwst/photom/photom.py index d5d695cc7d..40f79361ca 100644 --- a/jwst/photom/photom.py +++ b/jwst/photom/photom.py @@ -463,15 +463,15 @@ def calc_miri(self, ftab): warnings.simplefilter("ignore") row = find_row(ftab.phot_table, fields_to_match) if row is None: - + # Search again using subarray="GENERIC" for old ref files fields_to_match = {'subarray': 'GENERIC', 'filter': self.filter} row = find_row(ftab.phot_table, fields_to_match) if row is None: return - self.photom_io(ftab.phot_table[row]) - # Check if reference file contains the coefficients for the time-dependent correction of the PHOTOM value + # Check to see if the reference file contains the coefficients for the + # time-dependent correction of the PHOTOM value try: ftab.getarray_noinit("timecoeff") log.info("Applying the time-dependent correction to the PHOTOM value.")