-
Notifications
You must be signed in to change notification settings - Fork 32
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
Al-479: Add ramp fitting to STCAL #6
Al-479: Add ramp fitting to STCAL #6
Conversation
…. The addition of this code to STCAL works fine with JWST ramp fitting tests, including regression tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me.
Running the Passing results here: https://plwishmaster.stsci.edu:8081/job/RT/job/jdavies-dev/241/ Clean up the PEP8 issues in this PR, and this can be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
DO_NOT_USE = 2**0 # Bad pixel. Do not use. | ||
SATURATED = 2**1 # Pixel saturated during exposure. | ||
JUMP_DET = 2**2 # Jump detected during exposure | ||
NO_GAIN_VALUE = 2**19 # Gain cannot be measured | ||
UNRELIABLE_SLOPE = 2**24 # Slope variance large (i.e., noisy pixel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are going to want to figure out a way to make sure that JWST and Roman use the same DQ mnemonics, and a way to formalize that in a test across both pipelines. Otherwise the shared code model will fall apart.
# final group. Similarly, if leading groups 1 though N have all pixels | ||
# flagged as DO_NOT_USE, those groups will be ignored by ramp fitting, and | ||
# the input model arrays will be resized appropriately. If all pixels in | ||
# all groups are flagged, return None for the models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hbushouse Is this specific to MIRI? I realize this is how the code was in jwst. Should this logic be applied to all instruments?
|
||
|
||
def ramp_fit(model, buffsize, save_opt, readnoise_2d, gain_2d, | ||
algorithm, weighting, max_cores): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it feasible to add the mission/instrument specific dqflags as a parameter to ramp_fit
and avoid hardcoding the values for the two missions here. They can be passed as a
dqflags = {'group_dq: {...}.
'pixel_dq': {...}
}
or a dict of only the flags needed by ramp_fitting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will have to be discussed what the best way is to get this information to ramp fit in STCAL. Changing the ramp_fit
function will mean changing all the tests, but that might be the best way to make this function general use for multiple pipelines.
Many of the comments are related to docstrings. The main functional one is the suggestion to pass the dqflags as a parameter to |
Regarding the docstrings, wherever there was an |
Given the two approvals in the comments I am going to merge this. |
Ramp fitting code moved from JWST to STCAL.