LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
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 <utility>
35 #include <vector>
36 
37 #include "boost/shared_ptr.hpp"
38 
39 #include "lsst/afw.h"
40 #include "lsst/pex/policy.h"
41 #include "lsst/afw/detection/Psf.h"
42 #include "lsst/afw/math/Kernel.h"
44 #include "lsst/afw/geom/Extent.h"
45 
46 namespace lsst {
47 namespace meas {
48 namespace algorithms {
49 
50 template<typename PixelT>
51 std::pair<lsst::afw::math::LinearCombinationKernel::Ptr, std::vector<double> >
53  lsst::afw::geom::Extent2I const& dims,
54  lsst::afw::geom::Point2I const& xy0,
55  int const nEigenComponents,
56  int const spatialOrder,
57  int const ksize,
58  int const nStarPerCell=-1,
59  bool const constantWeight=true,
60  int const border=3
61  );
62 
63 template<typename PixelT>
64 int countPsfCandidates(lsst::afw::math::SpatialCellSet const& psfCells, int const nStarPerCell=-1);
65 
66 template<typename PixelT>
67 std::pair<bool, double>
69  lsst::afw::math::SpatialCellSet const& psfCells,
70  int const nStarPerCell = -1,
71  double const tolerance = 1e-5,
72  double const lambda = 0.0);
73 template<typename PixelT>
74 std::pair<bool, double>
76  lsst::afw::math::SpatialCellSet const& psfCells,
77  bool const doNonLinearFit,
78  int const nStarPerCell = -1,
79  double const tolerance = 1e-5,
80  double const lambda = 0.0);
81 
82 template<typename ImageT>
83 double subtractPsf(lsst::afw::detection::Psf const& psf, ImageT *data, double x, double y,
84  double psfFlux=std::numeric_limits<double>::quiet_NaN());
85 
86 template<typename Image>
87 std::pair<std::vector<double>, lsst::afw::math::KernelList>
89  Image const& image, lsst::afw::geom::Point2D const& pos);
90 
91 template<typename Image>
92 std::pair<lsst::afw::math::Kernel::Ptr, std::pair<double, double> >
94  Image const& image, lsst::afw::geom::Point2D const& pos);
95 
96 }}}
97 
98 #endif
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)
std::pair< std::vector< double >, afwMath::KernelList > fitKernelParamsToImage(afwMath::LinearCombinationKernel const &kernel, Image const &image, afwGeom::Point2D const &pos)
int y
This include file includes the header files for all of lsst::afw.
int countPsfCandidates(afwMath::SpatialCellSet const &psfCells, int const nStarPerCell)
std::pair< afwMath::Kernel::Ptr, std::pair< double, double > > fitKernelToImage(afwMath::LinearCombinationKernel const &kernel, Image const &image, afwGeom::Point2D const &pos)
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)
A collection of SpatialCells covering an entire image.
Definition: SpatialCell.h:378
int x
A kernel that is a linear combination of fixed basis kernels.
Definition: Kernel.h:814
std::pair< bool, double > fitSpatialKernelFromPsfCandidates(afwMath::Kernel *kernel, afwMath::SpatialCellSet const &psfCells, int const nStarPerCell, double const tolerance, double const lambda)
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:134
std::vector< boost::shared_ptr< Kernel > > KernelList
Definition: Kernel.h:542