Skip to content

Commit

Permalink
fix: reset rectangularity after fast_concat
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-murray authored and bhazelton committed Feb 8, 2024
1 parent 1f0fc1d commit 7f89096
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions pyuvdata/uvdata/tests/test_uvdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -12712,13 +12712,14 @@ def test_antpair2ind_not_rect_not_ordered(hera_uvh5):

def test_antpair2ind_unordered_both_exist(hera_uvh5):
# Make a new object that has conjugated baselines in it as well.
hera_uvh5.set_rectangularity()
hera_uvh5.conjugate_bls("ant1<ant2")
full = hera_uvh5.copy()
full.conjugate_bls("ant2<ant1")
full.fast_concat(hera_uvh5, axis="blt")

print(full.get_antpairs())
print(hera_uvh5.get_antpairs())
full.conjugate_bls("ant2<ant1")
full.fast_concat(hera_uvh5, axis="blt", inplace=True)
full.select(bls=[(0, 1), (1, 0)], inplace=True)
full.reorder_blts(order="time", minor_order="baseline")
inds_ordered = full.antpair2ind((0, 1), ordered=True)
inds_unordered = full.antpair2ind((0, 1), ordered=False)

Expand Down
4 changes: 3 additions & 1 deletion pyuvdata/uvdata/uvdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4030,7 +4030,7 @@ def get_baseline_nums(self):
Array of unique baselines with data associated with them.
"""
if self.blts_are_rectangular:
if self.blt_order == ("baseline", "time"):
if self.time_axis_faster_than_bls:
return self.baseline_array[:: self.Ntimes]
else:
return self.baseline_array[: self.Nbls]
Expand Down Expand Up @@ -7540,6 +7540,8 @@ def fast_concat(
if this.filename is not None:
this._filename.form = len(this.filename)

this.set_rectangularity(force=True)

# Check final object is self-consistent
if run_check:
this.check(
Expand Down

0 comments on commit 7f89096

Please sign in to comment.