Skip to content

Commit

Permalink
Merge pull request #926 from HERA-Team/fix-write-vis
Browse files Browse the repository at this point in the history
fix: enforce that ant numbers are uint64
  • Loading branch information
steven-murray authored Dec 7, 2023
2 parents c2f2c41 + f1ea817 commit d45df27
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit d45df27

Please sign in to comment.