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

Implement new (via image) and maintain old (scalar) saturation image flagging #585

Merged
merged 4 commits into from
Aug 8, 2023

Conversation

mdlpstsci
Copy link
Contributor

Completed implementation to use an image to detect and flag full-well saturation versus a simple scalar. The new routine, dofwsat.c, is similar to what has been done for calacs. The WFC3 implementation is more complicated in that there are serial virtual overscan columns, as well as binned images, to accommodate. The detection/flagging occurs after blev and bias corrections while the output is still in counts. If the SATUFILE keyword is missing from the FITS header, or the keyword does not have a valid filename as a value, the code will revert to using the original method of flagging full-well saturation. The flagging will be done in doDQI and use a single value as the saturation threshold.

mdlpstsci added 3 commits June 8, 2023 11:57
be backwards compatible when the SATFILE FITS keyword is missing or
contains a bad value in the PHDU of the RAW file.
full-well saturated data is done if the SATFILE keyword is missing
or has a bad value.
@mdlpstsci mdlpstsci self-assigned this Aug 7, 2023
@mdlpstsci mdlpstsci requested a review from a team as a code owner August 7, 2023 15:42
@@ -182,7 +190,16 @@ SingleGroup *x io: image to be calibrated; DQ array written to in-place
if (wf3->dqicorr != PERFORM && wf3->dqicorr != DUMMY)
return (status);

/* Issue a message so it is clear that saturation flagging is
Copy link
Collaborator

Choose a reason for hiding this comment

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

Indent lines 193-199

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Argh - spaces vs tabs. Changed to tabs as the remainder of the file is set. Commit dbc7370.

@@ -194,6 +211,14 @@ SingleGroup *x io: image to be calibrated; DQ array written to in-place
sum_dq = DQPix (x->dq.data, i, j) | ATODSAT;
DQSetPix (x->dq.data, i, j, sum_dq); /* atod sat */
}

if (wf3->scalar_satflag == True) {
Copy link
Collaborator

@raswaters raswaters Aug 7, 2023

Choose a reason for hiding this comment

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

Are lines 215-221 to be executed after lines 210-213, or instead of?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lines 215-221 are executed after Lines 210-213.

@mdlpstsci mdlpstsci requested a review from raswaters August 7, 2023 19:13
@mdlpstsci mdlpstsci merged commit 85fdcc8 into spacetelescope:master Aug 8, 2023
@mdlpstsci
Copy link
Contributor Author

Resolves Issue #558 #584

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.

2 participants