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

RCAL-327 Allow Nan's in linearity ref file remove romanad from setup. #484

Merged
merged 2 commits into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 6 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 7 additions & 4 deletions romancal/linearity/linearity_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down