LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
LSSTDataManagementBasePackage
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"
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<lsst::afw::math::LinearCombinationKernel::Ptr, std::vector<double> >
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>
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);
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>
88  Image const& image, lsst::afw::geom::Point2D const& pos);
89 
90 template<typename Image>
91 std::pair<lsst::afw::math::Kernel::Ptr, std::pair<double, double> >
93  Image const& image, lsst::afw::geom::Point2D const& pos);
94 
95 }}}
96 
97 #endif
int y
Declare the Kernel class and subclasses.
std::pair< afwMath::LinearCombinationKernel::Ptr, std::vector< double > > createKernelFromPsfCandidates(afwMath::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, bool const constantWeight, int const border)
Return a Kernel::Ptr and a list of eigenvalues resulting from analysing the provided SpatialCellSet...
std::pair< std::vector< double >, afwMath::KernelList > fitKernelParamsToImage(afwMath::LinearCombinationKernel const &kernel, Image const &image, afwGeom::Point2D const &pos)
Fit a LinearCombinationKernel to an Image, allowing the coefficients of the components to vary...
This include file includes the header files for all of lsst::afw.
int countPsfCandidates(afwMath::SpatialCellSet const &psfCells, int const nStarPerCell)
Count the number of candidates in use.
std::pair< afwMath::Kernel::Ptr, std::pair< double, double > > fitKernelToImage(afwMath::LinearCombinationKernel const &kernel, Image const &image, afwGeom::Point2D const &pos)
Fit a LinearCombinationKernel to an Image, allowing the coefficients of the components to vary...
table::Key< table::Array< Kernel::Pixel > > image
Definition: FixedKernel.cc:117
double subtractPsf(afwDetection::Psf const &psf, MaskedImageT *data, double x, double y, double psfFlux)
Subtract a PSF from an image at a given position.
A collection of SpatialCells covering an entire image.
Definition: SpatialCell.h:304
A kernel that is a linear combination of fixed basis kernels.
Definition: Kernel.h:811
double x
std::pair< bool, double > fitSpatialKernelFromPsfCandidates(afwMath::Kernel *kernel, afwMath::SpatialCellSet const &psfCells, int const nStarPerCell, double const tolerance, double const lambda)
Fit spatial kernel using full-nonlinear optimization to estimate candidate amplitudes.
Class to ensure constraints for spatial modeling.
A polymorphic base class for representing an image&#39;s Point Spread Function.
Definition: Psf.h:68
A coordinate class intended to represent offsets and dimensions.
Kernels are used for convolution with MaskedImages and (eventually) Images.
Definition: Kernel.h:131
std::vector< boost::shared_ptr< Kernel > > KernelList
Definition: Kernel.h:539