diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d6f8f169b..8079203fd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,9 +18,17 @@ number of the code change for that issue. These PRs can be viewed at: https://github.com/spacetelescope/drizzlepac/pulls -3.7.0rc1 (22-Feb-2024) Infrastructure Build +3.7.0rc2 (22-Mar-2024) Infrastructure Build =========================================== +- Force the identified bad rows to be removed from the total (aka white light) + source catalog before the corresponding bad segments are removed from the + segmentation image. [#1771] + +- Improved calculation of S_REGION using dialation and erosion. [#1762] + +- Skycell added to flt(c) and drz(c) science headers for the pipeline and svm products. [#1729] + - Update project.toml file to specify numpy>=1.18, <2.0 [#1743] - Update project.toml file to specify python_requires>=3.10 [#1737] @@ -50,6 +58,7 @@ number of the code change for that issue. These PRs can be viewed at: - Initial setup for Architectural Design Records used to keep track of top-level thinking behind the code. [#1697] + 3.6.2 (27-Nov-2023) =================== diff --git a/drizzlepac/haputils/catalog_utils.py b/drizzlepac/haputils/catalog_utils.py index d19d4a7d9..9861fd398 100755 --- a/drizzlepac/haputils/catalog_utils.py +++ b/drizzlepac/haputils/catalog_utils.py @@ -1,6 +1,5 @@ """This script contains code to support creation of photometric sourcelists using two techniques: aperture photometry and segmentation-map based photometry.""" - import copy import math import sys @@ -1859,20 +1858,13 @@ def identify_sources(self, **pars): # the segmentation image too good_rows = [] good_segm_rows_by_label = [] - bad_segm_rows_by_label = [] updated_table = None for i, old_row in enumerate(total_measurements_table): if np.isfinite(old_row["xcentroid"]): good_rows.append(old_row) good_segm_rows_by_label.append(total_measurements_table['label'][i]) - else: - bad_segm_rows_by_label.append(total_measurements_table['label'][i]) - updated_table = Table(rows=good_rows, names=total_measurements_table.colnames) - if self.diagnostic_mode and bad_segm_rows_by_label: - log.info("Bad segments removed from segmentation image for Total detection image {}.".format(self.imgname)) - # Remove the bad segments from the image - self.segm_img.remove_labels(bad_segm_rows_by_label, relabel=True) + updated_table = Table(rows=good_rows, names=total_measurements_table.colnames) # Need to keep an updated copy of the total image SourceCatalog object for use when # making measurements in the filtered images @@ -1886,7 +1878,11 @@ def identify_sources(self, **pars): # (create_catalog_products()). This is the way the independent catalogs of total and filter products # process the same segmentation image. # BEWARE: self.sources for "segmentation" is a SegmentationImage, but for "point" it is an Astropy table - self.sources = copy.deepcopy(self.segm_img) + # Keep only the good segments from the image + self.segm_img.keep_labels(good_segm_rows_by_label, relabel=True) + + # Make a deep copy of the total "white light" segmentation image + self.sources = self.segm_img.copy() log.info("Done identifying sources in total detection image for the segmentation catalog.") log.info("")