22"""Definition of measurement plugins.
24This module defines and registers a series of pure-Python measurement plugins
25which have trivial implementations. It also wraps measurement algorithms
26defined in C++ to expose them to the measurement framework.
36from ._measBaseLib
import (ApertureFluxControl, ApertureFluxTransform,
37 BaseTransform, BlendednessAlgorithm,
38 BlendednessControl, CircularApertureFluxAlgorithm,
39 GaussianFluxAlgorithm, GaussianFluxControl,
40 GaussianFluxTransform, LocalBackgroundAlgorithm,
41 LocalBackgroundControl, LocalBackgroundTransform,
42 MeasurementError, NaiveCentroidAlgorithm,
43 NaiveCentroidControl, NaiveCentroidTransform,
44 PeakLikelihoodFluxAlgorithm,
45 PeakLikelihoodFluxControl,
46 PeakLikelihoodFluxTransform, PixelFlagsAlgorithm,
47 PixelFlagsControl, PsfFluxAlgorithm, PsfFluxControl,
48 PsfFluxTransform, ScaledApertureFluxAlgorithm,
49 ScaledApertureFluxControl,
50 ScaledApertureFluxTransform, SdssCentroidAlgorithm,
51 SdssCentroidControl, SdssCentroidTransform,
52 SdssShapeAlgorithm, SdssShapeControl,
54from .baseMeasurement
import BaseMeasurementPluginConfig
55from .forcedMeasurement
import ForcedPlugin, ForcedPluginConfig
56from .pluginRegistry
import register
57from .pluginsBase
import BasePlugin
58from .sfm
import SingleFramePlugin, SingleFramePluginConfig
59from .transforms
import SimpleCentroidTransform
60from .wrappers
import GenericPlugin, wrapSimpleAlgorithm, wrapTransform
63 "SingleFrameFPPositionConfig",
"SingleFrameFPPositionPlugin",
64 "SingleFrameJacobianConfig",
"SingleFrameJacobianPlugin",
65 "VarianceConfig",
"SingleFrameVariancePlugin",
"ForcedVariancePlugin",
66 "InputCountConfig",
"SingleFrameInputCountPlugin",
"ForcedInputCountPlugin",
67 "SingleFramePeakCentroidConfig",
"SingleFramePeakCentroidPlugin",
68 "SingleFrameSkyCoordConfig",
"SingleFrameSkyCoordPlugin",
69 "ForcedPeakCentroidConfig",
"ForcedPeakCentroidPlugin",
70 "ForcedTransformedCentroidConfig",
"ForcedTransformedCentroidPlugin",
71 "ForcedTransformedCentroidFromCoordConfig",
72 "ForcedTransformedCentroidFromCoordPlugin",
73 "ForcedTransformedShapeConfig",
"ForcedTransformedShapePlugin",
74 "EvaluateLocalPhotoCalibPlugin",
"EvaluateLocalPhotoCalibPluginConfig",
75 "EvaluateLocalWcsPlugin",
"EvaluateLocalWcsPluginConfig",
79wrapSimpleAlgorithm(PsfFluxAlgorithm, Control=PsfFluxControl,
80 TransformClass=PsfFluxTransform, executionOrder=BasePlugin.FLUX_ORDER,
81 shouldApCorr=
True, hasLogName=
True)
82wrapSimpleAlgorithm(PeakLikelihoodFluxAlgorithm, Control=PeakLikelihoodFluxControl,
83 TransformClass=PeakLikelihoodFluxTransform, executionOrder=BasePlugin.FLUX_ORDER)
84wrapSimpleAlgorithm(GaussianFluxAlgorithm, Control=GaussianFluxControl,
85 TransformClass=GaussianFluxTransform, executionOrder=BasePlugin.FLUX_ORDER,
87wrapSimpleAlgorithm(NaiveCentroidAlgorithm, Control=NaiveCentroidControl,
88 TransformClass=NaiveCentroidTransform, executionOrder=BasePlugin.CENTROID_ORDER)
89wrapSimpleAlgorithm(SdssCentroidAlgorithm, Control=SdssCentroidControl,
90 TransformClass=SdssCentroidTransform, executionOrder=BasePlugin.CENTROID_ORDER)
91wrapSimpleAlgorithm(PixelFlagsAlgorithm, Control=PixelFlagsControl,
92 executionOrder=BasePlugin.FLUX_ORDER)
93wrapSimpleAlgorithm(SdssShapeAlgorithm, Control=SdssShapeControl,
94 TransformClass=SdssShapeTransform, executionOrder=BasePlugin.SHAPE_ORDER)
95wrapSimpleAlgorithm(ScaledApertureFluxAlgorithm, Control=ScaledApertureFluxControl,
96 TransformClass=ScaledApertureFluxTransform, executionOrder=BasePlugin.FLUX_ORDER)
98wrapSimpleAlgorithm(CircularApertureFluxAlgorithm, needsMetadata=
True, Control=ApertureFluxControl,
99 TransformClass=ApertureFluxTransform, executionOrder=BasePlugin.FLUX_ORDER)
100wrapSimpleAlgorithm(BlendednessAlgorithm, Control=BlendednessControl,
101 TransformClass=BaseTransform, executionOrder=BasePlugin.SHAPE_ORDER)
103wrapSimpleAlgorithm(LocalBackgroundAlgorithm, Control=LocalBackgroundControl,
104 TransformClass=LocalBackgroundTransform, executionOrder=BasePlugin.FLUX_ORDER)
106wrapTransform(PsfFluxTransform)
107wrapTransform(PeakLikelihoodFluxTransform)
108wrapTransform(GaussianFluxTransform)
109wrapTransform(NaiveCentroidTransform)
110wrapTransform(SdssCentroidTransform)
111wrapTransform(SdssShapeTransform)
112wrapTransform(ScaledApertureFluxTransform)
113wrapTransform(ApertureFluxTransform)
114wrapTransform(LocalBackgroundTransform)
118 """Configuration for the focal plane position measurment algorithm.
124@register("base_FPPosition")
126 """Algorithm to calculate the position of a centroid on the focal plane.
130 config : `SingleFrameFPPositionConfig`
135 The schema for the measurement output catalog. New fields will be
136 added to hold measurements produced by this plugin.
138 Plugin metadata that will be attached to the output catalog
141 ConfigClass = SingleFrameFPPositionConfig
147 def __init__(self, config, name, schema, metadata):
148 SingleFramePlugin.__init__(self, config, name, schema, metadata)
149 self.
focalValue = lsst.afw.table.Point2DKey.addFields(schema, name,
"Position on the focal plane",
151 self.
focalFlag = schema.addField(name +
"_flag", type=
"Flag", doc=
"Set to True for any fatal failure")
152 self.
detectorFlag = schema.addField(name +
"_missingDetector_flag", type=
"Flag",
153 doc=
"Set to True if detector object is missing")
156 det = exposure.getDetector()
161 center = measRecord.getCentroid()
162 fp = det.transform(center, lsst.afw.cameraGeom.PIXELS, lsst.afw.cameraGeom.FOCAL_PLANE)
165 def fail(self, measRecord, error=None):
170 """Configuration for the Jacobian calculation plugin.
173 pixelScale = lsst.pex.config.Field(dtype=float, default=0.5, doc="Nominal pixel size (arcsec)")
176@register("base_Jacobian")
178 """Compute the Jacobian and its ratio with a nominal pixel area.
180 This enables one to compare relative, rather than absolute, pixel areas.
184 config : `SingleFrameJacobianConfig`
189 The schema for the measurement output catalog. New fields will be
190 added to hold measurements produced by this plugin.
192 Plugin metadata that will be attached to the output catalog
195 ConfigClass = SingleFrameJacobianConfig
201 def __init__(self, config, name, schema, metadata):
202 SingleFramePlugin.__init__(self, config, name, schema, metadata)
203 self.
jacValue = schema.addField(name +
'_value', type=
"D", doc=
"Jacobian correction")
204 self.
jacFlag = schema.addField(name +
'_flag', type=
"Flag", doc=
"Set to 1 for any fatal failure")
209 center = measRecord.getCentroid()
212 result = np.abs(self.
scale*exposure.getWcs().linearizePixelToSky(
214 lsst.geom.arcseconds).getLinear().computeDeterminant())
215 measRecord.set(self.
jacValue, result)
217 def fail(self, measRecord, error=None):
218 measRecord.set(self.
jacFlag,
True)
222 """Configuration for the variance calculation plugin.
224 scale = lsst.pex.config.Field(dtype=float, default=5.0, optional=True,
225 doc=
"Scale factor to apply to shape for aperture")
226 mask = lsst.pex.config.ListField(doc=
"Mask planes to ignore", dtype=str,
227 default=[
"DETECTED",
"DETECTED_NEGATIVE",
"BAD",
"SAT"])
231 """Compute the median variance corresponding to a footprint.
233 The aim here is to measure the background variance, rather than that of
234 the object itself. In order to achieve this, the variance
is calculated
235 over an area scaled up
from the shape of the input footprint.
239 config : `VarianceConfig`
244 The schema
for the measurement output catalog. New fields will be
245 added to hold measurements produced by this plugin.
247 Plugin metadata that will be attached to the output catalog
250 ConfigClass = VarianceConfig
252 FAILURE_BAD_CENTROID = 1
253 """Denotes failures due to bad centroiding (`int`).
256 FAILURE_EMPTY_FOOTPRINT = 2
257 """Denotes failures due to a lack of usable pixels (`int`).
262 return BasePlugin.FLUX_ORDER
264 def __init__(self, config, name, schema, metadata):
265 GenericPlugin.__init__(self, config, name, schema, metadata)
266 self.
varValue = schema.addField(name +
'_value', type=
"D", doc=
"Variance at object position")
268 doc=
"Set to True when the footprint has no usable pixels")
273 schema.getAliasMap().set(name +
'_flag_badCentroid', schema.getAliasMap().apply(
"slot_Centroid_flag"))
275 def measure(self, measRecord, exposure, center):
279 if not np.all(np.isfinite(measRecord.getCentroid())):
281 aperture = lsst.afw.geom.Ellipse(measRecord.getShape(), measRecord.getCentroid())
282 aperture.scale(self.
config.scale)
285 foot.clipTo(exposure.getBBox(lsst.afw.image.PARENT))
288 maskedImage = exposure.getMaskedImage()
290 maskBits = maskedImage.getMask().getPlaneBitMask(self.
config.mask)
291 logicalMask = np.logical_not(pixels.getMaskArray() & maskBits)
296 if np.any(logicalMask):
297 medVar = np.median(pixels.getVarianceArray()[logicalMask])
298 measRecord.set(self.
varValue, medVar)
300 raise MeasurementError(
"Footprint empty, or all pixels are masked, can't compute median",
303 def fail(self, measRecord, error=None):
306 if isinstance(error, MeasurementError):
311 measRecord.set(self.
varValue, np.nan)
312 GenericPlugin.fail(self, measRecord, error)
315SingleFrameVariancePlugin = VariancePlugin.makeSingleFramePlugin(
"base_Variance")
316"""Single-frame version of `VariancePlugin`.
319ForcedVariancePlugin = VariancePlugin.makeForcedPlugin(
"base_Variance")
320"""Forced version of `VariancePlugin`.
325 """Configuration for the input image counting plugin.
331 """Count the number of input images which contributed to a a source.
335 config : `InputCountConfig`
340 The schema for the measurement output catalog. New fields will be
341 added to hold measurements produced by this plugin.
343 Plugin metadata that will be attached to the output catalog
347 Information
is derived
from the image
's `~lsst.afw.image.CoaddInputs`.
348 Note these limitation:
350 - This records the number of images which contributed to the pixel in the
351 center of the source footprint, rather than to any
or all pixels
in the
353 - Clipping
in the coadd
is not taken into account.
356 ConfigClass = InputCountConfig
358 FAILURE_BAD_CENTROID = 1
359 """Denotes failures due to bad centroiding (`int`).
362 FAILURE_NO_INPUTS = 2
363 """Denotes failures due to the image not having coadd inputs. (`int`)
368 return BasePlugin.SHAPE_ORDER
370 def __init__(self, config, name, schema, metadata):
371 GenericPlugin.__init__(self, config, name, schema, metadata)
372 self.
numberKey = schema.addField(name +
'_value', type=
"I",
373 doc=
"Number of images contributing at center, not including any"
375 self.
noInputsFlag = schema.addField(name +
'_flag_noInputs', type=
"Flag",
376 doc=
"No coadd inputs available")
379 schema.getAliasMap().set(name +
'_flag_badCentroid', schema.getAliasMap().apply(
"slot_Centroid_flag"))
381 def measure(self, measRecord, exposure, center):
382 if not exposure.getInfo().getCoaddInputs():
384 if not np.all(np.isfinite(center)):
387 ccds = exposure.getInfo().getCoaddInputs().ccds
388 measRecord.set(self.
numberKey, len(ccds.subsetContaining(center, exposure.getWcs())))
390 def fail(self, measRecord, error=None):
391 if error
is not None:
396 GenericPlugin.fail(self, measRecord, error)
399SingleFrameInputCountPlugin = InputCountPlugin.makeSingleFramePlugin(
"base_InputCount")
400"""Single-frame version of `InputCoutPlugin`.
403ForcedInputCountPlugin = InputCountPlugin.makeForcedPlugin(
"base_InputCount")
404"""Forced version of `InputCoutPlugin`.
409 """Configuration for the variance calculation plugin.
415 """Evaluate the local value of the Photometric Calibration in the exposure.
417 The aim is to store the local calib value within the catalog
for later
418 use
in the Science Data Model functors.
420 ConfigClass = EvaluateLocalPhotoCalibPluginConfig
424 return BasePlugin.FLUX_ORDER
426 def __init__(self, config, name, schema, metadata):
427 GenericPlugin.__init__(self, config, name, schema, metadata)
431 doc=
"Local approximation of the PhotoCalib calibration factor at "
432 "the location of the src.")
436 doc=
"Error on the local approximation of the PhotoCalib "
437 "calibration factor at the location of the src.")
439 def measure(self, measRecord, exposure, center):
441 photoCalib = exposure.getPhotoCalib()
442 calib = photoCalib.getLocalCalibration(center)
443 measRecord.set(self.
photoKey, calib)
445 calibErr = photoCalib.getCalibrationErr()
449SingleFrameEvaluateLocalPhotoCalibPlugin = EvaluateLocalPhotoCalibPlugin.makeSingleFramePlugin(
450 "base_LocalPhotoCalib")
451"""Single-frame version of `EvaluatePhotoCalibPlugin`.
454ForcedEvaluateLocalPhotoCalibPlugin = EvaluateLocalPhotoCalibPlugin.makeForcedPlugin(
455 "base_LocalPhotoCalib")
456"""Forced version of `EvaluatePhotoCalibPlugin`.
461 """Configuration for the variance calculation plugin.
467 """Evaluate the local, linear approximation of the Wcs.
469 The aim is to store the local calib value within the catalog
for later
470 use
in the Science Data Model functors.
472 ConfigClass = EvaluateLocalWcsPluginConfig
473 _scale = (1.0 * lsst.geom.arcseconds).asDegrees()
477 return BasePlugin.FLUX_ORDER
479 def __init__(self, config, name, schema, metadata):
480 GenericPlugin.__init__(self, config, name, schema, metadata)
482 f
"{name}_CDMatrix_1_1",
484 doc=
"(1, 1) element of the CDMatrix for the linear approximation "
485 "of the WCS at the src location. Gives units in radians.")
487 f
"{name}_CDMatrix_1_2",
489 doc=
"(1, 2) element of the CDMatrix for the linear approximation "
490 "of the WCS at the src location. Gives units in radians.")
492 f
"{name}_CDMatrix_2_1",
494 doc=
"(2, 1) element of the CDMatrix for the linear approximation "
495 "of the WCS at the src location. Gives units in radians.")
497 f
"{name}_CDMatrix_2_2",
499 doc=
"(2, 2) element of the CDMatrix for the linear approximation "
500 "of the WCS at the src location. Gives units in radians.")
502 def measure(self, measRecord, exposure, center):
503 wcs = exposure.getWcs()
511 """Create a local, linear approximation of the wcs transformation
514 The approximation is created
as if the center
is at RA=0, DEC=0. All
515 comparing x,y coordinate are relative to the position of center. Matrix
516 is initially calculated
with units arcseconds
and then converted to
517 radians. This yields higher precision results due to quirks
in AST.
524 Point at which to evaluate the LocalWcs.
528 localMatrix : `numpy.ndarray`
529 Matrix representation the local wcs approximation
with units
532 skyCenter = wcs.pixelToSky(center)
535 measurementToLocalGnomonic = wcs.getTransform().then(
536 localGnomonicWcs.getTransform().inverted()
538 localMatrix = measurementToLocalGnomonic.getJacobian(center)
539 return np.radians(localMatrix / 3600)
542SingleFrameEvaluateLocalWcsPlugin = EvaluateLocalWcsPlugin.makeSingleFramePlugin(
"base_LocalWcs")
543"""Single-frame version of `EvaluateLocalWcsPlugin`.
546ForcedEvaluateLocalWcsPlugin = EvaluateLocalWcsPlugin.makeForcedPlugin(
"base_LocalWcs")
547"""Forced version of `EvaluateLocalWcsPlugin`.
552 """Configuration for the single frame peak centroiding algorithm.
557@register("base_PeakCentroid")
559 """Record the highest peak in a source footprint as its centroid.
561 This is of course a relatively poor measure of the true centroid of the
562 object; this algorithm
is provided mostly
for testing
and debugging.
566 config : `SingleFramePeakCentroidConfig`
571 The schema
for the measurement output catalog. New fields will be
572 added to hold measurements produced by this plugin.
574 Plugin metadata that will be attached to the output catalog
577 ConfigClass = SingleFramePeakCentroidConfig
583 def __init__(self, config, name, schema, metadata):
584 SingleFramePlugin.__init__(self, config, name, schema, metadata)
585 self.
keyX = schema.addField(name +
"_x", type=
"D", doc=
"peak centroid", units=
"pixel")
586 self.
keyY = schema.addField(name +
"_y", type=
"D", doc=
"peak centroid", units=
"pixel")
587 self.
flag = schema.addField(name +
"_flag", type=
"Flag", doc=
"Centroiding failed")
590 peak = measRecord.getFootprint().getPeaks()[0]
591 measRecord.set(self.
keyX, peak.getFx())
592 measRecord.set(self.
keyY, peak.getFy())
594 def fail(self, measRecord, error=None):
595 measRecord.set(self.
flag,
True)
599 return SimpleCentroidTransform
603 """Configuration for the sky coordinates algorithm.
608@register("base_SkyCoord")
610 """Record the sky position of an object based on its centroid slot and WCS.
612 The position is record
in the ``coord`` field, which
is part of the
617 config : `SingleFrameSkyCoordConfig`
622 The schema
for the measurement output catalog. New fields will be
623 added to hold measurements produced by this plugin.
625 Plugin metadata that will be attached to the output catalog
628 ConfigClass = SingleFrameSkyCoordConfig
638 if not exposure.hasWcs():
639 raise RuntimeError(
"Wcs not attached to exposure. Required for " + self.
name +
" algorithm")
640 measRecord.updateCoord(exposure.getWcs())
642 def fail(self, measRecord, error=None):
650class ForcedPeakCentroidConfig(ForcedPluginConfig):
651 """Configuration for the forced peak centroid algorithm.
656@register("base_PeakCentroid")
658 """Record the highest peak in a source footprint as its centroid.
660 This is of course a relatively poor measure of the true centroid of the
661 object; this algorithm
is provided mostly
for testing
and debugging.
663 This
is similar to `SingleFramePeakCentroidPlugin`,
except that transforms
664 the peak coordinate
from the original (reference) coordinate system to the
665 coordinate system of the exposure being measured.
669 config : `ForcedPeakCentroidConfig`
674 A mapping
from reference catalog fields to output
675 catalog fields. Output fields are added to the output schema.
677 Plugin metadata that will be attached to the output catalog.
680 ConfigClass = ForcedPeakCentroidConfig
686 def __init__(self, config, name, schemaMapper, metadata):
687 ForcedPlugin.__init__(self, config, name, schemaMapper, metadata)
688 schema = schemaMapper.editOutputSchema()
689 self.
keyX = schema.addField(name +
"_x", type=
"D", doc=
"peak centroid", units=
"pixel")
690 self.
keyY = schema.addField(name +
"_y", type=
"D", doc=
"peak centroid", units=
"pixel")
692 def measure(self, measRecord, exposure, refRecord, refWcs):
693 targetWcs = exposure.getWcs()
694 peak = refRecord.getFootprint().getPeaks()[0]
696 result = targetWcs.skyToPixel(refWcs.pixelToSky(result))
697 measRecord.set(self.
keyX, result.getX())
698 measRecord.set(self.
keyY, result.getY())
702 return SimpleCentroidTransform
706 """Configuration for the forced transformed centroid algorithm.
711@register("base_TransformedCentroid")
713 """Record the transformation of the reference catalog centroid.
715 The centroid recorded in the reference catalog
is tranformed to the
716 measurement coordinate system
and stored.
720 config : `ForcedTransformedCentroidConfig`
725 A mapping
from reference catalog fields to output
726 catalog fields. Output fields are added to the output schema.
728 Plugin metadata that will be attached to the output catalog.
732 This
is used
as the slot centroid by default
in forced measurement,
733 allowing subsequent measurements to simply refer to the slot value just
as
734 they would
in single-frame measurement.
737 ConfigClass = ForcedTransformedCentroidConfig
743 def __init__(self, config, name, schemaMapper, metadata):
744 ForcedPlugin.__init__(self, config, name, schemaMapper, metadata)
745 schema = schemaMapper.editOutputSchema()
747 xKey = schema.addField(name +
"_x", type=
"D", doc=
"transformed reference centroid column",
749 yKey = schema.addField(name +
"_y", type=
"D", doc=
"transformed reference centroid row",
755 if "slot_Centroid_flag" in schemaMapper.getInputSchema():
756 self.
flagKey = schema.addField(name +
"_flag", type=
"Flag",
757 doc=
"whether the reference centroid is marked as bad")
761 def measure(self, measRecord, exposure, refRecord, refWcs):
762 targetWcs = exposure.getWcs()
763 if not refWcs == targetWcs:
764 targetPos = targetWcs.skyToPixel(refWcs.pixelToSky(refRecord.getCentroid()))
767 measRecord.set(self.
centroidKey, refRecord.getCentroid())
769 measRecord.set(self.
flagKey, refRecord.getCentroidFlag())
773 """Configuration for the forced transformed coord algorithm.
778@register("base_TransformedCentroidFromCoord")
780 """Record the transformation of the reference catalog coord.
782 The coord recorded in the reference catalog
is tranformed to the
783 measurement coordinate system
and stored.
787 config : `ForcedTransformedCentroidFromCoordConfig`
792 A mapping
from reference catalog fields to output
793 catalog fields. Output fields are added to the output schema.
795 Plugin metadata that will be attached to the output catalog.
799 This can be used
as the slot centroid
in forced measurement when only a
800 reference coord exist, allowing subsequent measurements to simply refer to
801 the slot value just
as they would
in single-frame measurement.
804 ConfigClass = ForcedTransformedCentroidFromCoordConfig
806 def measure(self, measRecord, exposure, refRecord, refWcs):
807 targetWcs = exposure.getWcs()
809 targetPos = targetWcs.skyToPixel(refRecord.getCoord())
813 measRecord.set(self.
flagKey, refRecord.getCentroidFlag())
817 """Configuration for the forced transformed shape algorithm.
822@register("base_TransformedShape")
824 """Record the transformation of the reference catalog shape.
826 The shape recorded in the reference catalog
is tranformed to the
827 measurement coordinate system
and stored.
831 config : `ForcedTransformedShapeConfig`
836 A mapping
from reference catalog fields to output
837 catalog fields. Output fields are added to the output schema.
839 Plugin metadata that will be attached to the output catalog.
843 This
is used
as the slot shape by default
in forced measurement, allowing
844 subsequent measurements to simply refer to the slot value just
as they
845 would
in single-frame measurement.
848 ConfigClass = ForcedTransformedShapeConfig
854 def __init__(self, config, name, schemaMapper, metadata):
855 ForcedPlugin.__init__(self, config, name, schemaMapper, metadata)
856 schema = schemaMapper.editOutputSchema()
858 xxKey = schema.addField(name +
"_xx", type=
"D", doc=
"transformed reference shape x^2 moment",
860 yyKey = schema.addField(name +
"_yy", type=
"D", doc=
"transformed reference shape y^2 moment",
862 xyKey = schema.addField(name +
"_xy", type=
"D", doc=
"transformed reference shape xy moment",
868 if "slot_Shape_flag" in schemaMapper.getInputSchema():
869 self.
flagKey = schema.addField(name +
"_flag", type=
"Flag",
870 doc=
"whether the reference shape is marked as bad")
874 def measure(self, measRecord, exposure, refRecord, refWcs):
875 targetWcs = exposure.getWcs()
876 if not refWcs == targetWcs:
879 measRecord.set(self.
shapeKey, refRecord.getShape().transform(localTransform.getLinear()))
881 measRecord.set(self.
shapeKey, refRecord.getShape())
883 measRecord.set(self.
flagKey, refRecord.getShapeFlag())
static std::shared_ptr< geom::SpanSet > fromShape(int r, Stencil s=Stencil::CIRCLE, lsst::geom::Point2I offset=lsst::geom::Point2I())
def getExecutionOrder(cls)
def __init__(self, config, name, schema, metadata)
def measure(self, measRecord, exposure, center)
def measure(self, measRecord, exposure, center)
def makeLocalTransformMatrix(self, wcs, center)
def getExecutionOrder(cls)
def __init__(self, config, name, schema, metadata)
def __init__(self, config, name, schemaMapper, metadata)
def getExecutionOrder(cls)
def measure(self, measRecord, exposure, refRecord, refWcs)
def measure(self, measRecord, exposure)
def fail(self, measRecord, error=None)
def getExecutionOrder(cls)
def __init__(self, config, name, schema, metadata)
def fail(self, measRecord, error=None)
def getExecutionOrder(cls)
def __init__(self, config, name, schema, metadata)
def measure(self, measRecord, exposure)
def fail(self, measRecord, error=None)
def measure(self, measRecord, exposure)
def getExecutionOrder(cls)
def __init__(self, config, name, schema, metadata)
def fail(self, measRecord, error=None)
def getExecutionOrder(cls)
def measure(self, measRecord, exposure)
int FAILURE_EMPTY_FOOTPRINT
def __init__(self, config, name, schema, metadata)
def measure(self, measRecord, exposure, center)
def fail(self, measRecord, error=None)
def getExecutionOrder(cls)
HeavyFootprint< ImagePixelT, MaskPixelT, VariancePixelT > makeHeavyFootprint(Footprint const &foot, lsst::afw::image::MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > const &img, HeavyFootprintCtrl const *ctrl=nullptr)
std::shared_ptr< SkyWcs > makeSkyWcs(daf::base::PropertySet &metadata, bool strip=false)
std::shared_ptr< TransformPoint2ToPoint2 > makeWcsPairTransform(SkyWcs const &src, SkyWcs const &dst)
lsst::geom::AffineTransform linearizeTransform(TransformPoint2ToPoint2 const &original, lsst::geom::Point2D const &inPoint)