|
lsst.afw gba399f52f3+9b61cfce8e
|
Nearest neighbor warping: fast; good for undersampled data. More...
#include <warpExposure.h>
Classes | |
| class | NearestFunction1 |
| 1-dimensional nearest neighbor interpolation function. More... | |
Public Types | |
| using | KernelFunction = lsst::afw::math::Function1<Pixel> |
| using | KernelFunctionPtr = std::shared_ptr<KernelFunction> |
| 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> |
| using | kernel_fill_factor = generic_kernel_tag |
Public Member Functions | |
| NearestWarpingKernel () | |
| NearestWarpingKernel (const NearestWarpingKernel &)=delete | |
| NearestWarpingKernel (NearestWarpingKernel &&)=delete | |
| NearestWarpingKernel & | operator= (const NearestWarpingKernel &)=delete |
| NearestWarpingKernel & | operator= (NearestWarpingKernel &&)=delete |
| ~NearestWarpingKernel () override=default | |
| std::shared_ptr< Kernel > | clone () const override |
| Return a pointer to a deep copy of this kernel. | |
| bool | isPersistable () const noexcept override |
| std::shared_ptr< Kernel > | resized (int width, int height) const override |
| Return a pointer to a clone with specified kernel dimensions. | |
| double | computeVectors (std::vector< Pixel > &colList, std::vector< Pixel > &rowList, bool doNormalize, double x=0.0, double y=0.0) const |
| Compute the column and row arrays in place, where kernel(col, row) = colList(col) * rowList(row). | |
| double | getKernelParameter (unsigned int i) const override |
| Return a particular Kernel Parameter (no bounds checking). | |
| std::vector< double > | getKernelParameters () const override |
| Return the current kernel parameters. | |
| KernelFunctionPtr | getKernelColFunction () const |
| Get a deep copy of the col kernel function. | |
| KernelFunctionPtr | getKernelRowFunction () const |
| Get a deep copy of the row kernel function. | |
| std::string | toString (std::string const &prefix="") const override |
| Return a string representation of the kernel. | |
| void | computeCache (int const cacheSize) override |
| Compute a cache of Kernel values, if desired. | |
| int | getCacheSize () const override |
| Get the current cache size (0 if none). | |
| 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. | |
| 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. | |
Static Public Member Functions | |
| static std::shared_ptr< SeparableKernel > | readFits (fits::Fits &fitsfile) |
| Read an object from an already open FITS object. | |
| static std::shared_ptr< Kernel > | readFits (fits::Fits &fitsfile) |
| Read an object from an already open FITS object. | |
| static std::shared_ptr< SeparableKernel > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
| Dynamically cast a shared_ptr. | |
| static std::shared_ptr< Kernel > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
| Dynamically cast a shared_ptr. | |
Protected Member Functions | |
| void | setKernelParameter (unsigned int ind, double value) const override |
| Set one kernel parameter. | |
| std::string | getPersistenceName () const override |
| std::string | getPythonModule () const override |
| void | write (OutputArchiveHandle &handle) const override |
| double | doComputeImage (lsst::afw::image::Image< Pixel > &image, bool doNormalize) const override |
| Low-level version of computeImage. | |
| void | setKernelParametersFromSpatialModel (double x, double y) const |
| Set the kernel parameters from the spatial model (if any). | |
Protected Attributes | |
| std::vector< SpatialFunctionPtr > | _spatialFunctionList |
Nearest neighbor warping: fast; good for undersampled data.
The kernel size is 2 x 2.
For more information about warping kernels see makeWarpingKernel
Definition at line 180 of file warpExposure.h.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineexplicit |
Definition at line 182 of file warpExposure.h.
|
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 140 of file warpExposure.cc.
|
overridevirtualinherited |
Compute a cache of Kernel values, if desired.
| cacheSize | desired cache size |
Reimplemented from lsst::afw::math::Kernel.
Definition at line 309 of file SeparableKernel.cc.
|
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 |
|
inherited |
Compute the column and row arrays in place, where kernel(col, row) = colList(col) * rowList(row).
x, y are ignored if there is no spatial function.
| colList | column vector |
| rowList | row vector |
| doNormalize | normalize the image (so sum of each 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 colList or rowList is the wrong size |
| lsst::pex::exceptions::OverflowError | if doNormalize is true and the kernel sum is exactly 0 |
Definition at line 122 of file SeparableKernel.cc.
|
overrideprotectedvirtualinherited |
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 171 of file SeparableKernel.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 |
|
overridevirtualinherited |
Get the current cache size (0 if none).
Reimplemented from lsst::afw::math::Kernel.
Definition at line 319 of file SeparableKernel.cc.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
Get a deep copy of the col kernel function.
Definition at line 139 of file SeparableKernel.cc.
|
inlineoverridevirtualinherited |
Return a particular Kernel Parameter (no bounds checking).
This version is slow, but specialisations may be faster
Reimplemented from lsst::afw::math::Kernel.
|
overridevirtualinherited |
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 from lsst::afw::math::Kernel.
Definition at line 160 of file SeparableKernel.cc.
|
inherited |
Get a deep copy of the row kernel function.
Definition at line 143 of file SeparableKernel.cc.
|
inlineinherited |
|
inlineinherited |
|
inlineoverrideprotected |
Definition at line 235 of file warpExposure.h.
|
inlineoverrideprotected |
Definition at line 237 of file warpExposure.h.
|
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 |
Definition at line 193 of file warpExposure.h.
|
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.
|
overridevirtualinherited |
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 110 of file SeparableKernel.cc.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
overrideprotectedvirtual |
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 from lsst::afw::math::Kernel.
Definition at line 149 of file warpExposure.cc.
|
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 |
|
overridevirtualinherited |
Return a string representation of the kernel.
Reimplemented from lsst::afw::math::Kernel.
Definition at line 147 of file SeparableKernel.cc.
|
overrideprotected |
Definition at line 222 of file warpExposure.cc.
|
protectedinherited |