Skip to content

Commit

Permalink
fix(sidereal): revert a change made in 5e74f33
Browse files Browse the repository at this point in the history
This change had the unintended behaviour of masking large RA regions if
even a single baseline was corrupted.
  • Loading branch information
ljgray committed Aug 6, 2024
1 parent c694096 commit 89c6d6c
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions draco/analysis/sidereal.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,12 +641,6 @@ def process(self, sstream: containers.SiderealStream) -> containers.SiderealStre
if not np.any(weight[fi]):
continue

# We need to track the full time mask applied to each
# baseline. Because the `effective_ra` dataset is baseline
# dependent, the gradient could end up producing a slightly
# baseline dependent mask
fmask = np.zeros(weight.shape[-1], dtype=bool)

for vi in range(vis.shape[1]):
# Skip if entire baseline is masked
if not np.any(weight[fi, vi]):
Expand All @@ -667,11 +661,7 @@ def process(self, sstream: containers.SiderealStream) -> containers.SiderealStre
sel = weight[fi, vi] > 0.0
vis[fi, vi] -= grad * sel * (era[fi, vi] - sstream.ra)
# Keep track of the time mask being applied
fmask |= ref_mask

# Zero any weights that could not be corrected for at least
# one baseline
weight[fi] *= (~fmask).astype(weight.dtype)[np.newaxis]
weight[fi, vi] *= (~ref_mask).astype(weight.dtype)

# Delete the effective ra dataset since it is not needed anymore
del sstream["effective_ra"]
Expand Down

0 comments on commit 89c6d6c

Please sign in to comment.