From ce06d604f31366a7a9ebb46504bd796fbb12d5e6 Mon Sep 17 00:00:00 2001 From: Dave Davis Date: Fri, 29 Apr 2022 10:27:01 -0400 Subject: [PATCH 1/2] RCAL-327 Allow Nan's in linearity ref file remove romanad from setup. --- romancal/linearity/linearity_step.py | 11 +++++++---- setup.cfg | 1 - 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/romancal/linearity/linearity_step.py b/romancal/linearity/linearity_step.py index 054e16b8c..683e40093 100644 --- a/romancal/linearity/linearity_step.py +++ b/romancal/linearity/linearity_step.py @@ -40,7 +40,9 @@ def process(self, input): return result lin_model = rdd.LinearityRefModel(self.lin_name) - lin_coeffs = lin_model.coeffs # poly coeffs from linearity model + + # copy poly coeffs from linearity model so Nan's can be updated + lin_coeffs = lin_model.coeffs.copy() lin_dq = lin_model.dq # 2D pixeldq from linearity model gdq = input_model.groupdq # groupdq array of input model @@ -52,10 +54,11 @@ def process(self, input): output_model.data = output_model.data[np.newaxis, :] # Call linearity correction function in stcal - new_data, new_pdq = linearity_correction(output_model.data, gdq, pdq, - lin_coeffs, lin_dq, dqflags.pixel) + new_data, new_pdq = linearity_correction(output_model.data, + gdq, pdq, lin_coeffs, + lin_dq, dqflags.pixel) - output_model.data = new_data[0,:,:,:] + output_model.data = new_data[0, :, :, :] output_model.pixeldq = new_pdq # Close the reference file and update the step status diff --git a/setup.cfg b/setup.cfg index d18b90694..b5e0dbcf3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,6 @@ install_requires = pyparsing>=2.2 requests>=2.22 roman_datamodels>=0.11.0 - romanad==0.10.0 stcal>=0.2.5 stpipe>=0.3.1 From 1027d8f1b87d3b7a6b17ea711130078caafd2e23 Mon Sep 17 00:00:00 2001 From: Dave Davis Date: Fri, 29 Apr 2022 11:22:15 -0400 Subject: [PATCH 2/2] RCAL-327 Update CHANGES.rst --- CHANGES.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2cfbbe992..efc95060b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -12,7 +12,12 @@ Documentation - Add documentation for DNS build 0.5, e.g. reference array trimming [#457] -photom +linearity +--------- + +- Linearity correction now supports NaN's in the reference file. [#484] + + photom ------ - Added photom correction step and unit tests. [#469]