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: enforce that ant numbers are uint64 #926

Merged
merged 3 commits into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions hera_cal/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -2204,9 +2204,13 @@ def write_vis(fname, data, lst_array, freq_array, antpos, time_array=None, flags
# configure baselines
antpairs = np.repeat(np.array(antpairs), Ntimes, axis=0)

antpairs_int = antpairs.astype(np.uint64)
if not np.allclose(antpairs, antpairs_int):
raise ValueError("antenna numbers must be non-negative integers")

# get ant_1_array, ant_2_array
ant_1_array = antpairs[:, 0]
ant_2_array = antpairs[:, 1]
ant_1_array = antpairs_int[:, 0]
ant_2_array = antpairs_int[:, 1]

# get baseline array
baseline_array = 2048 * (ant_1_array + 1) + (ant_2_array + 1) + 2**16
Expand Down