Skip to content

Commit

Permalink
test: catch erfa warnings if emitted?
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-murray committed Jul 9, 2024
1 parent 13b9df2 commit 871358f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions hera_qm/tests/test_vis_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import copy
import pytest
import warnings
from erfa.core import ErfaWarning

pytestmark = pytest.mark.filterwarnings(
"ignore:The uvw_array does not match the expected values given the antenna positions.",
)

@pytest.fixture(scope='function')
@pytest.mark.filterwarnings("ignore:ERFA function")
def vismetrics_data():
data = UVData()
filename = os.path.join(DATA_PATH, 'zen.2457698.40355.xx.HH.uvcAA')
Expand All @@ -26,10 +26,12 @@ def vismetrics_data():
data.select(antenna_nums=data.get_ants()[0:10])
data.select(freq_chans=range(100))
# Data file only has three times... need more.
while data.Ntimes < 90:
d2 = copy.deepcopy(data)
d2.time_array += d2.time_array.max() + d2.integration_time / (24 * 3600)
data += d2
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=ErfaWarning)
while data.Ntimes < 90:
d2 = copy.deepcopy(data)
d2.time_array += d2.time_array.max() + d2.integration_time / (24 * 3600)
data += d2
ntimes = data.Ntimes
nchan = data.Nfreqs
data1 = qmtest.noise(size=(ntimes, nchan))
Expand Down

0 comments on commit 871358f

Please sign in to comment.