Skip to content

Commit

Permalink
JP-3455: Fix bug in new MIRI imager photom correction (#8102)
Browse files Browse the repository at this point in the history
  • Loading branch information
hbushouse authored Dec 1, 2023
1 parent faee866 commit c5a0371
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------
Expand Down
8 changes: 8 additions & 0 deletions docs/jwst/photom/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions docs/jwst/references_general/photom_reffile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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`

+------------+-------+----------------+-----------+------------+------------------------+
Expand Down
6 changes: 3 additions & 3 deletions jwst/photom/photom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit c5a0371

Please sign in to comment.