Skip to content

Keeps Stokes throughout postprocessing#353

Merged
thomaswilliamsastro merged 1 commit into
masterfrom
keep-stokes-postprocess
Jun 24, 2026
Merged

Keeps Stokes throughout postprocessing#353
thomaswilliamsastro merged 1 commit into
masterfrom
keep-stokes-postprocess

Conversation

@thomaswilliamsastro

@thomaswilliamsastro thomaswilliamsastro commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

This PR fixes the unnecessary slowdowns that come with re-adding degenerate axes throughout postprocessing.

CASA now typically crashes if the images don't have 4 axes in, which it didn't use to. So we now spend a lot of time ripping them out and putting them back in, which can take a long time for big cubes. Now, we just keep the Stokes axis in throughout, dropping when we export to fits at the end.

This also finally fixes the feather/feather_before_mosaic logic:

  • If feather is True and feather_before_mosaic is False, it will feather together individual mosaic tiles, as well as mosaicking the interferometric and singledish data before feathering those together for the final mosaic of mosaics.
  • If feather is True and feather_before mosaic is True, then it will instead mosaic together the feathered individual tiles. Note that if feather_before_mosaic is True, it will still create the full singledish image, but will not use this for the final mosaic.

Fixes:

  • Fix bug with has_memory_issue call
  • Ensure coordinate axes between interferometric/singledish data match up when staging in postprocessing
  • Fix pixperbeam in trim cube to actually respect min_pixperbeam
  • Remove dropdegaxes calls, since we don't use them any more
  • ccr_dropdeg has now been renamed to ccr_importfits, and modified to either import a fits file or just copy over
  • Fix logic with feather_before_mosaic

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
phangsPipeline/casaFeatherRoutines.py 0.00% 13 Missing ⚠️
phangsPipeline/handlerPostprocess.py 7.69% 12 Missing ⚠️
phangsPipeline/casaMosaicRoutines.py 0.00% 11 Missing ⚠️
phangsPipeline/casaCubeRoutines.py 10.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           master    #353      +/-   ##
=========================================
+ Coverage    6.27%   6.28%   +0.01%     
=========================================
  Files          38      38              
  Lines       15242   15209      -33     
  Branches     3664    3654      -10     
=========================================
  Hits          956     956              
+ Misses      14272   14239      -33     
  Partials       14      14              

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

@thomaswilliamsastro thomaswilliamsastro force-pushed the keep-stokes-postprocess branch 2 times, most recently from b568bf3 to 0f10a71 Compare June 18, 2026 07:38
@thomaswilliamsastro thomaswilliamsastro force-pushed the keep-stokes-postprocess branch 2 times, most recently from e74b32b to e08d892 Compare June 23, 2026 20:40
Comment thread phangsPipeline/casaCubeRoutines.py Outdated
This PR fixes the unnecessary slowdowns that come with re-adding degenerate axes throughout postprocessing.

CASA now typically crashes if the images don't have 4 axes in, which it didn't use to. So we now spend a lot of time ripping them out and putting them back in, which can take a long time for big cubes. Now, we just keep the Stokes axis in throughout, dropping when we export to fits at the end.

This also finally fixes the feather/feather_before_mosaic logic. Now, if feather is True and feather_before_mosaic is False, it will feather together individual mosaic tiles, as well as mosaicking the interferometric and singledish data before feathering those together for the final mosaic of mosaics. If feather_before mosaic is True, then it will instead mosaic together the feathered individual tiles. Note that if feather_before_mosaic is True, it will still create the full singledish image, but will not use this for the final mosaic.

- Fix bug with has_memory_issue call
- Ensure coordinate axes between interferometric/singledish data match up when staging in postprocessing
- Fix pixperbeam in trim cube to actually respect min_pixperbeam
- Remove dropdegaxes calls, since we don't use them any more
- ccr_dropdeg has now been renamed to ccr_importfits, and modified to either import a fits file or just copy over
- Fix logic with feather_before_mosaic
@thomaswilliamsastro thomaswilliamsastro merged commit b90495d into master Jun 24, 2026
7 of 8 checks passed
@thomaswilliamsastro thomaswilliamsastro deleted the keep-stokes-postprocess branch June 24, 2026 12:56
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