# Copyright (c) 2024 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Tests for baseline redundancy utility functions.""" import copy import re import numpy as np import pytest import pyuvdata.utils.redundancy as red_utils from pyuvdata import UVData, utils from pyuvdata.datasets import fetch_data from pyuvdata.testing import check_warnings @pytest.mark.parametrize("grid_alg", [True, False]) def test_redundancy_finder(grid_alg): """ Check that get_baseline_redundancies and get_antenna_redundancies return consistent redundant groups for a test file with the HERA19 layout. """ uvd = UVData() uvd.read_uvfits(fetch_data("sim_airy_hex")) uvd.select(times=uvd.time_array[0]) uvd.unproject_phase(use_ant_pos=True) # uvw_array is now equivalent to baseline positions uvd.conjugate_bls("ant1