Skip to content

Commit

Permalink
set placeholder for blendCentroid in cutOutDonutsBase
Browse files Browse the repository at this point in the history
  • Loading branch information
suberlak committed Feb 1, 2025
1 parent 25aaa96 commit 584f2d8
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions python/lsst/ts/wep/task/cutOutDonutsBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,13 @@ def cutOutStamps(self, exposure, donutCatalog, defocalType, cameraName):
# Save MaskedImage to stamp
finalStamp = finalCutout.getMaskedImage()

# Save centroid positions as str so we can store in header
blendStrX = ""
blendStrY = ""
# Set that as default, unless overwritten
blendCentroidPositions = np.array([["nan"], ["nan"]], dtype=float).T

if len(catalogMeta["blend_centroid_x"]) > 0:
# Save centroid positions as str so we can store in header
blendStrX = ""
blendStrY = ""
for blend_cx, blend_cy in zip(
catalogMeta["blend_centroid_x"][idx],
catalogMeta["blend_centroid_y"][idx],
Expand All @@ -630,19 +633,15 @@ def cutOutStamps(self, exposure, donutCatalog, defocalType, cameraName):
finalBlendXList.append(blendStrX)
finalBlendYList.append(blendStrY)

# Prepare blend centroid position information
if len(catalogMeta["blend_centroid_x"]) > 0:
# Prepare blend centroid position information
if len(catalogMeta["blend_centroid_x"][idx]) > 0:
blendCentroidPositions = np.array(
[
catalogMeta["blend_centroid_x"][idx] + donutRow["xShift"],
catalogMeta["blend_centroid_y"][idx] + donutRow["yShift"],
]
).T
else:
blendCentroidPositions = np.array([["nan"], ["nan"]], dtype=float).T
else:
blendCentroidPositions = np.array([["nan"], ["nan"]], dtype=float).T

# Get the local linear WCS for the donut stamp
# Be careful to get the cd matrix from the linearized WCS instead
# of the one from the full WCS.
Expand Down

0 comments on commit 584f2d8

Please sign in to comment.