Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ringmapmaker): fix bug finding shortest baseline in find_basis #251

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

ssiegelx
Copy link
Contributor

Previous version gives the correct result for CHIME, but can result in incorrect values for the grid spacing and indices for other telescopes due to a bug in how the shortest baseline is identified.

Previous version gives the correct result for CHIME, but can result
in incorrect values for the grid spacing and indices for other
telescopes due to a bug in how the shortest baseline is identified.
@ssiegelx
Copy link
Contributor Author

I think there is a bug here: find_basis is calculating the argmin of the absolute value of the (nbase, 2) baseline array. This will give an index into the (nbase * 2,) flattened array, but it is being used to index the first dimension of the unflattened array.

This happens to give the correct basis for both the un-rotated and rotated versions of CHIME. However, it is giving incorrect results for certain CHORD baseline layouts that are on a simple un-rotated grid.

I think the intention here was to find the baseline with the shortest total length. I've updated the function and confirmed that is gives the expected result for un-rotated/rotated CHIME and CHORD.

@ssiegelx ssiegelx requested review from ljgray and jrs65 August 24, 2023 21:26
@jrs65
Copy link
Contributor

jrs65 commented Aug 24, 2023

Yeah, that's a bug. Good catch!

@ssiegelx ssiegelx merged commit 544e485 into master Aug 25, 2023
4 checks passed
@ssiegelx ssiegelx deleted the ss/find_basis_bug branch August 25, 2023 12:50
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