From 9566d2ecb0c50d86907a7a069bba9162f44ba34b Mon Sep 17 00:00:00 2001 From: Robert Jedrzejewski Date: Wed, 7 Apr 2021 10:34:28 -0400 Subject: [PATCH 1/3] Fix bug introduced when adding 4-amp subarray processing in refpix step --- docs/jwst/refpix/description.rst | 4 ++-- jwst/refpix/reference_pixels.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/jwst/refpix/description.rst b/docs/jwst/refpix/description.rst index 00dd4e5a77..5585f33ad6 100644 --- a/docs/jwst/refpix/description.rst +++ b/docs/jwst/refpix/description.rst @@ -108,7 +108,7 @@ NIR Data ++++++++ For single amplifier readout (NOUTPUTS keyword = 1): ----------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If the odd_even_columns flag is set to True, then the clipped means of all reference pixels in odd-numbered columns and those in even numbered columns @@ -127,7 +127,7 @@ If the science dataset has at least 1 group with no valid reference pixels, the step is skipped and the S_REFPIX header keyword is set to 'SKIPPED'. For 4 amplifier readout (NOUTPUTS keyword = 4): ------------------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If the NOUTPUTS keyword is 4 for a subarray exposure, then the data are calibrated the same as for full-frame exposures. The top/bottom reference values are obtained from available diff --git a/jwst/refpix/reference_pixels.py b/jwst/refpix/reference_pixels.py index c55a02f48e..7c9efd9170 100644 --- a/jwst/refpix/reference_pixels.py +++ b/jwst/refpix/reference_pixels.py @@ -909,12 +909,13 @@ def do_subarray_corrections(self): # First transform to detector coordinates # refdq = dqflags.pixel['REFERENCE_PIXEL'] + donotuse = dqflags.pixel['DO_NOT_USE'] # # This transforms the pixeldq array from DMS to detector coordinates, # only needs to be done once self.DMS_to_detector_dq() # Determined refpix indices to use on each group - refpixindices = np.where(np.bitwise_and(self.pixeldq, refdq) == refdq) + refpixindices = np.where((self.pixeldq & refdq == refdq) & (self.pixeldq & donotuse != donotuse)) nrefpixels = len(refpixindices[0]) if nrefpixels == 0: self.bad_reference_pixels = True From 2d2c862b515877d8e7324a533f6eb6d899c327ee Mon Sep 17 00:00:00 2001 From: Robert Jedrzejewski Date: Wed, 7 Apr 2021 12:19:55 -0400 Subject: [PATCH 2/3] Add changelog entry --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index c84e810ce3..c17a20d49b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -106,6 +106,8 @@ refpix - Added code to handle NIR subarrays that use 4 readout amplifiers. Uses and applies reference pixel signal from available amplifiers and side reference pixel regions, including odd-even column separation if requested [#5926] +- Fixed a bug introduced in #5026 that affected refpix calibration of 1-amp NIR subarrays [#5937] + source_catalog -------------- From 10c4896b5b03313b7d02fc2e35b6a41288d39e60 Mon Sep 17 00:00:00 2001 From: Robert Jedrzejewski Date: Wed, 7 Apr 2021 13:05:21 -0400 Subject: [PATCH 3/3] Fix typo --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index c17a20d49b..e9a8871de8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -106,7 +106,7 @@ refpix - Added code to handle NIR subarrays that use 4 readout amplifiers. Uses and applies reference pixel signal from available amplifiers and side reference pixel regions, including odd-even column separation if requested [#5926] -- Fixed a bug introduced in #5026 that affected refpix calibration of 1-amp NIR subarrays [#5937] +- Fixed a bug introduced in #5926 that affected refpix calibration of 1-amp NIR subarrays [#5937] source_catalog --------------