Skip to content

Commit

Permalink
Merge branch 'tickets/DM-28457'
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Jan 29, 2021
2 parents fd72ab2 + 46f262f commit d1f92d1
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions python/lsst/cp/pipe/cpCombine.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class CalibStatsConfig(pexConfig.Config):
"""Parameters controlling the measurement of background statistics.
"""
stat = pexConfig.Field(
dtype=int,
default=int(afwMath.MEANCLIP),
doc="Statistic to use to estimate background (from lsst.afw.math)",
dtype=str,
default='MEANCLIP',
doc="Statistic name to use to estimate background (from lsst.afw.math)",
)
clip = pexConfig.Field(
dtype=float,
Expand Down Expand Up @@ -88,8 +88,8 @@ def run(self, exposureOrImage):
image = exposureOrImage.getImage()
except Exception:
image = exposureOrImage

return afwMath.makeStatistics(image, self.config.stat, stats).getValue()
statType = afwMath.stringToStatisticsProperty(self.config.stat)
return afwMath.makeStatistics(image, statType, stats).getValue()


class CalibCombineConnections(pipeBase.PipelineTaskConnections,
Expand Down Expand Up @@ -201,9 +201,9 @@ class CalibCombineConfig(pipeBase.PipelineTaskConfig,
doc="Mask planes to respect",
)
combine = pexConfig.Field(
dtype=int,
default=int(afwMath.MEANCLIP),
doc="Statistic to use for combination (from lsst.afw.math)",
dtype=str,
default='MEANCLIP',
doc="Statistic name to use for combination (from lsst.afw.math)",
)
clip = pexConfig.Field(
dtype=float,
Expand Down Expand Up @@ -422,7 +422,8 @@ def combine(self, target, expList, stats):
Control explaining how to combine the input images.
"""
images = [img.getMaskedImage() for img in expList if img is not None]
afwMath.statisticsStack(target, images, afwMath.Property(self.config.combine), stats)
combineType = afwMath.stringToStatisticsProperty(self.config.combine)
afwMath.statisticsStack(target, images, combineType, stats)

def combineHeaders(self, expList, calib, calibType="CALIB", scales=None):
"""Combine input headers to determine the set of common headers,
Expand Down

0 comments on commit d1f92d1

Please sign in to comment.