Skip to content

Commit

Permalink
slightly safer solution
Browse files Browse the repository at this point in the history
  • Loading branch information
jsdillon committed Oct 24, 2024
1 parent 9db26be commit 7544b60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hera_cal/frf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2097,14 +2097,14 @@ def get_frop_for_noise(times, filter_cent_use, filter_half_wid_use, freqs,
dlst = np.append(dlst, np.zeros(chunk_size - chunk_remainder, dtype=float))

dres = dmatr.reshape(Nchunk, chunk_size, Nmodes)
wres = tavg_weights.reshape(Nchunk, chunk_size, Nfreqs)
wres = tavg_weights.reshape(Nchunk, chunk_size, Nfreqs).astype(complex)
wnorm = wres.sum(axis=1)[:, np.newaxis]
# normalize for an average
wres = np.where(wnorm > 0, wres / wnorm, 0)

# Apply the rephase to the weights matrix since it's mathematically equivalent and convenient
if rephase:
wres = utils.lst_rephase(wres.reshape(Nchunk * chunk_size, 1, Nfreqs).astype(complex),
wres = utils.lst_rephase(wres.reshape(Nchunk * chunk_size, 1, Nfreqs),
bl_vec, freqs, dlst, lat=lat, inplace=False)
wres = wres.reshape(Nchunk, chunk_size, Nfreqs)

Expand Down

0 comments on commit 7544b60

Please sign in to comment.