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 the 'saturated' flag to suppress one group ramp fits #103

Open
cshanahan1 opened this issue Jun 21, 2022 · 2 comments
Open

Comments

@cshanahan1
Copy link
Collaborator

cshanahan1 commented Jun 21, 2022

I found a potential issue with using the 'saturation' flag to mark pixels with just one good group to suppress ramp fitting.

If you have a pixel that has DQ flags:
[0 4 4 4 4 4 4 2 2 2]
these will become
[2 4 4 4 4 4 4 2 2 2]
since there is only one usable group left. This triggers the do_all_sat function to be called since the 0th group is saturated,
(see line 835 of `ols_fit.py').

Assuming that the 0th group means that all subsequent groups are saturated is only true when the flag is applied for actual saturation (since that is what the saturation routine does). This isn't true when the flag is being used as a placeholder to suppress ramp fitting. If, for example, your DQ flags were:
[4 0 4 4 4 4 4 2 2 2]
Then the function to flag solitary good groups would set it to:
[4 2 4 4 4 4 4 2 2 2]
The do_all_sat function wouldn't be triggered since the 0th group isn't saturated, even though it's the same scenario as above. Additionally, the logging message 'all groups are saturated' here isn't exactly true.

This is only a single pixel example - in reality, it will be checking if every dq flag in the 0th group is saturated, which will typically mean they're truly all saturated, but the example I've isolated here made me wonder if this was really what should be happening here. The fit ramps returned in both cases are 0.0 as expected, but the other return values of ramp_fitting differ.

@cshanahan1
Copy link
Collaborator Author

@kmacdonald-stsci

@kmacdonald-stsci
Copy link
Collaborator

@cshanahan1 The PR #99 changes the way one good group ramps get suppressed. How these ramps should be suppressed is still being discussed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants