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

fix: force flagged averaged data to be inf #975

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion hera_cal/lst_stack/averaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,9 +708,13 @@ def average_and_inpaint_simultaneously(
data=auto_stack.data.transpose((1, 0, 2, 3)),
flags=auto_stack.flags.transpose((1, 0, 2, 3)),
nsamples=auto_stack.nsamples.transpose((1, 0, 2, 3)),
get_std=False, get_mad=False, inpainted_mode=False, mean_fill_value=0.0
get_std=False, get_mad=False, inpainted_mode=False, mean_fill_value=np.inf
)

# Something weird happens in reduce_lst_bins due to MaskedArrays, and the flagged
# values don't actually get set to inf properly. We just force it here to be sure.
auto_redavg['data'][auto_redavg['flags']] = np.inf + 0j

# Map antenna polarizations to visibility pol indices for correct noise variance computation
# even for cross-polarized visibilities, which use the auto-polarized autocorrelations.
antpol_to_vispol_idx = {}
Expand Down
Loading