Skip to content

Commit

Permalink
use diff and comparison with rectangularity calc
Browse files Browse the repository at this point in the history
  • Loading branch information
mkolopanis committed Nov 6, 2023
1 parent 171fe72 commit 90007c1
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pyuvdata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6044,22 +6044,14 @@ def determine_rectangularity(
baseline_array = baseline_array.reshape((nbls, ntimes))
if np.sum(np.abs(np.diff(time_array, axis=0))) != 0:
return False, False
if np.any(
np.logical_not(
np.apply_along_axis(lambda x: np.allclose(x, x[0]), 1, baseline_array)
)
):
if (np.diff(baseline_array, axis=1) != 0).any():
return False, False
return True, True
elif bl_first:
time_array = time_array.reshape((ntimes, nbls))
baseline_array = baseline_array.reshape((ntimes, nbls))
if np.sum(np.abs(np.diff(time_array, axis=1))) != 0:
return False, False
if np.any(
np.logical_not(
np.apply_along_axis(lambda x: np.allclose(x, x[0]), 0, baseline_array)
)
):
if (np.diff(baseline_array, axis=0) != 0).any():
return False, False
return True, False

0 comments on commit 90007c1

Please sign in to comment.