Skip to content

Commit

Permalink
add an if block, but I probably have to undo this
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Jan 30, 2024
1 parent 07c50a5 commit 6b0c1c6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions reproject/mosaicking/coadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,15 @@ def reproject_and_coadd(
output_array[...] = -np.inf

if combine_function in ("mean", "sum"):
for array in arrays:
# By default, values outside of the footprint are set to NaN
# but we set these to 0 here to avoid getting NaNs in the
# means/sums.
array.array[array.footprint == 0] = 0
if match_background:
for array in arrays:
# By default, values outside of the footprint are set to NaN
# but we set these to 0 here to avoid getting NaNs in the
# means/sums.
array.array[array.footprint == 0] = 0

output_array[array.view_in_original_array] += array.array * array.footprint
output_footprint[array.view_in_original_array] += array.footprint
output_array[array.view_in_original_array] += array.array * array.footprint
output_footprint[array.view_in_original_array] += array.footprint

if combine_function == "mean":
with np.errstate(invalid="ignore"):
Expand Down

0 comments on commit 6b0c1c6

Please sign in to comment.