Skip to content

Commit

Permalink
HLA-1222: Drizzlepac - new release candidate v3.7.0rc2 (#1777)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlpstsci authored Mar 22, 2024
1 parent d32118d commit f6cb625
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
===================

Expand Down
16 changes: 6 additions & 10 deletions drizzlepac/haputils/catalog_utils.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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("")
Expand Down

0 comments on commit f6cb625

Please sign in to comment.