| LSSTApplications
    20.0.0
    LSSTDataManagementBasePackage | 
 
 
 
Go to the documentation of this file.
   34 namespace algorithms {
 
   38 inline double min4(
double a, 
double b, 
double c, 
double d) {
 
   42 inline double max4(
double a, 
double b, 
double c, 
double d) {
 
   49     int nx = im.getWidth();
 
   50     int ny = im.getHeight();
 
   53     out = std::make_shared<afw::detection::Psf::Image>(nx + 2 * xPad, ny + 2 * yPad);
 
   54     out->setXY0(im.getX0() - xPad, im.getY0() - yPad);
 
   63     static const int dst_padding = 0;
 
   69     static const double maxTransformCoeff = 200.0;
 
   72         throw LSST_EXCEPT(pex::exceptions::RangeError, 
"Unexpectedly large transform passed to WarpedPsf");
 
   76     int in_xlo = 
bbox.getMinX();
 
   77     int in_xhi = 
bbox.getMinX() + 
bbox.getWidth() - 1;
 
   78     int in_ylo = 
bbox.getMinY();
 
   79     int in_yhi = 
bbox.getMinY() + 
bbox.getHeight() - 1;
 
   90     int out_xlo = 
floor(min4(c00.getX(), c01.getX(), c10.getX(), c11.getX())) - dst_padding;
 
   91     int out_ylo = 
floor(min4(c00.getY(), c01.getY(), c10.getY(), c11.getY())) - dst_padding;
 
   92     int out_xhi = 
ceil(max4(c00.getX(), c01.getX(), c10.getX(), c11.getX())) + dst_padding;
 
   93     int out_yhi = 
ceil(max4(c00.getY(), c01.getY(), c10.getY(), c11.getY())) + dst_padding;
 
  115            afw::math::WarpingControl 
const &wc) {
 
  119     afw::math::SeparableKernel 
const &kernel = *wc.getWarpingKernel();
 
  121     int const xPad = 
std::max(center.getX(), kernel.getWidth() - center.getX());
 
  122     int const yPad = 
std::max(center.getY(), kernel.getHeight() - center.getY());
 
  142           _undistortedPsf(undistortedPsf),
 
  143           _distortion(distortion),
 
  144           _warpingControl(control) {
 
  152           _undistortedPsf(undistortedPsf),
 
  153           _distortion(distortion),
 
  154           _warpingControl(new 
afw::math::WarpingControl(kernelName, 
"", cache)) {
 
  158 void WarpedPsf::_init() {
 
  161                           "Undistorted Psf passed to WarpedPsf must not be None/NULL");
 
  166     if (!_warpingControl) {
 
  168                           "WarpingControl passed to WarpedPsf must not be None/NULL");
 
  192     PTR(
Image) im = _undistortedPsf->computeKernelImage(tp, color);
 
  196     PTR(afw::detection::Psf::Psf::Image) ret = warpAffine(*im, srcToDest, *_warpingControl);
 
  198     double normFactor = 1.0;
 
  207             normFactor += *imPtr;
 
  210     if (normFactor == 0.0) {
 
  
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
Parameters to control convolution.
#define CONST_PTR(...)
A shared pointer to a const object.
int getHeight() const noexcept
lsst::geom::AffineTransform linearizeTransform(TransformPoint2ToPoint2 const &original, lsst::geom::Point2D const &inPoint)
Approximate a Transform by its local linearization.
virtual geom::Point2D getAveragePosition() const
Return the average of the positions of the stars that went into this Psf.
virtual boost::shared_ptr< afw::detection::Psf > clone() const
Polymorphic deep copy. Usually unnecessary, as Psfs are immutable.
Point< double, 2 > Point2D
image::Image< Pixel > Image
Image type returned by computeImage.
boost::shared_ptr< afw::detection::Psf const > _undistortedPsf
Reports errors in the logical structure of the program.
A Psf class that maps an arbitrary Psf through a coordinate transformation.
_view_t::x_iterator x_iterator
An iterator for traversing the pixels in a row.
WarpedPsf(boost::shared_ptr< afw::detection::Psf const > undistortedPsf, boost::shared_ptr< afw::geom::TransformPoint2ToPoint2 const > distortion, boost::shared_ptr< afw::math::WarpingControl const > control)
Construct WarpedPsf from unwarped psf and distortion.
A base class for image defects.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
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.
Reports invalid arguments.
virtual boost::shared_ptr< afw::detection::Psf > resized(int width, int height) const
Return a clone with specified kernel dimensions.
An integer coordinate rectangle.
A polymorphic base class for representing an image's Point Spread Function.
Extent< int, N > floor(Extent< double, N > const &input) noexcept
Return the component-wise floor (round towards more negative).
Extent< int, N > ceil(Extent< double, N > const &input) noexcept
Return the component-wise ceil (round towards more positive).
std::shared_ptr< TransformPoint2ToPoint2 > makeTransform(lsst::geom::AffineTransform const &affine)
Wrap an lsst::geom::AffineTransform as a Transform.
Describe the colour of a source.
An intermediate base class for Psfs that use an image representation.
boost::shared_ptr< afw::geom::TransformPoint2ToPoint2 const > _distortion