|
lsst.afw gba399f52f3+9b61cfce8e
|
A kernel that has only one non-zero pixel (of value 1). More...
#include <Kernel.h>
Classes | |
| class | Factory |
Public Types | |
| using | kernel_fill_factor = deltafunction_kernel_tag |
| using | Pixel = double |
| using | SpatialFunctionPtr = std::shared_ptr<lsst::afw::math::Function2<double>> |
| using | SpatialFunction = lsst::afw::math::Function2<double> |
| using | NullSpatialFunction = lsst::afw::math::NullFunction2<double> |
Public Member Functions | |
| DeltaFunctionKernel (int width, int height, lsst::geom::Point2I const &point) | |
| Construct a spatially invariant DeltaFunctionKernel. | |
| DeltaFunctionKernel (const DeltaFunctionKernel &)=delete | |
| DeltaFunctionKernel (DeltaFunctionKernel &&)=delete | |
| DeltaFunctionKernel & | operator= (const DeltaFunctionKernel &)=delete |
| DeltaFunctionKernel & | operator= (DeltaFunctionKernel &&)=delete |
| ~DeltaFunctionKernel () override=default | |
| std::shared_ptr< Kernel > | clone () const override |
| Return a pointer to a deep copy of this kernel. | |
| std::shared_ptr< Kernel > | resized (int width, int height) const override |
| Return a pointer to a clone with specified kernel dimensions. | |
| lsst::geom::Point2I | getPixel () const |
| std::string | toString (std::string const &prefix="") const override |
| Return a string representation of the kernel. | |
| bool | isPersistable () const noexcept override |
| double | computeImage (lsst::afw::image::Image< Pixel > &image, bool doNormalize, double x=0.0, double y=0.0) const |
| Compute an image (pixellized representation of the kernel) in place. | |
| lsst::geom::Extent2I const | getDimensions () const |
| Return the Kernel's dimensions (width, height). | |
| void | setDimensions (lsst::geom::Extent2I dims) |
| void | setWidth (int width) |
| void | setHeight (int height) |
| int | getWidth () const |
| Return the Kernel's width. | |
| int | getHeight () const |
| Return the Kernel's height. | |
| lsst::geom::Point2I | getCtr () const |
| Return index of kernel's center. | |
| lsst::geom::Box2I | getBBox () const |
| return parent bounding box, with XY0 = -center | |
| unsigned int | getNKernelParameters () const |
| Return the number of kernel parameters (0 if none). | |
| int | getNSpatialParameters () const |
| Return the number of spatial parameters (0 if not spatially varying). | |
| SpatialFunctionPtr | getSpatialFunction (unsigned int index) const |
| Return a clone of the specified spatial function (one component of the spatial model). | |
| std::vector< SpatialFunctionPtr > | getSpatialFunctionList () const |
| Return a list of clones of the spatial functions. | |
| virtual double | getKernelParameter (unsigned int i) const |
| Return a particular Kernel Parameter (no bounds checking). | |
| virtual std::vector< double > | getKernelParameters () const |
| Return the current kernel parameters. | |
| lsst::geom::Box2I | growBBox (lsst::geom::Box2I const &bbox) const |
| Given a bounding box for pixels one wishes to compute by convolving an image with this kernel, return the bounding box of pixels that must be accessed on the image to be convolved. | |
| lsst::geom::Box2I | shrinkBBox (lsst::geom::Box2I const &bbox) const |
| Given a bounding box for an image one wishes to convolve with this kernel, return the bounding box for the region of pixels that can be computed. | |
| void | setCtr (lsst::geom::Point2I ctr) |
| Set index of kernel's center. | |
| std::vector< std::vector< double > > | getSpatialParameters () const |
| Return the spatial parameters parameters (an empty vector if not spatially varying). | |
| bool | isSpatiallyVarying () const |
| Return true iff the kernel is spatially varying (has a spatial function). | |
| void | setKernelParameters (std::vector< double > const ¶ms) |
| Set the kernel parameters of a spatially invariant kernel. | |
| void | setKernelParameters (std::pair< double, double > const ¶ms) |
| Set the kernel parameters of a 2-component spatially invariant kernel. | |
| void | setSpatialParameters (const std::vector< std::vector< double > > params) |
| Set the parameters of all spatial functions. | |
| void | computeKernelParametersFromSpatialModel (std::vector< double > &kernelParams, double x, double y) const |
| Compute the kernel parameters at a specified point. | |
| virtual void | computeCache (int const) |
| Compute a cache of Kernel values, if desired. | |
| virtual int | getCacheSize () const |
| Get the current size of the kernel cache (0 if none or if caches not supported). | |
Static Public Member Functions | |
| static std::shared_ptr< DeltaFunctionKernel > | readFits (fits::Fits &fitsfile) |
| Read an object from an already open FITS object. | |
| static std::shared_ptr< DeltaFunctionKernel > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
| Dynamically cast a shared_ptr. | |
| static std::shared_ptr< Kernel > | readFits (fits::Fits &fitsfile) |
| Read an object from an already open FITS object. | |
| static std::shared_ptr< Kernel > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
| Dynamically cast a shared_ptr. | |
Protected Member Functions | |
| double | doComputeImage (lsst::afw::image::Image< Pixel > &image, bool doNormalize) const override |
| Low-level version of computeImage. | |
| std::string | getPersistenceName () const override |
| void | write (OutputArchiveHandle &handle) const override |
| std::string | getPythonModule () const override |
| virtual void | setKernelParameter (unsigned int ind, double value) const |
| Set one kernel parameter. | |
| void | setKernelParametersFromSpatialModel (double x, double y) const |
| Set the kernel parameters from the spatial model (if any). | |
Protected Attributes | |
| std::vector< SpatialFunctionPtr > | _spatialFunctionList |
A kernel that has only one non-zero pixel (of value 1).
It has no adjustable parameters and so cannot be spatially varying.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
explicit |
Construct a spatially invariant DeltaFunctionKernel.
| width | kernel size (columns) |
| height | kernel size (rows) |
| point | index of active pixel (where 0,0 is the lower left corner) |
| pex::exceptions::InvalidParameterError | if active pixel is off the kernel |
Definition at line 42 of file DeltaFunctionKernel.cc.
|
delete |
|
delete |
|
overridedefault |
|
overridevirtual |
Return a pointer to a deep copy of this kernel.
This kernel exists instead of a copy constructor so one can obtain a copy of an actual kernel instead of a useless copy of the base class.
Every kernel subclass must override this method.
Implements lsst::afw::math::Kernel.
Definition at line 52 of file DeltaFunctionKernel.cc.
|
inlinevirtualinherited |
Compute a cache of Kernel values, if desired.
| - | desired cache size |
Reimplemented in lsst::afw::math::SeparableKernel.
|
inherited |
Compute an image (pixellized representation of the kernel) in place.
| image | image whose pixels are to be set (output); xy0 of the image will be set to -kernel.getCtr() |
| doNormalize | normalize the image (so sum is 1)? |
| x | x (column position) at which to compute spatial function |
| y | y (row position) at which to compute spatial function |
| lsst::pex::exceptions::InvalidParameterError | if the image is the wrong size |
| lsst::pex::exceptions::OverflowError | if doNormalize is true and the kernel sum is exactly 0 |
|
inherited |
|
overrideprotectedvirtual |
Low-level version of computeImage.
Before this is called the image dimensions are checked, the image's xy0 is set and the kernel's parameters are set. This routine sets the pixels, including normalization if requested.
| image | image whose pixels are to be set (output) |
| doNormalize | normalize the image (so sum is 1)? |
Implements lsst::afw::math::Kernel.
Definition at line 86 of file DeltaFunctionKernel.cc.
|
staticinherited |
Dynamically cast a shared_ptr.
Dynamically cast a shared pointer and raise on failure.
You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;
| lsst::pex::exceptions::LogicError | if the cast fails |
param[in] ptr The pointer to be cast.
| lsst::pex::exceptions::TypeError | If the dynamic cast fails. |
Definition at line 218 of file Persistable.cc.
|
staticinherited |
Dynamically cast a shared_ptr.
Dynamically cast a shared pointer and raise on failure.
You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;
| lsst::pex::exceptions::LogicError | if the cast fails |
param[in] ptr The pointer to be cast.
| lsst::pex::exceptions::TypeError | If the dynamic cast fails. |
Definition at line 218 of file Persistable.cc.
|
inlineinherited |
|
inlinevirtualinherited |
Get the current size of the kernel cache (0 if none or if caches not supported).
Reimplemented in lsst::afw::math::SeparableKernel.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinevirtualinherited |
Return a particular Kernel Parameter (no bounds checking).
This version is slow, but specialisations may be faster
Reimplemented in lsst::afw::math::SeparableKernel.
|
virtualinherited |
Return the current kernel parameters.
If the kernel is spatially varying then the parameters are those last computed. See also computeKernelParametersFromSpatialModel. If there are no kernel parameters then returns an empty vector.
Reimplemented in lsst::afw::math::AnalyticKernel, lsst::afw::math::LinearCombinationKernel, and lsst::afw::math::SeparableKernel.
|
inlineinherited |
|
inlineinherited |
|
overrideprotected |
Definition at line 151 of file DeltaFunctionKernel.cc.
|
inline |
|
overrideprotectedinherited |
|
inherited |
Return a clone of the specified spatial function (one component of the spatial model).
| index | index of desired spatial function; must be in range [0, number spatial parameters - 1] |
| lsst::pex::exceptions::InvalidParameterError | if kernel not spatially varying |
| lsst::pex::exceptions::InvalidParameterError | if index out of range |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
Given a bounding box for pixels one wishes to compute by convolving an image with this kernel, return the bounding box of pixels that must be accessed on the image to be convolved.
Thus the box shifted by -kernel.getCtr() and its size is expanded by kernel.getDimensions()-1.
|
inlineoverridenoexcept |
|
inlineinherited |
|
delete |
|
delete |
|
inlinestaticinherited |
Read an object from an already open FITS object.
| [in] | fitsfile | FITS object to read from, already positioned at the desired HDU. |
Definition at line 183 of file Persistable.h.
|
inlinestaticinherited |
Read an object from an already open FITS object.
| [in] | fitsfile | FITS object to read from, already positioned at the desired HDU. |
Definition at line 183 of file Persistable.h.
|
overridevirtual |
Return a pointer to a clone with specified kernel dimensions.
| width | Number of columns in pixels |
| height | Number of rows in pixels |
Must be implemented by derived classes.
Implements lsst::afw::math::Kernel.
Definition at line 59 of file DeltaFunctionKernel.cc.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
protectedvirtualinherited |
Set one kernel parameter.
Classes that have kernel parameters must subclass this function.
This function is marked "const", despite modifying unimportant internals, so that computeImage can be const.
| lsst::pex::exceptions::InvalidParameterError | always (unless subclassed) |
Reimplemented in lsst::afw::math::AnalyticKernel, lsst::afw::math::BilinearWarpingKernel, lsst::afw::math::LanczosWarpingKernel, lsst::afw::math::LinearCombinationKernel, lsst::afw::math::NearestWarpingKernel, and lsst::afw::math::SeparableKernel.
|
inlineinherited |
Set the kernel parameters of a 2-component spatially invariant kernel.
|
inlineinherited |
|
protectedinherited |
|
inherited |
|
inlineinherited |
|
inherited |
Given a bounding box for an image one wishes to convolve with this kernel, return the bounding box for the region of pixels that can be computed.
Thus the box shifted by kernel.getCtr() and its size is reduced by kernel.getDimensions()-1.
| lsst::pex::exceptions::InvalidParameterError | if the resulting box would have dimension < 1 in either axis |
|
overridevirtual |
Return a string representation of the kernel.
Reimplemented from lsst::afw::math::Kernel.
Definition at line 75 of file DeltaFunctionKernel.cc.
|
overrideprotected |
Definition at line 155 of file DeltaFunctionKernel.cc.
|
protectedinherited |