Skip to content

Commit

Permalink
Include a minimum RMS value for the SBC detector as there is often
Browse files Browse the repository at this point in the history
a lot of noise in the catalogs due to a low detection threshold.
  • Loading branch information
mdlpstsci committed Nov 21, 2024
1 parent 9e809c4 commit 8f33148
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drizzlepac/haputils/catalog_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,15 @@ def compute_background(self, box_size, win_size,
is_zero_background_defined = True
log.info(f"Input image contains excessive zero values in the background. Median: {self.bkg_median:.6f} RMS: {self.bkg_rms_median:.6f}")

# Compute a minimum rms value based upon information directly from the data
minimum_rms = 1.0 / self.keyword_dict['texpo_time']
if np.nan_to_num(self.bkg_rms_median) < minimum_rms:
self.bkg_rms_median = minimum_rms
log.info("")
log.info(f"Minimum RMS of input based upon the total exposure time: {minimum_rms:.6f}")
log.info(f"Median RMS has been updated - Median: {self.bkg_median:.6f} RMS: {self.bkg_rms_median:.6f}")
log.info("")

Check warning on line 299 in drizzlepac/haputils/catalog_utils.py

View check run for this annotation

Codecov / codecov/patch

drizzlepac/haputils/catalog_utils.py#L295-L299

Added lines #L295 - L299 were not covered by tests

# BACKGROUND COMPUTATION 2 (sigma_clipped_stats)
# If the input data is not the unusual case of SBC "excessive zero background", compute
# a sigma-clipped background which returns only single values for mean,
Expand Down

0 comments on commit 8f33148

Please sign in to comment.