24__all__ = [
"BasePsfDeterminerConfig",
"BasePsfDeterminerTask",
"psfDeterminerRegistry"]
28import lsst.pipe.base
as pipeBase
33 """Configuration that is likely to be shared by all PSF determiners
35 This is fairly sparse; more fields can be moved here once it
is clear they are universal.
37 stampSize = pexConfig.Field[int](
38 doc="Size of the postage stamp (in native pixels) to render the PSF model. Should be odd.",
41 check=
lambda x: (x > 0) & (x % 2 == 1),
43 kernelSize = pexConfig.Field[int](
44 doc=
"Size of the kernel to create. "
45 "If less than 15, then the median of the square root of the "
46 "stellar quadrupole moments is multiplied by kernelSize and "
47 "used as the kernel size.",
50 deprecated=
"This field is deprecated and will be removed after v25. "
51 "Use stampSize instead.",
53 kernelSizeMin = pexConfig.Field[int](
54 doc=
"Minimum radius of the kernel. Relevant only if kernelSize < 15.",
56 deprecated=
"This field is deprecated and will be removed after v25.",
58 kernelSizeMax = pexConfig.Field[int](
59 doc=
"Maximum radius of the kernel. Relevant only if kernelSize < 15.",
61 deprecated=
"This field is deprecated and will be removed after v25.",
70 raise pexConfig.FieldValidationError(self.__class__.kernelSize, self,
71 "Only one of stampSize (preferable) and kernelSize "
72 "(deprecated) must be set."
75 raise pexConfig.FieldValidationError(self.__class__.kernelSizeMax, self,
76 "kernelSizeMin must be <= kernelSizeMax"
81 """Base class for PSF determiners
83 Register all PSF determiners with the psfDeterminerRegistry using:
84 psfDeterminerRegistry.register(name,
class)
88 config : `lsst.pexConfig.Config`
89 Input
for configuring the algorithm
91 Schema used
for sources; passing a schema allows the
92 determiner to reserve a flag field to mark stars used
in
93 PSF measurement, but some PSF determiners ignore this argument.
97 ConfigClass = BasePsfDeterminerConfig
98 _DefaultName =
"psfDeterminer"
101 pipeBase.Task.__init__(self, config=config, **kwds)
104 def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None):
105 """Determine a PSF model.
109 exposure : `lsst.afw.Exposure`
110 Exposure containing the psf candidates.
112 A sequence of PSF candidates; typically obtained by
113 detecting sources and then running them through a star
115 metadata : `str`, optional
116 A place to save interesting items.
118 Schema key used to mark sources actually used
in PSF determination.
125 The spatial cell set used to determine the PSF
127 raise NotImplementedError(
"BasePsfDeterminerTask is abstract, subclasses must override this method")
130psfDeterminerRegistry = pexConfig.makeRegistry(
131 doc=
"A registry of PSF determiners (subclasses of BasePsfDeterminerTask)",
Class stored in SpatialCells for spatial Psf fitting.
def __init__(self, config, schema=None, **kwds)
def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None)