Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JP-2032: Fix bug introduced when adding 4-amp subarray processing in refpix step #5937

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------

Expand Down
4 changes: 2 additions & 2 deletions docs/jwst/refpix/description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion jwst/refpix/reference_pixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down