Skip to content

Commit

Permalink
use nanmax instead of max on a masked array
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHancock committed Nov 29, 2021
1 parent c5cd48f commit b6026a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions AegeanTools/source_finder.py
Expand Up @@ -1537,7 +1537,7 @@ def load_globals(
if verb and debug:
self.log.debug(
"Data max is {0}".format(
img.get_pixels()[np.isfinite(img.get_pixels())].max()
np.nanmax(img.get_pixels())
)
)
self.log.debug("Doing background subtraction")
Expand All @@ -1546,7 +1546,7 @@ def load_globals(
if verb and debug:
self.log.debug(
"Data max is {0}".format(
img.get_pixels()[np.isfinite(img.get_pixels())].max()
np.nanmax(img.get_pixels())
)
)

Expand Down Expand Up @@ -1759,9 +1759,9 @@ def _make_bkg_rms(self, filename,
cores=cores,
cube_index=self.global_data.cube_index,
)
if forced_rms is not None:
if forced_rms is None:
self.global_data.rmsimg = rms
if forced_bkg is not None:
if forced_bkg is None:
self.global_data.bkgimg = bkg

return
Expand Down

0 comments on commit b6026a0

Please sign in to comment.