From 569355a52bba1c87927d3f0636537f17c901e235 Mon Sep 17 00:00:00 2001 From: Clare Shanahan Date: Mon, 20 Mar 2023 23:47:20 -0400 Subject: [PATCH] review comments --- docs/roman/source_detection/arguments.rst | 16 +++++++++------- docs/roman/source_detection/description.rst | 7 ------- .../source_detection/source_detection_step.py | 19 ++++++++++--------- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/docs/roman/source_detection/arguments.rst b/docs/roman/source_detection/arguments.rst index aebf1f855..edffce08e 100644 --- a/docs/roman/source_detection/arguments.rst +++ b/docs/roman/source_detection/arguments.rst @@ -4,8 +4,6 @@ The source detection fitting step has several arguments. These can be specified by the user by passing them to the step in a Python session, or setting them in a parameter file. -* ``--coverage_mask``: True/False to mask pixels with DO_NOT_USE flags in their - dq array. Default is True. * ``--kernel_fwhm``: A parameter for DAOStarFinder: size of Gaussian kernel in pixels. Default is 2.0. * ``--sharplo``: A parameter for DAOStarFinder: lower bound for sharpness. @@ -13,17 +11,21 @@ in a parameter file. * ``--sharphi``: A parameter for DAOStarFinder: upper bound for sharpness. Default is 1.0. * ``--roundlo``: A parameter for DAOStarFinder: lower bound for roundness. - Default is -1.0. + Default is -1.0. A circular source will have a zero roundness. + A source extended in x or y will have a negative or positive + roundness, respectively. * ``--roundhi``: A parameter for DAOStarFinder: upper bound for roundness. - Default is 1.0. + Default is 1.0. A circular source will have a zero roundness. + A source extended in x or y will have a negative or positive + roundness, respectively. * ``--peakmax``: A parameter for DAOStarFinder: upper limit on brightest pixel in sources. Default is 1000.0. * ``--max_sources``: The maximum number of sources in the output catalog, choosing brightest. Default is None, which will return all detected sources. -* ``--scalar_threshold``: If specified, a single scalar threshold to be used - for source detection with DAOStarFinder across the - entire image. One of `scalar_threshold`, +* ``--scalar_threshold``: If specified, the absolute detection threshold to be + used for the entire image. Units are assumed to be the + same as input data. One of `scalar_threshold`, `calc_scalar_threshold` must be chosen. Default is None. * ``--calc_scalar_threshold``: If specified, a single scalar threshold will be diff --git a/docs/roman/source_detection/description.rst b/docs/roman/source_detection/description.rst index e1d08fb8d..2f9dfb95a 100644 --- a/docs/roman/source_detection/description.rst +++ b/docs/roman/source_detection/description.rst @@ -46,13 +46,6 @@ threshold value for the entire image based on the sigma-clipped average Other Options ============= -Masking DO_NOT_USE pixels -------------------------- - -By default, sources that fall on pixels with DO_NOT_USE in their DQ array -will be excluded from the final output catalog. This can be controlled with -the `coverage_mask` parameter. - Limiting maximum number of sources ---------------------------------- diff --git a/romancal/source_detection/source_detection_step.py b/romancal/source_detection/source_detection_step.py index dd479fc00..12966848a 100644 --- a/romancal/source_detection/source_detection_step.py +++ b/romancal/source_detection/source_detection_step.py @@ -34,12 +34,13 @@ class SourceDetectionStep(RomanStep): """ spec = """ - coverage_mask = boolean(default=True) # Mask DO_NOT_USE pixels in image? kernel_fwhm = float(default=2.) # DAOStarFinder:Size of Gaussian kernel, # in pixels. sharplo = float(default=0.) # DAOStarFinder: Lower bound for sharpness. sharphi = float(default=1.0) # DAOStarFinder: Upper bound for sharpness. roundlo = float(default=-1.0) # DAOStarFinder: Lower bound for roundness. + # A circular source will have a zero roundness. A source extended in x or + # y will have a negative or positive roundness, respectively. roundhi = float(default=1.0) # DAOStarFinder: Upper bound for roundness. peakmax = float(default=1000.0) # Upper limit on brightest pixel in sources. max_sources = float(default=None) # Max number of sources, choosing brightest. @@ -75,13 +76,12 @@ def process(self, input): else: self.data = input_model.data - # mask DO_NOT_USE pixels? - if self.coverage_mask: - self.coverage_mask = ( - (dqflags.pixel["DO_NOT_USE"]) & input_model.dq - ).astype(bool) - else: - self.coverage_mask = None + # mask DO_NOT_USE pixels + + self.coverage_mask = ( + (dqflags.pixel["DO_NOT_USE"]) & input_model.dq + ).astype(bool) + # if a pre-determined threshold value for detection for the whole # image is provided, use this @@ -118,7 +118,8 @@ def process(self, input): elif self.calc_threshold is not None: # subtrack background from data if calculating abs. threshold - sources = daofind(self.data - bkg.background, mask=self.coverage_mask) + sources = daofind(self.data - bkg.background, + mask=self.coverage_mask) # reduce table to minimal number of columns, just source ID, # positions, and fluxes