Skip to content

Commit

Permalink
Deleted the deprecated parameter, dao_threshold, in
Browse files Browse the repository at this point in the history
astrometric_utils.py/extract_sources(). Removed parameter
from any calling functions.
  • Loading branch information
mdlpstsci committed May 20, 2024
1 parent 1f64115 commit 22925fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ number of the code change for that issue. These PRs can be viewed at:

3.7.1 (unreleased)
======================
- Addressed bugs caught by SonarQube static code analysis. Interface
changes listed here: Removed the deprecated parameter, dao_threshold, from
astrometric_utils.py/extract_sources(). [#nnnn]

- Exclude single filter images from the generation of the total detection
image to minimize cosmic ray contamination, unless there are only single
filter images in the visit. [#1797]
Expand Down
1 change: 0 additions & 1 deletion drizzlepac/haputils/align_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,6 @@ def find_alignment_sources(self, output=True, dqname='DQ', crclean=False,
outroot=outroot,
kernel=self.kernel,
segment_threshold=self.threshold[chip],
dao_threshold=self.bkg_rms_mean[chip],
fwhm=self.kernel_fwhm,
**extract_pars)
if crclean and crmap is not None:
Expand Down
9 changes: 1 addition & 8 deletions drizzlepac/haputils/astrometric_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,7 @@ def build_gaussian_kernel(fwhm, npixels):


def extract_sources(img, dqmask=None, fwhm=3.0, kernel=None, photmode=None,
segment_threshold=None, dao_threshold=None,
dao_nsigma=3.0, source_box=7,
segment_threshold=None, dao_nsigma=3.0, source_box=7,
classify=True, centering_mode="starfind", nlargest=None,
outroot=None, plot=False, vmax=None, deblend=False,
log_level=logutil.logging.INFO):
Expand Down Expand Up @@ -988,10 +987,6 @@ def extract_sources(img, dqmask=None, fwhm=3.0, kernel=None, photmode=None,
segment_threshold : ndarray or None
Value from the image which serves as the limit for determining sources.
If None, compute a default value of (background+5*rms(background)).
dao_threshold : float, optional
[Deprecated] This parameter is not used. In fact, it now gets computed
internally using the ``sigma_clipped_bkg()`` function which uses the
``dao_nsigma`` parameter.
dao_nsigma : float
This number gets used to determine the threshold for detection of point
sources. The threshold gets computed using a simple ``mean + dao_nsigma * rms``,
Expand Down Expand Up @@ -1456,7 +1451,6 @@ def generate_source_catalog(image, dqname="DQ", output=False, fwhm=3.0,

bkg_ra, bkg_median, bkg_rms_ra, bkg_rms_median = compute_2d_background(imgarr, box_size, win_size)
threshold = nsigma * bkg_rms_ra
dao_threshold = nsigma * bkg_rms_median

(kernel, kernel_psf), kernel_fwhm = build_auto_kernel(imgarr - bkg_ra, whtarr,
threshold=threshold,
Expand All @@ -1470,7 +1464,6 @@ def generate_source_catalog(image, dqname="DQ", output=False, fwhm=3.0,
outroot=outroot, kernel=kernel,
photmode=photmode,
segment_threshold=threshold,
dao_threshold=dao_threshold,
fwhm=kernel_fwhm, **detector_pars)
del crmap
source_cats[chip] = seg_tab
Expand Down

0 comments on commit 22925fb

Please sign in to comment.