Skip to content

Commit

Permalink
revert 413 and make blank_pixel_value optional, but default to NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Feb 12, 2024
1 parent 1a91216 commit 2440f0c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions reproject/mosaicking/coadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def reproject_and_coadd(
background_reference=None,
output_array=None,
output_footprint=None,
block_sizes=None,
progressbar=False,
blank_pixel_value=np.nan,
**kwargs,
):
"""
Expand Down Expand Up @@ -276,7 +279,7 @@ def reproject_and_coadd(
if combine_function == "mean":
with np.errstate(invalid="ignore"):
output_array /= output_footprint
output_array[output_footprint == 0] = 0
output_array[output_footprint == 0] = blank_pixel_value

elif combine_function in ("first", "last", "min", "max"):
for array in arrays:
Expand Down Expand Up @@ -306,7 +309,6 @@ def reproject_and_coadd(

raise NotImplementedError("combine_function='median' is not yet implemented")

if combine_function in ("min", "max"):
output_array[output_footprint == 0] = 0.0
output_array[output_footprint == 0] = blank_pixel_value

return output_array, output_footprint

0 comments on commit 2440f0c

Please sign in to comment.