diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6def3d39c..e4fa82909 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -19,8 +19,12 @@ number of the code change for that issue. These PRs can be viewed at: -3.7.1 (unreleased) -===================== +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] - Reverted PR #1222 allowing pixels to be filled with available data where WHT=0. [#1767] @@ -28,10 +32,6 @@ number of the code change for that issue. These PRs can be viewed at: - Skycell added to flt(c) and drz(c) science headers for the pipeline and svm products. [#1729] - -3.7.0rc1 (22-Feb-2024) Infrastructure Build -=========================================== - - Update project.toml file to specify numpy>=1.18, <2.0 [#1743] - Update project.toml file to specify python_requires>=3.10 [#1737] @@ -61,6 +61,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 bb59d10ca..b5e977c86 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 @@ -1874,20 +1873,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 @@ -1901,7 +1893,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("")