Skip to content

Fix crash with swapped Spectral/Stokes axes for large mosaics#366

Draft
thomaswilliamsastro wants to merge 1 commit into
masterfrom
fix-big-mosaics
Draft

Fix crash with swapped Spectral/Stokes axes for large mosaics#366
thomaswilliamsastro wants to merge 1 commit into
masterfrom
fix-big-mosaics

Conversation

@thomaswilliamsastro

Copy link
Copy Markdown
Collaborator

This PR fixes a crash that can occur if the spectral/Stokes axes are swapped when creating a large mosaic.

  • Fixed crash if spectral/Stokes axis is swapped when making large mosaics

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 6.26%. Comparing base (86f34f4) to head (8e17dea).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #366      +/-   ##
=========================================
- Coverage    6.27%   6.26%   -0.01%     
=========================================
  Files          38      38              
  Lines       15232   15248      +16     
  Branches     3660    3660              
=========================================
  Hits          956     956              
- Misses      14262   14278      +16     
  Partials       14      14              
Components Coverage Δ
casa 4.90% <0.00%> (-0.02%) ⬇️
handler 6.33% <ø> (ø)
spectral-cube 7.19% <ø> (ø)
utils 5.25% <ø> (ø)

@thomaswilliamsastro

Copy link
Copy Markdown
Collaborator Author

@EOakes it'd be good to get your eyes on this, I think this is basically the same fix as you put in in some other places not too long ago. For some reason, the pipeline spits stuff out as RA/Dec/Stokes/Freq, rather than our normally assumed RA/Dec/Freq/Stokes

@thomaswilliamsastro
thomaswilliamsastro force-pushed the fix-big-mosaics branch 3 times, most recently from 18dd7bb to 0f65bf2 Compare July 16, 2026 07:53

@EOakes EOakes Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good - this approach also matches what copy_mask in casaCubeRoutines.py already does.
Would also be good to correct the hardcoded blc = [0, 0, ichan, istokes] around line 1332, which I think faces the same issue.
Other hardcoded lines (~823, 892, 1118) are iterated over symmetrically, so they'll be mislabeled but won't break things if the axes are swapped.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Right, I've edited that now so should be fine as well

@EOakes EOakes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me now.

This PR fixes a crash that can occur if the spectral/Stokes axes are swapped when creating a large mosaic.

- Fixed crash if spectral/Stokes axis is swapped when making large mosaics
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.

2 participants