Skip to content

Commit 0806018

Browse files
steven-murraybhazelton
authored andcommittedNov 21, 2024
fix: can't assume that time/baseline ordering means rectangularity
1 parent bc29727 commit 0806018

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed
 

‎src/pyuvdata/utils/bltaxis.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ def determine_rectangularity(
193193
or Nbls will give you either all the same time and all different baselines, or
194194
vice versa. This does NOT require that the baselines and times are sorted within
195195
that structure.
196+
197+
Note that blt_order being (time, baseline) or vice versa does *not* guarantee
198+
rectangularity, even when Nblts == Nbls * Ntimes, since if `autos_first = True` is
199+
set on `reorder_blts`, then it will still set the blt_order attribute to
200+
(time, baseline), but they will not strictly be in that order (since it will
201+
actually be in autos first order).
196202
"""
197203
# check if the data is rectangular
198204
time_first = True
@@ -204,10 +210,13 @@ def determine_rectangularity(
204210
return True, True
205211
elif ntimes == 1:
206212
return True, False
213+
# Note that the opposite isn't true: time/baseline ordering does not always mean
214+
# that we have rectangularity, because of the autos_first keyword to reorder_blts.
207215
elif blt_order == ("baseline", "time"):
208216
return True, True
209-
elif blt_order == ("time", "baseline"):
210-
return True, False
217+
218+
# elif blt_order == ("time", "baseline"):
219+
# return True, False
211220

212221
# That's all the easiest checks.
213222
if time_array[1] == time_array[0]:

‎src/pyuvdata/uvdata/uvdata.py

+9
Original file line numberDiff line numberDiff line change
@@ -4083,6 +4083,15 @@ def reorder_blts(
40834083

40844084
self.set_rectangularity(force=True)
40854085

4086+
print(
4087+
"blt_ordEr",
4088+
self.blt_order,
4089+
self.time_array,
4090+
self.Ntimes,
4091+
self.Nbls,
4092+
self.Nblts,
4093+
self.blts_are_rectangular,
4094+
)
40864095
# check if object is self-consistent
40874096
if run_check:
40884097
self.check(

0 commit comments

Comments
 (0)