Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FRF noise covariance calculation library #977

Merged
merged 16 commits into from
Oct 16, 2024
Prev Previous commit
Next Next commit
Add uniform weights section
Mike Wilensky committed Oct 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 43a28bb5756860c636838dd240d4dd2997a59800
19 changes: 19 additions & 0 deletions hera_cal/tests/test_frf.py
Original file line number Diff line number Diff line change
@@ -1146,6 +1146,25 @@ def test_get_frop_for_noise():
verbose=False)[0]

assert np.allclose(avg_data, frf_dat)

# Test uniform weights
weights = np.ones_like(data[bl])
frop = frf.get_frop_for_noise(times, filt_cent, filt_hw,
freqs=data.freqs, weights=weights,
coherent_avg=False, cutoff=eval_cutoff)
d_mdl, _, _ = dspec.fourier_filter(times, data[bl],
wgts=weights,
filter_centers=[filt_cent],
filter_half_widths=[filt_hw],
mode='dpss_solve',
eigenval_cutoff=[eval_cutoff],
suppression_factors=[eval_cutoff],
max_contiguous_edge_flags=len(data.times),
filter_dims=0)
frf_dat_pipeline[bl] = d_mdl
frf_dat = (frop * data[bl]).sum(axis=1)
assert np.allclose(frf_dat_pipeline[bl], frf_dat)