lsst.meas.algorithms  13.0-24-g22030a45+5
SpatialModelPsf.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 #if !defined(LSST_MEAS_ALGORITHMS_SPATIALMODELPSF_H)
3 #define LSST_MEAS_ALGORITHMS_SPATIALMODELPSF_H
4 
5 /*
6  * LSST Data Management System
7  * Copyright 2008, 2009, 2010 LSST Corporation.
8  *
9  * This product includes software developed by the
10  * LSST Project (http://www.lsst.org/).
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the LSST License Statement and
23  * the GNU General Public License along with this program. If not,
24  * see <http://www.lsstcorp.org/LegalNotices/>.
25  */
26 
34 #include <memory>
35 #include <utility>
36 #include <vector>
37 
38 #include "lsst/afw.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"
44 
45 namespace lsst {
46 namespace meas {
47 namespace algorithms {
48 
49 template<typename PixelT>
50 std::pair<std::shared_ptr<lsst::afw::math::LinearCombinationKernel>, std::vector<double> >
51 createKernelFromPsfCandidates(lsst::afw::math::SpatialCellSet const& psfCells,
52  lsst::afw::geom::Extent2I const& dims,
53  lsst::afw::geom::Point2I const& xy0,
54  int const nEigenComponents,
55  int const spatialOrder,
56  int const ksize,
57  int const nStarPerCell=-1,
58  bool const constantWeight=true,
59  int const border=3
60  );
61 
62 template<typename PixelT>
63 int countPsfCandidates(lsst::afw::math::SpatialCellSet const& psfCells, int const nStarPerCell=-1);
64 
65 template<typename PixelT>
66 std::pair<bool, double>
67 fitSpatialKernelFromPsfCandidates(lsst::afw::math::Kernel *kernel,
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>
74 fitSpatialKernelFromPsfCandidates(lsst::afw::math::Kernel *kernel,
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);
80 
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());
84 
85 template<typename Image>
86 std::pair<std::vector<double>, lsst::afw::math::KernelList>
87 fitKernelParamsToImage(lsst::afw::math::LinearCombinationKernel const& kernel,
88  Image const& image, lsst::afw::geom::Point2D const& pos);
89 
90 template<typename Image>
91 std::pair<std::shared_ptr<lsst::afw::math::Kernel>, std::pair<double, double> >
92 fitKernelToImage(lsst::afw::math::LinearCombinationKernel const& kernel,
93  Image const& image, lsst::afw::geom::Point2D const& pos);
94 
95 }}}
96 
97 #endif
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)