Skip to content

Commit

Permalink
test: modzscore for complex arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-murray committed Feb 14, 2024
1 parent 578160f commit 695e64e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hera_qm/tests/test_xrfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2771,3 +2771,14 @@ def test_xrfi_h3c_idr2_1_run(tmp_path, uvcal_calfits):
uvf = UVFlag(str(out), use_future_array_shapes=True)
assert uvf.label == label
shutil.rmtree(outdir) # cleanup

@pytest.mark.parametrize("detrend", [False, True])
def test_modzscore_complex(detrend):
rng = np.random.default_rng(12)
data = rng.standard_normal(100) + 1j * rng.standard_normal(100)

zscore = xrfi.modzscore_1d(data, detrend = detrend)
assert np.iscomplexobj(zscore)
assert np.isclose(np.mean(zscore.real), 0, atol=1e-1)
assert np.isclose(np.mean(zscore.imag), 0, atol=1e-1)

0 comments on commit 695e64e

Please sign in to comment.