Skip to content

Fix scaling in WATA and MIRI TA preview images#1686

Merged
mfixstsci merged 7 commits intospacetelescope:developfrom
bhilbert4:wata-preview-img-improvement
Jul 16, 2025
Merged

Fix scaling in WATA and MIRI TA preview images#1686
mfixstsci merged 7 commits intospacetelescope:developfrom
bhilbert4:wata-preview-img-improvement

Conversation

@bhilbert4
Copy link
Copy Markdown
Collaborator

Adjust scaling when creating preview images for NIRSpec WATA and MIRI non-full-frame TA images.

Trial and error with historical data shows that the WATA images look better when linearly scaled (rather than log). For MIRI non-full-frame TA images, it turns out that all the pixels in the subarrays were flagged as non-science. This meant there were no pixels left to use for scaling, and so scaling was falling back to a default scaling of 0 to 1. This fix instead checks for the case where all pixels are flagged as non-science, and when that happens, it declares all pixels as good for the purposes of scaling. This results in images that look decent, especially compared to the solid yellow squares we had previously.

I've also added an if statement to call the AutoMinorLocator function only when the scaling is linear. This should suppress all of the warnings that AutoMinorLocator does not work with log scaling.

@bhilbert4 bhilbert4 self-assigned this Mar 31, 2025
@bhilbert4
Copy link
Copy Markdown
Collaborator Author

At the moment these changes are looking good. Just need to test on a greater diversity of subarray shapes and sizes.

@bhilbert4 bhilbert4 linked an issue Apr 1, 2025 that may be closed by this pull request
@bhilbert4
Copy link
Copy Markdown
Collaborator Author

Fixed the colorbar tick marks for the linear scaling case, and tested on a few other types of files. I'm happy with this now. I think it's ready for review, merge, and then a more comprehensive test on the test server. @mfixstsci

Copy link
Copy Markdown
Collaborator

@mfixstsci mfixstsci left a 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 @bhilbert4 the inline comments made it very easy to follow. Since we are dealing with preview images here, will they need to be regenerated with the new scaling?

@bhilbert4
Copy link
Copy Markdown
Collaborator Author

Looks good to me @bhilbert4 the inline comments made it very easy to follow. Since we are dealing with preview images here, will they need to be regenerated with the new scaling?

Yep. A manual run on WATA data is needed, or I think we can simply delete the existing preview images once this is released, and the next run of the preview image generator should re-create them.

@mfixstsci mfixstsci merged commit 37eb610 into spacetelescope:develop Jul 16, 2025
11 checks passed
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

Successfully merging this pull request may close these issues.

Better preview images for WATA files

2 participants