Skip to content

Fix stokes passed as integer string to imsubimage in 4D mosaic path#349

Merged
thomaswilliamsastro merged 1 commit into
PhangsTeam:masterfrom
EOakes:fix/stokes-imsubimage
Jun 10, 2026
Merged

Fix stokes passed as integer string to imsubimage in 4D mosaic path#349
thomaswilliamsastro merged 1 commit into
PhangsTeam:masterfrom
EOakes:fix/stokes-imsubimage

Conversation

@EOakes

@EOakes EOakes commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

In the channel-by-channel ndim==4 path of mosaic_aligned_data, imsubimage was being called with stokes='0' (an integer index as a string), but it requires a polarization label like 'I'. Fixed by reading the stokes labels from the coordinate system of myia_sum, which is already open at that point.

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 6.28%. Comparing base (3d909c2) to head (24234ac).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
phangsPipeline/casaMosaicRoutines.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           master    #349      +/-   ##
=========================================
- Coverage    6.28%   6.28%   -0.01%     
=========================================
  Files          38      38              
  Lines       15229   15232       +3     
  Branches     3660    3660              
=========================================
  Hits          957     957              
- Misses      14258   14261       +3     
  Partials       14      14              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@thomaswilliamsastro

Copy link
Copy Markdown
Collaborator

Seems reasonable to me. I wonder why we haven't found this before? Any ideas @EOakes? I would have thought this should affect any mosaics we're trying to run...

imsubimage expects a polarization name like 'I', not an integer index like '0'.
Fix by reading stokes labels from the already-open myia_sum coordinate system.

Add changelog entry
@EOakes

EOakes commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Seems reasonable to me. I wonder why we haven't found this before? Any ideas @EOakes? I would have thought this should affect any mosaics we're trying to run...

I think it's the fact that a) the cube has to be big enough to trigger the memory-managed path, and b) the input images need to be 3D so adddegaxes fires - in previous testing for #323, I may have overlooked the second condition.

@thomaswilliamsastro

Copy link
Copy Markdown
Collaborator

@EOakes OK! It's clear to me that we should probably just keep the 4 axes around through postprocessing so we save a bunch of time adding them back in and ripping them out, so this seems like a good point to start

@thomaswilliamsastro thomaswilliamsastro merged commit b1ee3fb into PhangsTeam:master Jun 10, 2026
4 of 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.

2 participants