9 : you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either
version 3 of the License, or
12 * (at your option) any later
version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License
for more
details.
18 *
19 * You should have received a copy of the LSST License Statement and
20 * the GNU General Public License along with this program. If not,
21 * see <http:
22 */
23
24
25
26
27#include <cassert>
28#include <cmath>
29#include <limits>
30#include <memory>
31#include <sstream>
32#include <string>
33#include <vector>
34#include <utility>
35#include <regex>
36
38
51
53
55
58namespace math {
59
60
61
62
63
64
65
66
67
68
69
70
71
72static inline void checkWarpingKernelParameter(const SeparableKernel *p, unsigned int ind, double value) {
73 if (ind > 1) {
75 "bad ind argument in WarpingKernel::setKernelParameter()");
76 }
77 int ctr = p->getCtr()[ind];
78 int size = p->getDimensions()[ind];
79
80 if (ctr == (size - 1) / 2) {
81 if (value < -1e-6 || value > 1 + 1e-6) {
83 "bad coordinate in WarpingKernel::setKernelParameter()");
84 }
85 } else if (ctr == (size + 1) / 2) {
86 if (value < -1 - 1e-6 || value > 1e-6) {
88 "bad coordinate in WarpingKernel::setKernelParameter()");
89 }
90 } else {
92 "bad ctr value in WarpingKernel::setKernelParameter()");
93 }
94}
95
98}
99
101
103 checkWarpingKernelParameter(this, ind, value);
105}
106
109}
110
112
113
114
115
116
117
118
119
120
121
122
123
125}
126
128 checkWarpingKernelParameter(this, ind, value);
130}
131
134 os << "_BilinearFunction1: ";
135 os << Function1<Kernel::Pixel>::toString(
prefix);
136 return os.str();
137}
138
140 return std::make_shared<NearestWarpingKernel>();
141}
142
144
145 return static_cast<double>((
fabs(this->_params[0]) < 0.5) == (
fabs(
x) < 0.5));
146}
147
149 checkWarpingKernelParameter(this, ind, value);
151}
152
155 os << "_NearestFunction1: ";
156 os << Function1<Kernel::Pixel>::toString(
prefix);
157 return os.str();
158}
159
160namespace {
161
162struct LanczosKernelPersistenceHelper {
164 table::Key<int>
order;
165
166 static LanczosKernelPersistenceHelper const &get() {
167 static LanczosKernelPersistenceHelper const instance;
168 return instance;
169 }
170
171 LanczosKernelPersistenceHelper(LanczosKernelPersistenceHelper const &) = delete;
172 LanczosKernelPersistenceHelper(LanczosKernelPersistenceHelper &&) = delete;
173 LanczosKernelPersistenceHelper &operator=(LanczosKernelPersistenceHelper const &) = delete;
174 LanczosKernelPersistenceHelper &operator=(LanczosKernelPersistenceHelper &&) = delete;
175
176private:
177 LanczosKernelPersistenceHelper()
178 : schema(),
order(schema.addField<
int>(
"order",
"order of Lanczos function")) {}
179};
180
181class : public table::io::PersistableFactory {
183 table::io::CatalogVector const &catalogs) const override {
184 auto const &
keys = LanczosKernelPersistenceHelper::get();
187 afw::table::BaseRecord const &record = catalogs.front().front();
189 return std::make_shared<LanczosWarpingKernel>(record.get(
keys.order));
190 }
191
193} lanczosFactory("LanczosWarpingKernel");
194
195template <class T>
196class DefaultPersistableFactory : public table::io::PersistableFactory {
198 table::io::CatalogVector const &catalogs) const override {
200 return std::make_shared<T>();
201 }
202
203 using table::io::PersistableFactory::PersistableFactory;
204};
205
206DefaultPersistableFactory<BilinearWarpingKernel> bilinearFactory("BilinearWarpingKernel");
207DefaultPersistableFactory<NearestWarpingKernel> nearestFactory("NearestWarpingKernel");
208
209}
210
212 auto const &
keys = LanczosKernelPersistenceHelper::get();
215 record->set(
keys.order, getOrder());
216 handle.saveCatalog(catalog);
217}
218
220
222
226 static const std::regex LanczosRE(
"lanczos(\\d+)");
227 if (name == "bilinear") {
230 std::string orderStr(matches[1].first, matches[1].second);
232 return KernelPtr(
new LanczosWarpingKernel(
order));
233 } else if (name == "nearest") {
234 return KernelPtr(new NearestWarpingKernel());
235 } else {
237 }
238}
239
241 if (_warpingKernelPtr->getCacheSize() != _cacheSize) {
242 _warpingKernelPtr->computeCache(_cacheSize);
243 }
244 return _warpingKernelPtr;
245};
246
249 setWarpingKernel(*warpingKernelPtr);
250}
251
253 if (_maskWarpingKernelPtr) {
254 _testWarpingKernels(warpingKernel, *_maskWarpingKernelPtr);
255 }
257 std::static_pointer_cast<SeparableKernel>(warpingKernel.clone()));
258 _warpingKernelPtr = warpingKernelPtr;
259}
260
262 if (_maskWarpingKernelPtr) {
263 if (_maskWarpingKernelPtr->getCacheSize() != _cacheSize) {
264 _maskWarpingKernelPtr->computeCache(_cacheSize);
265 }
266 }
267 return _maskWarpingKernelPtr;
268}
269
271 if (!maskWarpingKernelName.
empty()) {
273 setMaskWarpingKernel(*maskWarpingKernelPtr);
274 } else {
275 _maskWarpingKernelPtr.reset();
276 }
277}
278
280 _testWarpingKernels(*_warpingKernelPtr, maskWarpingKernel);
281 _maskWarpingKernelPtr = std::static_pointer_cast<SeparableKernel>(maskWarpingKernel.clone());
282}
283
284void WarpingControl::_testWarpingKernels(
SeparableKernel const &warpingKernel,
288 warpingKernel.getDimensions());
291 maskWarpingKernel.getDimensions());
292 if (!kernelBBox.
contains(maskKernelBBox)) {
293 throw LSST_EXCEPT(pex::exceptions::InvalidParameterError,
294 "warping kernel is smaller than mask warping kernel");
295 }
296}
297
298namespace {
299
300struct WarpingControlPersistenceHelper {
308
309 static WarpingControlPersistenceHelper const &get() {
310 static WarpingControlPersistenceHelper const instance;
311 return instance;
312 }
313
314 WarpingControlPersistenceHelper(WarpingControlPersistenceHelper const &) = delete;
315 WarpingControlPersistenceHelper(WarpingControlPersistenceHelper &&) = delete;
316 WarpingControlPersistenceHelper &operator=(WarpingControlPersistenceHelper const &) = delete;
317 WarpingControlPersistenceHelper &operator=(WarpingControlPersistenceHelper &&) = delete;
318
319private:
320 WarpingControlPersistenceHelper()
321 : schema(),
323 schema.addField<
int>(
"warpingKernelIndex",
"archive ID of nested warping kernel")),
324 hasMaskKernel(schema.addField<table::Flag>(
"hasMaskKernel",
"whether a mask kernel is stored")),
326 "archive ID of nested mask kernel. "
327 "Valid only if hasMaskKernel")),
328 cacheSize(schema.addField<
int>(
"cacheSize",
"Cache size for warping kernel(s)")),
330 "Distance over which WCS can be linearly interpolated")),
332 "growFullMask", "bits to grow to full width of image/variance kernel")) {}
333};
334
335std::string _getWarpingControlPersistenceName() {
return "WarpingControl"; }
336
337class : public table::io::PersistableFactory {
339 table::io::CatalogVector const &catalogs) const override {
340 auto const &
keys = WarpingControlPersistenceHelper::get();
343 afw::table::BaseRecord const &record = catalogs.front().front();
345
346
347 auto control = std::make_shared<WarpingControl>(
"bilinear",
"", record.get(
keys.cacheSize),
348 record.get(
keys.interpLength),
349 record.get(
keys.growFullMask));
350
351
352
353 control->setWarpingKernel(*archive.get<
SeparableKernel>(record.get(
keys.warpingKernelIndex)));
354 if (record.get(
keys.hasMaskKernel)) {
355 control->setMaskWarpingKernel(*archive.get<
SeparableKernel>(record.get(
keys.maskKernelIndex)));
356 }
357 return control;
358 }
359
361} controlFactory(_getWarpingControlPersistenceName());
362
363}
364
366
368
370 return _warpingKernelPtr->isPersistable() &&
371 (!hasMaskWarpingKernel() || _maskWarpingKernelPtr->isPersistable());
372}
373
375 auto const &
keys = WarpingControlPersistenceHelper::get();
378
379 record->set(
keys.warpingKernelIndex, handle.put(_warpingKernelPtr));
380 record->set(
keys.hasMaskKernel, hasMaskWarpingKernel());
381 if (hasMaskWarpingKernel()) {
382 record->set(
keys.maskKernelIndex, handle.put(_maskWarpingKernelPtr));
383 }
384 record->set(
keys.cacheSize, _cacheSize);
385 record->set(
keys.interpLength, _interpLength);
386 record->set(
keys.growFullMask, _growFullMask);
387
388 handle.saveCatalog(catalog);
389}
390
391template <typename DestExposureT, typename SrcExposureT>
392int warpExposure(DestExposureT &destExposure, SrcExposureT
const &srcExposure, WarpingControl
const &control,
393 typename DestExposureT::MaskedImageT::SinglePixel padValue) {
394 if (!destExposure.hasWcs()) {
396 }
397 if (!srcExposure.hasWcs()) {
399 }
400 typename DestExposureT::MaskedImageT
mi = destExposure.getMaskedImage();
401 if (srcExposure.getInfo()->hasId()) {
402 destExposure.getInfo()->setId(srcExposure.getInfo()->getId());
403 }
404 destExposure.setPhotoCalib(srcExposure.getPhotoCalib());
405 destExposure.setFilter(srcExposure.getFilter());
406 destExposure.getInfo()->setVisitInfo(srcExposure.getInfo()->getVisitInfo());
407 return warpImage(mi, *destExposure.getWcs(), srcExposure.getMaskedImage(), *srcExposure.getWcs(), control,
408 padValue);
409}
410
411namespace {
412
414 int destCol,
415 int destRow,
417 geom::SkyWcs const &destWcs,
418 geom::SkyWcs const &srcWcs)
419{
422 return srcWcs.skyToPixel(destWcs.pixelToSky(destPix));
423}
424
425inline double computeRelativeArea(
428 &leftSrcPos,
430{
433
434 return std::abs(dSrcA.getX() * dSrcB.getY() - dSrcA.getY() * dSrcB.getX());
435}
436
437}
438
439template <typename DestImageT, typename SrcImageT>
440int warpImage(DestImageT &destImage, geom::SkyWcs
const &destWcs, SrcImageT
const &srcImage,
441 geom::SkyWcs const &srcWcs, WarpingControl const &control,
442 typename DestImageT::SinglePixel padValue) {
443 auto srcToDest = geom::makeWcsPairTransform(srcWcs, destWcs);
444 return warpImage(destImage, srcImage, *srcToDest, control, padValue);
445}
446
447template <typename DestImageT, typename SrcImageT>
448int warpImage(DestImageT &destImage, SrcImageT
const &srcImage,
449 geom::TransformPoint2ToPoint2 const &srcToDest, WarpingControl const &control,
450 typename DestImageT::SinglePixel padValue) {
453 }
454 if (destImage.getBBox(image::LOCAL).isEmpty()) {
455 return 0;
456 }
457
459 try {
460 warpingKernelPtr->shrinkBBox(srcImage.getBBox(image::LOCAL));
462 for (
int y = 0, height = destImage.getHeight();
y < height; ++
y) {
463 for (
typename DestImageT::x_iterator destPtr = destImage.row_begin(
y),
end = destImage.row_end(
y);
464 destPtr !=
end; ++destPtr) {
465 *destPtr = padValue;
466 }
467 }
468 return 0;
469 }
471
473 std::dynamic_pointer_cast<LanczosWarpingKernel>(warpingKernelPtr);
474
475 int numGoodPixels = 0;
476
477
478 auto const parentDestToParentSrc = srcToDest.inverted();
479 std::vector<double> const localDestToParentDestVec = {
static_cast<double>(destImage.getX0()),
480 static_cast<double>(destImage.getY0())};
481 auto const localDestToParentDest = geom::TransformPoint2ToPoint2(
ast::ShiftMap(localDestToParentDestVec));
482 auto const localDestToParentSrc = localDestToParentDest.then(*parentDestToParentSrc);
483
484
485 int const srcWidth = srcImage.getWidth();
486 int const srcHeight = srcImage.getHeight();
487 LOGL_DEBUG(
"TRACE2.lsst.afw.math.warp",
"source image width=%d; height=%d", srcWidth, srcHeight);
488
489 int const destWidth = destImage.getWidth();
490 int const destHeight = destImage.getHeight();
491 LOGL_DEBUG(
"TRACE2.lsst.afw.math.warp",
"remap image width=%d; height=%d", destWidth, destHeight);
492
493
494 LOGL_DEBUG(
"TRACE3.lsst.afw.math.warp",
"Remapping masked image");
495
496 int const maxCol = destWidth - 1;
497 int const maxRow = destHeight - 1;
498
499 detail::WarpAtOnePoint<DestImageT, SrcImageT> warpAtOnePoint(srcImage, control, padValue);
500
502
503
504
505
506 int const numColEdges = 2 + ((destWidth - 1) /
interpLength);
507
508
509
511 edgeColList.
reserve(numColEdges);
512
513
514
516 invWidthList.
reserve(numColEdges);
517
518
521 for (
int prevEndCol = -1; prevEndCol < maxCol; prevEndCol +=
interpLength) {
523 if (endCol > maxCol) {
524 endCol = maxCol;
525 }
527 assert(endCol - prevEndCol > 0);
528 invWidthList.
push_back(1.0 /
static_cast<double>(endCol - prevEndCol));
529 }
530 assert(edgeColList.
back() == maxCol);
531
532
534
535
536
537
538
539
540
542 std::vector<lsst::geom::Point2D>::iterator const srcPosView = srcPosList.begin() + 1;
543
545 endColPosList.
reserve(numColEdges);
546
547
548 for (int endCol : edgeColList) {
550 }
551 auto rightSrcPosList = localDestToParentSrc->applyForward(endColPosList);
552 srcPosView[-1] = rightSrcPosList[0];
553 for (
int colBand = 1, endBand = edgeColList.
size(); colBand < endBand; ++colBand) {
554 int const prevEndCol = edgeColList[colBand - 1];
555 int const endCol = edgeColList[colBand];
557
559 (rightSrcPosList[colBand] - leftSrcPos) * invWidthList[colBand];
560
561 for (
int col = prevEndCol + 1;
col <= endCol; ++
col) {
562 srcPosView[
col] = srcPosView[
col - 1] + xDeltaSrcPos;
563 }
564 }
565
566 int endRow = -1;
567 while (endRow < maxRow) {
568
569
570 int prevEndRow = endRow;
572 if (endRow > maxRow) {
573 endRow = maxRow;
574 }
575 assert(endRow - prevEndRow > 0);
576 double interpInvHeight = 1.0 / static_cast<double>(endRow - prevEndRow);
577
578
581 for (int endCol : edgeColList) {
583 }
584 auto bottomSrcPosList = localDestToParentSrc->applyForward(destRowPosList);
585 for (
int colBand = 0, endBand = edgeColList.
size(); colBand < endBand; ++colBand) {
586 int endCol = edgeColList[colBand];
587 yDeltaSrcPosList[colBand] =
588 (bottomSrcPosList[colBand] - srcPosView[endCol]) * interpInvHeight;
589 }
590
591 for (
int row = prevEndRow + 1;
row <= endRow; ++
row) {
592 typename DestImageT::x_iterator destXIter = destImage.row_begin(
row);
593 srcPosView[-1] += yDeltaSrcPosList[0];
594 for (
int colBand = 1, endBand = edgeColList.
size(); colBand < endBand; ++colBand) {
595
596
597 int const prevEndCol = edgeColList[colBand - 1];
598 int const endCol = edgeColList[colBand];
599
600
601
602
606
607 for (
int col = prevEndCol + 1;
col <= endCol; ++
col, ++destXIter) {
610 double relativeArea = computeRelativeArea(srcPos, leftSrcPos, srcPosView[
col]);
611
612 srcPosView[
col] = srcPos;
613
614 if (warpAtOnePoint(
615 destXIter, srcPos, relativeArea,
617 ++numGoodPixels;
618 }
619 }
620 }
621 }
622 }
623
624 } else {
625
626
627
628
630 destPosList.
reserve(1 + destWidth);
631 for (
int col = -1;
col < destWidth; ++
col) {
633 }
634 auto prevSrcPosList = localDestToParentSrc->applyForward(destPosList);
635
636 for (
int row = 0;
row < destHeight; ++
row) {
638 for (
int col = -1;
col < destWidth; ++
col) {
640 }
641 auto srcPosList = localDestToParentSrc->applyForward(destPosList);
642
643 typename DestImageT::x_iterator destXIter = destImage.row_begin(
row);
644 for (
int col = 0;
col < destWidth; ++
col, ++destXIter) {
645
646 auto srcPos = srcPosList[
col + 1];
647 double relativeArea =
648 computeRelativeArea(srcPos, prevSrcPosList[
col], prevSrcPosList[
col + 1]);
649
650 if (warpAtOnePoint(destXIter, srcPos, relativeArea,
652 ++numGoodPixels;
653 }
654 }
655
656
657 swap(srcPosList, prevSrcPosList);
658 }
659 }
660
661 return numGoodPixels;
662}
663
664template <typename DestImageT, typename SrcImageT>
668 typename DestImageT::SinglePixel padValue) {
669
670 if ((destImage.getWidth() != srcImage.getWidth()) || (destImage.getHeight() != srcImage.getHeight()) ||
671 (destImage.getXY0() != srcImage.getXY0())) {
673 errStream << "src and dest images must have same size and xy0.";
675 }
676
677
678 SrcImageT srcImageCopy(srcImage, true);
679 srcImageCopy.setXY0(0, 0);
680 destImage.setXY0(0, 0);
683
684
685
686
689
690
691#if 0
692 static float t = 0.0;
693 float t_before = 1.0*
clock()/CLOCKS_PER_SEC;
694 int n =
warpImage(destImage, srcImageCopy, affTran, control, padValue);
695 float t_after = 1.0*
clock()/CLOCKS_PER_SEC;
696 float dt = t_after - t_before;
697 t += dt;
698 std::cout <<srcImage.getWidth()<<
"x"<<srcImage.getHeight()<<
": "<< dt <<
" "<< t <<
std::endl;
699#else
700 int n =
warpImage(destImage, srcImageCopy, *affineTransform22, control, padValue);
701#endif
702
703
704 destImage.setXY0(srcImage.getXY0());
705
706 return n;
707}
708
709
710
711
713
714#define EXPOSURE(PIXTYPE) image::Exposure<PIXTYPE, image::MaskPixel, image::VariancePixel>
715#define MASKEDIMAGE(PIXTYPE) image::MaskedImage<PIXTYPE, image::MaskPixel, image::VariancePixel>
716#define IMAGE(PIXTYPE) image::Image<PIXTYPE>
717#define NL
718
719#define INSTANTIATE(DESTIMAGEPIXELT, SRCIMAGEPIXELT) \
720 template int warpCenteredImage( \
721 IMAGE(DESTIMAGEPIXELT) & destImage, IMAGE(SRCIMAGEPIXELT) const &srcImage, \
722 lsst::geom::LinearTransform const &linearTransform, lsst::geom::Point2D const ¢erPosition, \
723 WarpingControl const &control, IMAGE(DESTIMAGEPIXELT)::SinglePixel padValue); \
724 NL template int warpCenteredImage( \
725 MASKEDIMAGE(DESTIMAGEPIXELT) & destImage, MASKEDIMAGE(SRCIMAGEPIXELT) const &srcImage, \
726 lsst::geom::LinearTransform const &linearTransform, lsst::geom::Point2D const ¢erPosition, \
727 WarpingControl const &control, MASKEDIMAGE(DESTIMAGEPIXELT)::SinglePixel padValue); \
728 NL template int warpImage(IMAGE(DESTIMAGEPIXELT) & destImage, IMAGE(SRCIMAGEPIXELT) const &srcImage, \
729 geom::TransformPoint2ToPoint2 const &srcToDest, WarpingControl const &control, \
730 IMAGE(DESTIMAGEPIXELT)::SinglePixel padValue); \
731 NL template int warpImage(MASKEDIMAGE(DESTIMAGEPIXELT) & destImage, \
732 MASKEDIMAGE(SRCIMAGEPIXELT) const &srcImage, \
733 geom::TransformPoint2ToPoint2 const &srcToDest, WarpingControl const &control, \
734 MASKEDIMAGE(DESTIMAGEPIXELT)::SinglePixel padValue); \
735 NL template int warpImage(IMAGE(DESTIMAGEPIXELT) & destImage, geom::SkyWcs const &destWcs, \
736 IMAGE(SRCIMAGEPIXELT) const &srcImage, geom::SkyWcs const &srcWcs, \
737 WarpingControl const &control, IMAGE(DESTIMAGEPIXELT)::SinglePixel padValue); \
738 NL template int warpImage(MASKEDIMAGE(DESTIMAGEPIXELT) & destImage, geom::SkyWcs const &destWcs, \
739 MASKEDIMAGE(SRCIMAGEPIXELT) const &srcImage, geom::SkyWcs const &srcWcs, \
740 WarpingControl const &control, \
741 MASKEDIMAGE(DESTIMAGEPIXELT)::SinglePixel padValue); \
742 NL template int warpExposure(EXPOSURE(DESTIMAGEPIXELT) & destExposure, \
743 EXPOSURE(SRCIMAGEPIXELT) const &srcExposure, WarpingControl const &control, \
744 EXPOSURE(DESTIMAGEPIXELT)::MaskedImageT::SinglePixel padValue);
745
756}
757
766
767}
768}
#define INSTANTIATE(FROMSYS, TOSYS)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
LSST DM logging module built on log4cxx.
#define LOGL_DEBUG(logger, message...)
Log a debug-level message using a varargs/printf style interface.
Implementation of the Photometric Calibration class.
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
ShiftMap is a linear Mapping which shifts each axis by a specified constant value.
std::string toString(std::string const &="") const override
Return string representation.
Kernel::Pixel operator()(double x) const override
Solve bilinear equation.
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.
std::vector< double > _params
int getWidth() const
Return the Kernel's width.
int getOrder() const
get the order of the kernel
LanczosWarpingKernel(int order)
void setKernelParameter(unsigned int ind, double value) const override
Set one kernel parameter.
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Kernel::Pixel operator()(double x) const override
Solve nearest neighbor equation.
std::string toString(std::string const &="") const override
Return string representation.
std::shared_ptr< Kernel > clone() const override
Return a pointer to a deep copy of this kernel.
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
void setKernelParameter(unsigned int ind, double value) const override
Set one kernel parameter.
void setKernelParameter(unsigned int ind, double value) const override
Set one kernel parameter.
SeparableKernel()
Construct an empty spatially invariant SeparableKernel of size 0x0.
void setWarpingKernel(SeparableKernel const &warpingKernel)
set the warping kernel
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
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
void setMaskWarpingKernel(SeparableKernel const &maskWarpingKernel)
set the mask warping kernel
std::shared_ptr< SeparableKernel > getWarpingKernel() const
get the warping kernel
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
std::shared_ptr< SeparableKernel > getMaskWarpingKernel() const
get the mask warping kernel
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
PersistableFactory(std::string const &name)
Constructor for the factory.
io::OutputArchiveHandle OutputArchiveHandle
An integer coordinate rectangle.
bool contains(Point2I const &point) const noexcept
Return true if the box contains the point.
Reports invalid arguments.
T emplace_back(T... args)
double indexToPosition(double ind)
Convert image index to image position.
bool imagesOverlap(ImageBase< T1 > const &image1, ImageBase< T2 > const &image2)
Return true if the pixels for two images or masks overlap in memory.
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.
CatalogT< BaseRecord > BaseCatalog
Extent< double, 2 > Extent2D
afw::table::Key< std::string > warpingKernelName
typename ImageT::image_category image_category
table::Key< int > warpingKernelIndex
std::shared_ptr< table::io::Persistable > read(table::io::InputArchive const &archive, table::io::CatalogVector const &catalogs) const override
table::Key< int > interpLength
table::Key< image::MaskPixel > growFullMask
table::Key< int > cacheSize
table::Key< int > maskKernelIndex
table::Key< table::Flag > hasMaskKernel