Skip to content

Commit

Permalink
JP-2032: Fix bug introduced when adding 4-amp subarray processing in …
Browse files Browse the repository at this point in the history
…refpix step (#5937)

* Fix bug introduced when adding 4-amp subarray processing in refpix step

* Add changelog entry

* Fix typo
  • Loading branch information
stscirij authored Apr 7, 2021
1 parent 2dd780f commit c5cfcd5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,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 #5926 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

0 comments on commit c5cfcd5

Please sign in to comment.