Skip to content

Commit 318763b

Browse files
committed
add an if block, but I probably have to undo this
1 parent ad9b7f9 commit 318763b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

reproject/mosaicking/coadd.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,15 @@ def reproject_and_coadd(
323323
output_array[...] = -np.inf
324324

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

332-
output_array[array.view_in_original_array] += array.array * array.footprint
333-
output_footprint[array.view_in_original_array] += array.footprint
333+
output_array[array.view_in_original_array] += array.array * array.footprint
334+
output_footprint[array.view_in_original_array] += array.footprint
334335

335336
if combine_function == "mean":
336337
with np.errstate(invalid="ignore"):

0 commit comments

Comments
 (0)