Skip to content

Commit

Permalink
SDSS centroid error fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
parejkoj committed Mar 22, 2024
1 parent 0e68b33 commit bbc52cc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/lsst/ip/diffim/dipoleFitTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ def _setupSchema(self, config, name, schema, metadata):
self.centroidKey = measBase.CentroidResultKey.addFields(schema,
name,
"Dipole centroid position.",
measBase.UncertaintyEnum.NO_UNCERTAINTY)
measBase.UncertaintyEnum.SIGMA_ONLY)

self.orientationKey = schema.addField(
schema.join(name, "orientation"), type=float, units="deg",
Expand Down Expand Up @@ -1115,6 +1115,10 @@ def measureDipoles(self, measRecord, exposure, posExp=None, negExp=None):
if not self.config.fitAllDiaSources:
measRecord[self.centroidKey.getX()] = measRecord["base_SdssCentroid_x"]
measRecord[self.centroidKey.getY()] = measRecord["base_SdssCentroid_y"]
self.centroidKey.getCentroidErr().setElement(measRecord, 0, 0,
measRecord["base_SdssCentroid_xErr"])
self.centroidKey.getCentroidErr().setElement(measRecord, 1, 1,
measRecord["base_SdssCentroid_yErr"])
measRecord[self.flagKey] = measRecord["base_SdssCentroid_flag"]
return

Expand Down Expand Up @@ -1235,6 +1239,10 @@ def fail(self, measRecord, error=None):
"""
measRecord[self.centroidKey.getX()] = measRecord["base_SdssCentroid_x"]
measRecord[self.centroidKey.getY()] = measRecord["base_SdssCentroid_y"]
self.centroidKey.getCentroidErr().setElement(measRecord, 0, 0,
measRecord["base_SdssCentroid_xErr"])
self.centroidKey.getCentroidErr().setElement(measRecord, 1, 1,
measRecord["base_SdssCentroid_yErr"])
measRecord.set(self.flagKey, True)
if error is not None:
if error.getFlagBit() == self.FAILURE_EDGE:
Expand Down

0 comments on commit bbc52cc

Please sign in to comment.