Skip to content

Commit

Permalink
fix: remove one warning that we should expect
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-murray committed Jul 16, 2024
1 parent b79405e commit 116cb75
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions hera_cal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,16 @@ def fft_dly(data, df, wgts=None, f0=0.0, medfilt=False, kernel=(1, 11), edge_cut
# Now that we know the slope, estimate the remaining phase offset
freqs = np.arange(Nfreqs, dtype=data.dtype) * df + f0
fSlice = slice(edge_cut, len(freqs) - edge_cut)
offset = np.angle(
np.sum(
wgts[:, fSlice] * data[:, fSlice] * np.exp(
-np.complex64(2j * np.pi) * dlys * freqs[fSlice].reshape(1, -1)
),
axis=1, keepdims=True
) / np.sum(wgts[:, fSlice], axis=1, keepdims=True)
)
with warnings.catch_warnings():
warnings.filterwarnings('ignore', 'invalid value encountered in divide')
offset = np.angle(
np.sum(
wgts[:, fSlice] * data[:, fSlice] * np.exp(
-np.complex64(2j * np.pi) * dlys * freqs[fSlice].reshape(1, -1)
),
axis=1, keepdims=True
) / np.sum(wgts[:, fSlice], axis=1, keepdims=True)
)

return dlys, offset

Expand Down

0 comments on commit 116cb75

Please sign in to comment.