Fix wrong number of channels in regrid when combining different datasets#344
Merged
Conversation
042b9d5 to
1647a20
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #344 +/- ##
=========================================
- Coverage 6.27% 6.27% -0.01%
=========================================
Files 38 38
Lines 15211 15229 +18
Branches 3648 3653 +5
=========================================
+ Hits 954 955 +1
- Misses 14243 14260 +17
Partials 14 14 ☔ View full report in Codecov by Sentry. |
low-sky
reviewed
May 19, 2026
| add_chans += total_nchan_unbinned - (nchan + add_chans) | ||
|
|
||
| # Cast back to integer | ||
| add_chans = int(add_chans) |
Collaborator
There was a problem hiding this comment.
ceil first seems like it might be safer in the cases where we end up slightly off integer because of the velocity <-> frequency non-linearity. I'm not sure it happens but I always get spooked.
low-sky
approved these changes
May 19, 2026
Collaborator
low-sky
left a comment
There was a problem hiding this comment.
No problems but I haven't run all the corner cases.
Fixes #248 and #342. This fixes the occasional wrong number of channels when doing the mstransform regrid call in data staging. The first issue, occasional blank channels at the start/end of cube was due to an error in calculating the number of channels to pad by. There is also a second issue where combining datasets from different programmes can lead to different numbers of channels, and hence wonky coverage in the start/end channels. This is now fixed by ensuring all input datasets have the same number of output channels. N.B. this may have some effect in shifting cubes so the systemic isn't quite in the cube centre. I'm only seeing this change the total number of channels by 1 so not a big deal, but we might want to keep an eye out - Ensure when combining MS's that they all have the same number of output channels - Fix wrong number of channels in regrid when combining different datasets - Update changelog
1647a20 to
284a7cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #248 and #342.
This fixes the occasional wrong number of channels when doing the mstransform regrid call in data staging. The first issue, occasional blank channels at the start/end of cube was due to an error in calculating the number of channels to pad by. There is also a second issue where combining datasets from different programmes can lead to different numbers of channels, and hence wonky coverage in the start/end channels. This is now fixed by ensuring all input datasets have the same number of output channels.
N.B. this may have some effect in shifting cubes so the systemic isn't quite in the cube centre. I'm only seeing this change the total number of channels by 1 so not a big deal, but we might want to keep an eye out