2 #if !defined(LSST_MEAS_ALGORITHMS_SPATIALMODELPSF_H)
3 #define LSST_MEAS_ALGORITHMS_SPATIALMODELPSF_H
39 #include "lsst/pex/policy.h"
40 #include "lsst/afw/detection/Psf.h"
41 #include "lsst/afw/math/Kernel.h"
42 #include "lsst/afw/math/SpatialCell.h"
43 #include "lsst/afw/geom/Extent.h"
47 namespace algorithms {
49 template<
typename PixelT>
50 std::pair<std::shared_ptr<lsst::afw::math::LinearCombinationKernel>, std::vector<double> >
52 lsst::afw::geom::Extent2I
const& dims,
54 int const nEigenComponents,
55 int const spatialOrder,
57 int const nStarPerCell=-1,
58 bool const constantWeight=
true,
62 template<
typename PixelT>
63 int countPsfCandidates(lsst::afw::math::SpatialCellSet
const& psfCells,
int const nStarPerCell=-1);
65 template<
typename PixelT>
66 std::pair<bool, double>
68 lsst::afw::math::SpatialCellSet
const& psfCells,
69 int const nStarPerCell = -1,
70 double const tolerance = 1e-5,
71 double const lambda = 0.0);
72 template<
typename PixelT>
73 std::pair<bool, double>
75 lsst::afw::math::SpatialCellSet
const& psfCells,
76 bool const doNonLinearFit,
77 int const nStarPerCell = -1,
78 double const tolerance = 1e-5,
79 double const lambda = 0.0);
81 template<
typename ImageT>
82 double subtractPsf(lsst::afw::detection::Psf
const& psf, ImageT *data,
double x,
double y,
83 double psfFlux=std::numeric_limits<double>::quiet_NaN());
85 template<
typename Image>
86 std::pair<std::vector<double>, lsst::afw::math::KernelList>
88 Image
const& image, lsst::afw::geom::Point2D
const& pos);
90 template<
typename Image>
91 std::pair<std::shared_ptr<lsst::afw::math::Kernel>, std::pair<double, double> >
93 Image
const& image, lsst::afw::geom::Point2D
const& pos);
int countPsfCandidates(lsst::afw::math::SpatialCellSet const &psfCells, int const nStarPerCell=-1)
double subtractPsf(lsst::afw::detection::Psf const &psf, ImageT *data, double x, double y, double psfFlux=std::numeric_limits< double >::quiet_NaN())
std::pair< std::vector< double >, lsst::afw::math::KernelList > fitKernelParamsToImage(lsst::afw::math::LinearCombinationKernel const &kernel, Image const &image, lsst::afw::geom::Point2D const &pos)
std::pair< bool, double > fitSpatialKernelFromPsfCandidates(lsst::afw::math::Kernel *kernel, lsst::afw::math::SpatialCellSet const &psfCells, int const nStarPerCell=-1, double const tolerance=1e-5, double const lambda=0.0)
std::pair< std::shared_ptr< lsst::afw::math::LinearCombinationKernel >, std::vector< double > > createKernelFromPsfCandidates(lsst::afw::math::SpatialCellSet const &psfCells, lsst::afw::geom::Extent2I const &dims, lsst::afw::geom::Point2I const &xy0, int const nEigenComponents, int const spatialOrder, int const ksize, int const nStarPerCell=-1, bool const constantWeight=true, int const border=3)
std::pair< std::shared_ptr< lsst::afw::math::Kernel >, std::pair< double, double > > fitKernelToImage(lsst::afw::math::LinearCombinationKernel const &kernel, Image const &image, lsst::afw::geom::Point2D const &pos)