Skip to content

Commit

Permalink
Set convergence in task metadata to indicate overall performance
Browse files Browse the repository at this point in the history
  • Loading branch information
abudlong committed Jan 25, 2025
1 parent f096fbe commit a5c6602
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions python/lsst/drp/tasks/dcr_assemble_coadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ def setDefaults(self):
self.assembleStaticSkyModel.retarget(CompareWarpAssembleCoaddTask)
self.doNImage = True
self.assembleStaticSkyModel.warpType = self.warpType
# The goodSeeingCoadd and nImage files will be overwritten by this Task, so
# don't write them the first time.
# The goodSeeingCoadd and nImage files will be overwritten by this
# Task, so don't write them the first time.
self.assembleStaticSkyModel.doNImage = False
self.assembleStaticSkyModel.doWrite = False
self.detectPsfSources.returnOriginalFootprints = False
Expand Down Expand Up @@ -605,6 +605,14 @@ def run(
skyInfo.bbox.getWidth() / subregionSize[0]
)
subIter = 0

# Calculate the initial convergence metric for the whole patch and add
# to the metadata.
convergenceMetricInitial = self.calculateConvergence(
dcrModels, self.exposure, skyInfo.bbox, warpRefList, weightList, stats.ctrl
)
self.metadata['initialConvergence'] = convergenceMetricInitial

for subBBox in subBBoxIter(skyInfo.bbox, subregionSize):
modelIter = 0
subIter += 1
Expand Down Expand Up @@ -715,6 +723,18 @@ def run(
100 * (convergenceList[0] - convergenceMetric) / convergenceMetric,
)

# Calculate the final convergence metric for the whole patch and add to
# the metadata.
convergenceMetricFinal = self.calculateConvergence(
dcrModels, subExposures, skyInfo.bbox, warpRefList, weightList, stats.ctrl
)
self.metadata['finalConvergence'] = convergenceMetricFinal

# Improvement between inital and final convergence metric for the
# whole patch and add to the metadata.
convergenceMetricImprovement = 100 * (convergenceMetricInitial - convergenceMetricFinal) / convergenceMetricInitial
self.metadata['improvedConvergence'] = convergenceMetricImprovement

dcrCoadds = self.fillCoadd(
dcrModels,
skyInfo,
Expand Down

0 comments on commit a5c6602

Please sign in to comment.