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

Ignore nans in staticmask call to stsci.imagestats #1909

Merged

Conversation

s-goldman
Copy link
Collaborator

@s-goldman s-goldman commented Nov 5, 2024

In investigating a build error (HLA-1368) we found an error where a nan in the science image array caused an error in a call to stsci.imagestats. The call to stsci.imagestats calculates a min and max (used for cuts), that results in nans for both.

Here I am passing min and max values using np.nanmin and np.nanmax, which ignore nans in the calculation.

@s-goldman s-goldman marked this pull request as ready for review November 5, 2024 19:11
@s-goldman s-goldman requested review from mdlpstsci and a team as code owners November 5, 2024 19:11
@s-goldman s-goldman changed the title Ignore nans in stsci.imagestats Ignore nans in staticmask call to stsci.imagestats Nov 5, 2024
Copy link
Collaborator

@mdlpstsci mdlpstsci left a comment

Choose a reason for hiding this comment

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

Changes look fine.

@s-goldman s-goldman merged commit c4161f9 into spacetelescope:main Nov 6, 2024
18 checks passed
@s-goldman s-goldman deleted the ignore_nans_in_stsci_imagestats branch November 6, 2024 14:19
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