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

ramp_fitting using stcal and roman_datamodels #276

Merged
merged 5 commits into from
Sep 25, 2021

Conversation

nden
Copy link
Collaborator

@nden nden commented Aug 20, 2021

Closes #279
Closes #277

Resolves RCAL-191
Resolves RCAL-189

Description

This PR implements ramp_fitting using stcal, roman_datamodels and romancal.stpipe.
It needs spacetelescope/stcal#43, spacetelescope/rad#66 and spacetelescope/rad#86 .

Fixed the formatting of CHANGES.rst.

Checklist

  • Tests

  • Documentation

  • [x ] Change log

  • [ x] Milestone

  • [x ] Label(s)

@nden nden marked this pull request as draft August 20, 2021 20:36
@codecov
Copy link

codecov bot commented Aug 20, 2021

Codecov Report

Merging #276 (7a73054) into main (913aeb8) will decrease coverage by 16.58%.
The diff coverage is 29.54%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #276       +/-   ##
===========================================
- Coverage   52.11%   35.53%   -16.59%     
===========================================
  Files          24       24               
  Lines         662      667        +5     
===========================================
- Hits          345      237      -108     
- Misses        317      430      +113     
Flag Coverage Δ
nightly ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
romancal/stpipe/integration.py 100.00% <ø> (ø)
romancal/ramp_fitting/ramp_fit_step.py 29.50% <24.39%> (+23.73%) ⬆️
romancal/ramp_fitting/__init__.py 100.00% <100.00%> (ø)
romancal/step.py 100.00% <100.00%> (ø)
romancal/flatfield/flat_field.py 26.47% <0.00%> (-64.71%) ⬇️
romancal/flatfield/flat_field_step.py 28.00% <0.00%> (-56.00%) ⬇️
romancal/dq_init/dq_init_step.py 23.80% <0.00%> (-54.77%) ⬇️
romancal/jump/jump_step.py 22.95% <0.00%> (-40.99%) ⬇️
romancal/regtest/regtestdata.py 27.04% <0.00%> (-20.92%) ⬇️
romancal/stpipe/core.py 80.00% <0.00%> (-6.67%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 913aeb8...7a73054. Read the comment docs.

with rdd.open(input, mode='rw') as input_model:
input_model.data = input_model.data[np.newaxis, :]
input_model.data.dtype=np.float32
input_model.groupdq = input_model.groupdq[np.newaxis, :]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the err array also be 'redimensionalized' here ? ( and refout, even though it is not currently used ?)

# load the gain ref file again in that step.
if gain_model.meta.exposure.gain_factor is not None:
input_model.meta.exposure.gain_factor = \
gain_model.meta.exposure.gain_factor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is no longer needed due to DataModel refactoring ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering - there is no gain_factor in the gain schema. Did we miss it or is it somewhere else? @ddavis-stsci ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding our conversation from slack for reference:
dencheva:
gain models in jwst have meta.exposure.gain_factor attribute. This is missing from the roman one. Is this supposed to be in the data array for Roman? The documentation for gain reference file does not mention gain_factor.

phuwe 2:30 PM
gain_factor is in exposure in RAD

ddavis:house_with_garden: 2:35 PM
I don’t think we have gain_factors in Roman. If I recall correctly this is to account for non-standard gain factors when used in certain JWST modes. I suppose Roman can use them but so far we have no use case for a gain_factor

perry 2:36 PM
If it is needed by the existing JWST code, we can just generate a value of 1 in the converter.

ddavis:house_with_garden: 2:37 PM
The value of 1 should be fine if we need it. (edited)

dencheva:house_with_garden: 2:48 PM
There's no need for that, it's used within the pipeline code (i.e. it's mission specific) and in this case can be ignored. I just wanted to confirm we did not miss anything.
2:50
In jwst it's used in gain_scale. AFAIK we are not going to run gain_scale for roman but it's still listed in the docs as one of the steps
2:51
Or perhaps I misunderstand its use. @Grumm may not better

grumm:slightly_smiling_face: 3:29 PM
Back in February we thought this was needed (GH PR 120: Create gain factor keyword schema; Gain factor keyword needed. RCAL#91) . I am not aware of any more recent changes regarding whether it is needed.

@nden nden marked this pull request as ready for review September 21, 2021 19:22
@nden nden added this to the Build 0.4 milestone Sep 21, 2021
Copy link
Collaborator

@ddavis-stsci ddavis-stsci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good.

@nden nden merged commit e9fa0aa into spacetelescope:main Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Ramp Gain Code to use RDM Update Ramp Readnoise code to RDM
3 participants