Skip to content

Correct the shifting of NaN pixels in ERR array - #307

Open
kglidic wants to merge 3 commits into
developfrom
fix_nan_shifting
Open

kglidic wants to merge 3 commits into
developfrom
fix_nan_shifting

Conversation

@kglidic

@kglidic kglidic commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Previously, replace_nans was updated to replace NaNs in the ERR array with a large bad value of 1e6 so that shifting would not turn the ERR array entirely into NaNs (#301). However, shifting those 1e6 values introduced distorted ERR values.

In this PR, NaNs are left in the ERR array until shift_frames. In shift_frames, NaNs are temporarily replaced with 0, while a separate mask tracks their original locations and is shifted using the same offsets. After shifting, the affected ERR pixels are then set to 1e6.

This closes #304

Additional things in this PR:

  • Removed duplication of the mask_NDsquares function in imagetools.
  • Pulled in changes from the PR for the use_ta_issues branch.

NIRCam Tutorial Data :
image

MIRI Tutorial Data :
image

@kglidic kglidic changed the title Correct the shifting of NaN pixels Correct the shifting of NaN pixels in ERR array Sep 22, 2026
@kglidic
kglidic marked this pull request as ready for review September 23, 2026 19:59
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.

[Enhancement]: Check that the ERR array is shifted correctly

1 participant