268 "Error: variance less than 0.0");
272 "Error: variance equals 0.0, cannot inverse variance weight");
278 unsigned int const nKernelParameters = basisList.
size();
280 unsigned int const nParameters = nKernelParameters + nBackgroundParameters;
317 unsigned int const startCol = goodBBox.
getMinX();
318 unsigned int const startRow = goodBBox.
getMinY();
320 unsigned int endCol = goodBBox.
getMaxX() + 1;
321 unsigned int endRow = goodBBox.
getMaxY() + 1;
336 startRow, startCol, endRow-startRow, endCol-startCol
337 ).array().inverse().matrix();
340 eigenTemplate.resize(eigenTemplate.rows()*eigenTemplate.cols(), 1);
341 eigenScience.resize(eigenScience.rows()*eigenScience.cols(), 1);
342 eigeniVariance.resize(eigeniVariance.rows()*eigeniVariance.cols(), 1);
353 for (kiter = basisList.
begin(); kiter != basisList.
end(); ++kiter, ++eiter) {
360 cMat.resize(cMat.size(), 1);
365 double time = t.elapsed();
366 LOGL_DEBUG(
"TRACE3.ip.diffim.StaticKernelSolution.build",
367 "Total compute time to do basis convolutions : %.2f s", time);
374 Eigen::MatrixXd cMat(eigenTemplate.col(0).size(), nParameters);
377 for (
unsigned int kidxj = 0; eiterj != eiterE; eiterj++, kidxj++) {
378 cMat.col(kidxj) = eiterj->col(0);
382 cMat.col(nParameters-1).fill(1.);
385 _ivVec = eigeniVariance.col(0);
386 _iVec = eigenScience.col(0);
Eigen::MatrixXd _cMat
K_i x R.
Eigen::VectorXd _bVec
Derived least squares B vector.
Provides consistent interface for LSST exceptions.
Eigen::VectorXd _iVec
Vectorized I.
#define LOGL_DEBUG(logger, message...)
Log a debug-level message using a varargs/printf style interface.
Eigen::VectorXd _ivVec
Inverse variance.
A class to evaluate image statistics.
bool _fitForBackground
Background terms included in fit.
lsst::geom::Box2I getBBox(ImageOrigin origin=PARENT) const
int getMaxY() const noexcept
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
Handle a watered-down front-end to the constructor (no variance)
A kernel that is a linear combination of fixed basis kernels.
Eigen::MatrixXd imageToEigenMatrix(lsst::afw::image::Image< PixelT > const &img)
Turns a 2-d Image into a 2-d Eigen Matrix.
T dynamic_pointer_cast(T... args)
void convolve(OutImageT &convolvedImage, InImageT const &inImage, KernelT const &kernel, ConvolutionControl const &convolutionControl=ConvolutionControl())
Convolve an Image or MaskedImage with a Kernel, setting pixels of an existing output image...
int getMaxX() const noexcept
double getValue(Property const prop=NOTHING) const
Return the value of the desired property (if specified in the constructor)
Eigen::MatrixXd _mMat
Derived least squares M matrix.
int getMinX() const noexcept
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
std::shared_ptr< lsst::afw::math::Kernel > _kernel
Derived single-object convolution kernel.
lsst::geom::Extent2I getDimensions() const
Return the image's size; useful for passing to constructors.
An integer coordinate rectangle.
A class to represent a 2-dimensional array of pixels.
int getMinY() const noexcept