Skip to content

Commit

Permalink
replace inefficient baseline sorting
Browse files Browse the repository at this point in the history
Co-authored-by: Steven Murray <[email protected]>
  • Loading branch information
tyler-a-cox and steven-murray authored Apr 23, 2024
1 parent c83cb2e commit f43a05c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions hera_sim/visibilities/fftvis.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,10 @@ def simulate(self, data_model):
# Get antpairs in the order that they appear in the uvdata.data_array
# In certain cases, uvdata.get_antpairs() will return a different order
# than the order in the data_array
antpair_dict = {}
for ant1, ant2 in zip(
data_model.uvdata.ant_1_array, data_model.uvdata.ant_2_array
):
if (ant1, ant2) not in antpair_dict:
antpair_dict[(ant1, ant2)] = None

antpairs = list(antpair_dict.keys())
if data_model.uvdata.time_axis_faster_than_bls:
antpairs = list(zip(data_model.uvdata.ant_1_array[::data_model.uvdata.Ntimes], data_model.uvdata.ant_2_array[::data_model.uvdata.Ntimes] ))
else:
antpairs = list(zip(data_model.uvdata.ant_1_array[:data_model.uvdata.Nbls], data_model.uvdata.ant_2_array[:data_model.uvdata.Nbls] ))

# Get pixelized beams if required
logger.info("Preparing Beams...")
Expand Down

0 comments on commit f43a05c

Please sign in to comment.