Skip to content

Commit

Permalink
Fix problem defining masks for use in point catalog generation (#850)
Browse files Browse the repository at this point in the history
* Fix problem defining masks for use in point catalog generation

* Remove un-used wht_scale computation
  • Loading branch information
stsci-hack authored Oct 29, 2020
1 parent ed0bded commit d064e2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions drizzlepac/haputils/catalog_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def __init__(self, image, param_dict, param_dict_qc, diagnostic_mode, tp_sources
self.tp_sources = tp_sources

# create mask to reject any sources located less than 10 pixels from a image/chip edge
wht_image = self.image.data.copy()
wht_image = np.nan_to_num(self.image.data, 0.0)
binary_inverted_wht = np.where(wht_image == 0, 1, 0)
self.exclusion_mask = ndimage.binary_dilation(binary_inverted_wht, iterations=10)

Expand Down Expand Up @@ -839,8 +839,7 @@ def identify_sources(self, **pars):
# Compute separate threshold for each 'region'
reg_rms = self.image.bkg_rms_ra * np.sqrt(mask['mask'] / mask['rel_weight'].max())
reg_rms_median = np.nanmedian(reg_rms[reg_rms > 0])
wht_scale = np.nanmedian(np.sqrt(mask['mask'] / mask['rel_weight'].max()))
log.info("Mask {}: rel = {}, wht_scale = {}".format(mask['wht_limit'], mask['rel_weight'].max(), wht_scale))
log.info("Mask {}: rel = {}".format(mask['wht_limit'], mask['rel_weight'].max()))

# find ALL the sources!!!
if self.param_dict["starfinder_algorithm"] == "dao":
Expand Down
2 changes: 1 addition & 1 deletion drizzlepac/haputils/quality_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def run_all(input, files, catalogs=None, log_level=logutil.logging.NOTSET):

if catalogs is not None:
try:
if not 'json_files' in locals(): # create empty list if there's an exception thrown by determine_alignment_residuals
if not 'json_files' in locals(): # create empty list if there's an exception thrown by determine_alignment_residuals
json_files = []
gaia_files = determine_gaia_residuals(catalogs,
json_timestamp=json_timestamp,
Expand Down

0 comments on commit d064e2a

Please sign in to comment.