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

Bug in number of groups in twopoint_difference code #8934

Open
stscijgbot-jp opened this issue Oct 30, 2024 · 2 comments
Open

Bug in number of groups in twopoint_difference code #8934

stscijgbot-jp opened this issue Oct 30, 2024 · 2 comments

Comments

@stscijgbot-jp
Copy link
Collaborator

Issue JP-3793 was created on JIRA by David Law:

A science collaborator reported strange performance of detector1  in versions 1.14.1 and more recent of the pipeline, which I've run down to partially related to an erroneous calculation in the number of groups within the twopoint_difference step.

Around line 164:

else:
        total_sigclip_groups = nints * (ngrps - num_flagged_grps)
 total_groups = nints * (ngrps - num_flagged_grps)
 total_diffs = nints * (ngrps - 1 - num_flagged_grps)
 total_usable_diffs = total_diffs - num_flagged_grps

I think the parentheses are misplaced here, in the case I'm looking at (jw01294008) ngroups=5, nints=15, and num_flagged_grps=30 since there are 2 flagged groups (first and last) in each of the 15 ints.  The calculated total_groups is thus -375, and likewise for the other computed terms, e.g. total_usable_diffs = -420

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

Discussion ongoing with Michael Regan about how this should be resolved, and whether the comparison of ngrps against minimum_groups should instead be the number of usable groups against minimum_groups.

Test case inspired by jw01294008001_08101_00002_mirifushort which started showing NaN slopes after the 1.14.1 change to being able to look across integrations.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by David Law on JIRA:

See spacetelescope/stcal#317

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

No branches or pull requests

1 participant