LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Public Member Functions | List of all members
lsst::afw::math::WarpingControl Class Reference

Parameters to control convolution. More...

#include <warpExposure.h>

Public Member Functions

 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. More...
 
virtual ~WarpingControl ()
 
int getCacheSize () const
 get the cache size for the interpolation kernel(s) More...
 
void setCacheSize (int cacheSize)
 set the cache size for the interpolation kernel(s) More...
 
int getInterpLength () const
 get the interpolation length (pixels) More...
 
void setInterpLength (int interpLength)
 set the interpolation length More...
 
std::shared_ptr< SeparableKernelgetWarpingKernel () const
 get the warping kernel More...
 
void setWarpingKernelName (std::string const &warpingKernelName)
 set the warping kernel by name More...
 
void setWarpingKernel (SeparableKernel const &warpingKernel)
 set the warping kernel More...
 
std::shared_ptr< SeparableKernelgetMaskWarpingKernel () const
 get the mask warping kernel More...
 
bool hasMaskWarpingKernel () const
 return true if there is a mask kernel More...
 
void setMaskWarpingKernelName (std::string const &maskWarpingKernelName)
 set or clear the mask warping kernel by name More...
 
void setMaskWarpingKernel (SeparableKernel const &maskWarpingKernel)
 set the mask warping kernel More...
 
lsst::afw::image::MaskPixel getGrowFullMask () const
 get mask bits to grow to full width of image/variance kernel More...
 
void setGrowFullMask (lsst::afw::image::MaskPixel growFullMask)
 set mask bits to grow to full width of image/variance kernel More...
 

Detailed Description

Parameters to control convolution.

Note
padValue is not member of this class to avoid making this a templated class.

Definition at line 250 of file warpExposure.h.

Constructor & Destructor Documentation

◆ WarpingControl()

lsst::afw::math::WarpingControl::WarpingControl ( std::string const &  warpingKernelName,
std::string const &  maskWarpingKernelName = "",
int  cacheSize = 0,
int  interpLength = 0,
lsst::afw::image::MaskPixel  growFullMask = 0 
)
inlineexplicit

Construct a WarpingControl object.

Exceptions
pex::exceptions::InvalidParameterErrorif the warping kernel is smaller than the mask warping kernel.
Parameters
warpingKernelNamename of warping kernel; used as the argument to makeWarpingKernel
maskWarpingKernelNamename of warping kernel used for the mask plane; if "" then the regular warping kernel is used. Intended so one can use a bilinear kernel or other compact kernel for the mask plane to avoid smearing mask bits too far. The theory is that bad pixels are already interpolated over, so we don't need to worry about bad values spreading very far.
cacheSizecache size for warping kernel; no cache if 0 (used as the argument to the warping kernels' computeCache method)
interpLengthdistance over which the WCS can be linearly interpolated
growFullMaskmask bits to grow to full width of image/variance kernel

Definition at line 258 of file warpExposure.h.

272  : _warpingKernelPtr(makeWarpingKernel(warpingKernelName)),
273  _maskWarpingKernelPtr(),
274  _cacheSize(cacheSize),
275  _interpLength(interpLength),
276  _growFullMask(growFullMask) {
277  setMaskWarpingKernelName(maskWarpingKernelName);
278  }
afw::table::Key< int > cacheSize
Definition: CoaddPsf.cc:339
afw::table::Key< std::string > warpingKernelName
Definition: CoaddPsf.cc:341
std::shared_ptr< SeparableKernel > makeWarpingKernel(std::string name)
Return a warping kernel given its name.
void setMaskWarpingKernelName(std::string const &maskWarpingKernelName)
set or clear the mask warping kernel by name

◆ ~WarpingControl()

virtual lsst::afw::math::WarpingControl::~WarpingControl ( )
inlinevirtual

Definition at line 280 of file warpExposure.h.

280 {};

Member Function Documentation

◆ getCacheSize()

int lsst::afw::math::WarpingControl::getCacheSize ( ) const
inline

get the cache size for the interpolation kernel(s)

Definition at line 285 of file warpExposure.h.

285 { return _cacheSize; };

◆ getGrowFullMask()

lsst::afw::image::MaskPixel lsst::afw::math::WarpingControl::getGrowFullMask ( ) const
inline

get mask bits to grow to full width of image/variance kernel

Definition at line 365 of file warpExposure.h.

365 { return _growFullMask; };

◆ getInterpLength()

int lsst::afw::math::WarpingControl::getInterpLength ( ) const
inline

get the interpolation length (pixels)

Definition at line 303 of file warpExposure.h.

303 { return _interpLength; };

◆ getMaskWarpingKernel()

std::shared_ptr< SeparableKernel > lsst::afw::math::WarpingControl::getMaskWarpingKernel ( ) const

get the mask warping kernel

Definition at line 200 of file warpExposure.cc.

200  {
201  if (_maskWarpingKernelPtr) { // lazily update kernel cache
202  if (_maskWarpingKernelPtr->getCacheSize() != _cacheSize) {
203  _maskWarpingKernelPtr->computeCache(_cacheSize);
204  }
205  }
206  return _maskWarpingKernelPtr;
207 }

◆ getWarpingKernel()

std::shared_ptr< SeparableKernel > lsst::afw::math::WarpingControl::getWarpingKernel ( ) const

get the warping kernel

Definition at line 179 of file warpExposure.cc.

179  {
180  if (_warpingKernelPtr->getCacheSize() != _cacheSize) {
181  _warpingKernelPtr->computeCache(_cacheSize);
182  }
183  return _warpingKernelPtr;
184 };

◆ hasMaskWarpingKernel()

bool lsst::afw::math::WarpingControl::hasMaskWarpingKernel ( ) const
inline

return true if there is a mask kernel

Definition at line 345 of file warpExposure.h.

345 { return static_cast<bool>(_maskWarpingKernelPtr); }

◆ setCacheSize()

void lsst::afw::math::WarpingControl::setCacheSize ( int  cacheSize)
inline

set the cache size for the interpolation kernel(s)

A value of 0 disables the cache for maximum accuracy. 10,000 typically results in a warping error of a fraction of a count. 100,000 typically results in a warping error of less than 0.01 count. Note the new cache is not computed until getWarpingKernel or getMaskWarpingKernel is called.

Parameters
cacheSizecache size

Definition at line 295 of file warpExposure.h.

296  {
297  _cacheSize = cacheSize;
298  };
afw::table::Key< int > cacheSize
Definition: CoaddPsf.cc:339

◆ setGrowFullMask()

void lsst::afw::math::WarpingControl::setGrowFullMask ( lsst::afw::image::MaskPixel  growFullMask)
inline

set mask bits to grow to full width of image/variance kernel

Parameters
growFullMaskmask bits to grow to full width of image/variance kernel

Definition at line 370 of file warpExposure.h.

372  {
373  _growFullMask = growFullMask;
374  }

◆ setInterpLength()

void lsst::afw::math::WarpingControl::setInterpLength ( int  interpLength)
inline

set the interpolation length

Interpolation length is the distance over which the WCS can be linearly interpolated, in pixels:

  • 0 means no interpolation and uses an optimized branch of the code
  • 1 also performs no interpolation but it runs the interpolation code branch (and so is only intended for unit tests)
Parameters
interpLengthinterpolation length (pixels)

Definition at line 313 of file warpExposure.h.

314  {
315  _interpLength = interpLength;
316  };

◆ setMaskWarpingKernel()

void lsst::afw::math::WarpingControl::setMaskWarpingKernel ( SeparableKernel const &  maskWarpingKernel)

set the mask warping kernel

Note
To clear the mask warping kernel use setMaskWarpingKernelName("").
Parameters
maskWarpingKernelmask warping kernel

Definition at line 218 of file warpExposure.cc.

218  {
219  _testWarpingKernels(*_warpingKernelPtr, maskWarpingKernel);
220  _maskWarpingKernelPtr = std::static_pointer_cast<SeparableKernel>(maskWarpingKernel.clone());
221 }
T static_pointer_cast(T... args)

◆ setMaskWarpingKernelName()

void lsst::afw::math::WarpingControl::setMaskWarpingKernelName ( std::string const &  maskWarpingKernelName)

set or clear the mask warping kernel by name

Parameters
maskWarpingKernelNamename of mask warping kernel; use "" to clear the kernel

Definition at line 209 of file warpExposure.cc.

209  {
210  if (!maskWarpingKernelName.empty()) {
211  std::shared_ptr<SeparableKernel> maskWarpingKernelPtr(makeWarpingKernel(maskWarpingKernelName));
212  setMaskWarpingKernel(*maskWarpingKernelPtr);
213  } else {
214  _maskWarpingKernelPtr.reset();
215  }
216 }
std::shared_ptr< SeparableKernel > makeWarpingKernel(std::string name)
Return a warping kernel given its name.
void setMaskWarpingKernel(SeparableKernel const &maskWarpingKernel)
set the mask warping kernel

◆ setWarpingKernel()

void lsst::afw::math::WarpingControl::setWarpingKernel ( SeparableKernel const &  warpingKernel)

set the warping kernel

Exceptions
lsst::pex::exceptions::InvalidParameterErrorif new kernel pointer is empty.
Parameters
warpingKernelwarping kernel

Definition at line 191 of file warpExposure.cc.

191  {
192  if (_maskWarpingKernelPtr) {
193  _testWarpingKernels(warpingKernel, *_maskWarpingKernelPtr);
194  }
195  std::shared_ptr<SeparableKernel> warpingKernelPtr(
196  std::static_pointer_cast<SeparableKernel>(warpingKernel.clone()));
197  _warpingKernelPtr = warpingKernelPtr;
198 }

◆ setWarpingKernelName()

void lsst::afw::math::WarpingControl::setWarpingKernelName ( std::string const &  warpingKernelName)

set the warping kernel by name

Parameters
warpingKernelNamename of warping kernel

Definition at line 186 of file warpExposure.cc.

186  {
188  setWarpingKernel(*warpingKernelPtr);
189 }
afw::table::Key< std::string > warpingKernelName
Definition: CoaddPsf.cc:341
std::shared_ptr< SeparableKernel > makeWarpingKernel(std::string name)
Return a warping kernel given its name.
void setWarpingKernel(SeparableKernel const &warpingKernel)
set the warping kernel

The documentation for this class was generated from the following files: