29 #ifndef LSST_AFW_MATH_WARPEXPOSURE_H
30 #define LSST_AFW_MATH_WARPEXPOSURE_H
299 _maskWarpingKernelPtr(),
432 template <typename DestExposureT, typename SrcExposureT>
434 DestExposureT &destExposure,
437 SrcExposureT const &srcExposure,
439 typename DestExposureT::MaskedImageT::SinglePixel padValue =
442 typename DestExposureT::MaskedImageT>::image_category())
492 template <typename DestImageT, typename SrcImageT>
494 geom::SkyWcs const &destWcs,
495 SrcImageT const &srcImage,
496 geom::SkyWcs const &srcWcs,
498 typename DestImageT::SinglePixel padValue =
lsst::
afw::math::
edgePixel<DestImageT>(
499 typename
lsst::
afw::
image::detail::image_traits<DestImageT>::image_category())
517 template <typename DestImageT, typename SrcImageT>
518 int warpImage(DestImageT &destImage, SrcImageT const &srcImage,
520 typename DestImageT::SinglePixel padValue =
lsst::
afw::math::
edgePixel<DestImageT>(
521 typename
lsst::
afw::
image::detail::image_traits<DestImageT>::image_category()));
528 template <typename DestImageT, typename SrcImageT>
530 DestImageT &destImage,
531 SrcImageT const &srcImage,
532 lsst::
geom::LinearTransform const &linearTransform,
535 typename DestImageT::SinglePixel padValue =
lsst::
afw::math::
edgePixel<DestImageT>(
536 typename
lsst::
afw::
image::detail::image_traits<DestImageT>::image_category())
table::Key< std::string > name
1-dimensional bilinear interpolation function.
~BilinearFunction1() override
std::string toString(std::string const &="") const override
Return string representation.
Function1Ptr clone() const override
Return a pointer to a deep copy of this function.
BilinearFunction1(double fracPos)
Construct a Bilinear interpolation function.
std::shared_ptr< Function1< Kernel::Pixel > > Function1Ptr
Kernel::Pixel operator()(double x) const override
Solve bilinear equation.
Bilinear warping: fast; good for undersampled data.
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
BilinearWarpingKernel & operator=(BilinearWarpingKernel &&)=delete
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
BilinearWarpingKernel & operator=(const BilinearWarpingKernel &)=delete
BilinearWarpingKernel(BilinearWarpingKernel &&)=delete
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
~BilinearWarpingKernel() override=default
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
void setKernelParameter(unsigned int ind, double value) const override
Set one kernel parameter.
BilinearWarpingKernel(const BilinearWarpingKernel &)=delete
A Function taking one argument.
std::vector< double > _params
Kernels are used for convolution with MaskedImages and (eventually) Images.
1-dimensional Lanczos function
Lanczos warping: accurate but slow and can introduce ringing artifacts.
int getOrder() const
get the order of the kernel
LanczosWarpingKernel(const LanczosWarpingKernel &)=delete
LanczosWarpingKernel(int order)
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
void setKernelParameter(unsigned int ind, double value) const override
Set one kernel parameter.
~LanczosWarpingKernel() override=default
LanczosWarpingKernel & operator=(const LanczosWarpingKernel &)=delete
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
LanczosWarpingKernel & operator=(LanczosWarpingKernel &&)=delete
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
LanczosWarpingKernel(LanczosWarpingKernel &&)=delete
1-dimensional nearest neighbor interpolation function.
NearestFunction1(double fracPos)
Construct a Nearest interpolation function.
Kernel::Pixel operator()(double x) const override
Solve nearest neighbor equation.
Function1Ptr clone() const override
Return a pointer to a deep copy of this function.
std::shared_ptr< Function1< Kernel::Pixel > > Function1Ptr
~NearestFunction1() override
std::string toString(std::string const &="") const override
Return string representation.
Nearest neighbor warping: fast; good for undersampled data.
NearestWarpingKernel(NearestWarpingKernel &&)=delete
NearestWarpingKernel & operator=(NearestWarpingKernel &&)=delete
NearestWarpingKernel(const NearestWarpingKernel &)=delete
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
NearestWarpingKernel & operator=(const NearestWarpingKernel &)=delete
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
~NearestWarpingKernel() override=default
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
void setKernelParameter(unsigned int ind, double value) const override
Set one kernel parameter.
A kernel described by a pair of functions: func(x, y) = colFunc(x) * rowFunc(y)
Parameters to control convolution.
bool hasMaskWarpingKernel() const
return true if there is a mask kernel
lsst::afw::image::MaskPixel getGrowFullMask() const
get mask bits to grow to full width of image/variance kernel
void setWarpingKernel(SeparableKernel const &warpingKernel)
set the warping kernel
int getInterpLength() const
get the interpolation length (pixels)
std::string getPythonModule() const override
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
void setWarpingKernelName(std::string const &warpingKernelName)
set the warping kernel by name
void setMaskWarpingKernelName(std::string const &maskWarpingKernelName)
set or clear the mask warping kernel by name
void setCacheSize(int cacheSize)
set the cache size for the interpolation kernel(s)
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
int getCacheSize() const
get the cache size for the interpolation kernel(s)
void setMaskWarpingKernel(SeparableKernel const &maskWarpingKernel)
set the mask warping kernel
virtual ~WarpingControl()
std::shared_ptr< SeparableKernel > getWarpingKernel() const
get the warping kernel
void setGrowFullMask(lsst::afw::image::MaskPixel growFullMask)
set mask bits to grow to full width of image/variance kernel
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
void setInterpLength(int interpLength)
set the interpolation length
std::shared_ptr< SeparableKernel > getMaskWarpingKernel() const
get the mask warping kernel
WarpingControl(std::string const &warpingKernelName, std::string const &maskWarpingKernelName="", int cacheSize=0, int interpLength=0, lsst::afw::image::MaskPixel growFullMask=0)
Construct a WarpingControl object.
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
A CRTP facade class for subclasses of Persistable.
A base class for objects that can be persisted via afw::table::io Archive classes.
io::OutputArchiveHandle OutputArchiveHandle
Transform< Point2Endpoint, Point2Endpoint > TransformPoint2ToPoint2
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
class[[deprecated("Removed with no replacement (but see lsst::afw::image::TransmissionCurve). Will be " "removed after v22.")]] FilterProperty final
Describe the properties of a Filter (e.g.
std::int32_t MaskPixel
default type for Masks and MaskedImage Masks
std::shared_ptr< SeparableKernel > makeWarpingKernel(std::string name)
Return a warping kernel given its name.
int warpCenteredImage(DestImageT &destImage, SrcImageT const &srcImage, lsst::geom::LinearTransform const &linearTransform, lsst::geom::Point2D const ¢erPosition, WarpingControl const &control, typename DestImageT::SinglePixel padValue=lsst::afw::math::edgePixel< DestImageT >(typename lsst::afw::image::detail::image_traits< DestImageT >::image_category()))
Warp an image with a LinearTranform about a specified point.
int warpImage(DestImageT &destImage, geom::SkyWcs const &destWcs, SrcImageT const &srcImage, geom::SkyWcs const &srcWcs, WarpingControl const &control, typename DestImageT::SinglePixel padValue=lsst::afw::math::edgePixel< DestImageT >(typename lsst::afw::image::detail::image_traits< DestImageT >::image_category()))
Warp an Image or MaskedImage to a new Wcs.
int warpExposure(DestExposureT &destExposure, SrcExposureT const &srcExposure, WarpingControl const &control, typename DestExposureT::MaskedImageT::SinglePixel padValue=lsst::afw::math::edgePixel< typename DestExposureT::MaskedImageT >(typename lsst::afw::image::detail::image_traits< typename DestExposureT::MaskedImageT >::image_category()))
Warp (remap) one exposure to another.
ImageT::SinglePixel edgePixel(lsst::afw::image::detail::Image_tag)
Return an off-the-edge pixel appropriate for a given Image type.
Point< double, 2 > Point2D
A base class for image defects.
afw::table::Key< std::string > warpingKernelName
table::Key< int > interpLength
table::Key< image::MaskPixel > growFullMask
table::Key< int > cacheSize