lsst.afw  13.0-109-g62eb66483
GaussianPsf.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 /*
3  * LSST Data Management System
4  * Copyright 2008-2014 LSST Corporation.
5  *
6  * This product includes software developed by the
7  * LSST Project (http://www.lsst.org/).
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the LSST License Statement and
20  * the GNU General Public License along with this program. If not,
21  * see <http://www.lsstcorp.org/LegalNotices/>.
22  */
23 #ifndef LSST_AFW_DETECTION_GaussianPsf_h_INCLUDED
24 #define LSST_AFW_DETECTION_GaussianPsf_h_INCLUDED
25 
26 #include "lsst/afw/geom/Extent.h"
27 #include "lsst/afw/geom/Point.h"
28 #include "lsst/afw/detection/Psf.h"
29 
30 namespace lsst {
31 namespace afw {
32 namespace detection {
33 
43 class GaussianPsf : public afw::table::io::PersistableFacade<GaussianPsf>, public Psf {
44 public:
52  GaussianPsf(int width, int height, double sigma);
53 
60  GaussianPsf(geom::Extent2I const& dimensions, double sigma);
61 
63  virtual std::shared_ptr<afw::detection::Psf> clone() const;
64 
66  virtual std::shared_ptr<afw::detection::Psf> resized(int width, int height) const;
67 
69  geom::Extent2I getDimensions() const { return _dimensions; }
70 
72  double getSigma() const { return _sigma; }
73 
75  virtual bool isPersistable() const { return true; }
76 
77 protected:
78  virtual std::string getPersistenceName() const;
79 
80  virtual std::string getPythonModule() const;
81 
82  virtual void write(OutputArchiveHandle& handle) const;
83 
84 private:
85 #if 0 // We could reimplement this more efficiently than what's in the base class,
86  // but it's tricky to get the position right in all corner cases, and it's
87  // not actually performance-critical, so we should just wait for #3116.
88  virtual std::shared_ptr<Image> doComputeImage(
89  geom::Point2D const & position, image::Color const& color
90  ) const;
91 #endif
92 
93  virtual std::shared_ptr<Image> doComputeKernelImage(geom::Point2D const& position,
94  image::Color const& color) const;
95 
96  virtual double doComputeApertureFlux(double radius, geom::Point2D const& position,
97  image::Color const& color) const;
98 
99  virtual geom::ellipses::Quadrupole doComputeShape(geom::Point2D const& position,
100  image::Color const& color) const;
101 
102  virtual geom::Box2I doComputeBBox(geom::Point2D const& position, image::Color const& color) const;
103 
104  geom::Extent2I _dimensions;
105  double _sigma;
106 };
107 }
108 }
109 } // namespace lsst::afw::detection
110 
111 #endif // !LSST_AFW_DETECTION_Psf_h_INCLUDED
An ellipse core with quadrupole moments as parameters.
Definition: Quadrupole.h:47
An object passed to Persistable::write to allow it to persist itself.
virtual std::shared_ptr< afw::detection::Psf > resized(int width, int height) const
Return a clone with specified kernel dimensions.
Definition: GaussianPsf.cc:110
virtual void write(OutputArchiveHandle &handle) const
Write the object to one or more catalogs.
Definition: GaussianPsf.cc:118
GaussianPsf(int width, int height, double sigma)
Constructor for a GaussianPsf.
Definition: GaussianPsf.cc:96
virtual bool isPersistable() const
Whether the Psf is persistable; always true.
Definition: GaussianPsf.h:75
virtual std::string getPersistenceName() const
Return the unique name used to persist this object and look up its factory.
Definition: GaussianPsf.cc:114
An integer coordinate rectangle.
Definition: Box.h:55
afw::table::Key< double > sigma
Definition: GaussianPsf.cc:45
afw::table::PointKey< int > dimensions
Definition: GaussianPsf.cc:44
A base class for image defects.
Definition: cameraGeom.dox:3
virtual std::shared_ptr< afw::detection::Psf > clone() const
Polymorphic deep copy; should usually be unnecessary because Psfs are immutable.
Definition: GaussianPsf.cc:106
geom::Extent2I getDimensions() const
Return the dimensions of the images returned by computeImage()
Definition: GaussianPsf.h:69
double getSigma() const
Return the radius of the Gaussian.
Definition: GaussianPsf.h:72
Describe the colour of a source.
Definition: Color.h:26
A polymorphic base class for representing an image&#39;s Point Spread Function.
Definition: Psf.h:70
A CRTP facade class for subclasses of Persistable.
Definition: Persistable.h:173
A circularly symmetric Gaussian Psf class with no spatial variation, intended mostly for testing purp...
Definition: GaussianPsf.h:43
virtual std::string getPythonModule() const
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
Definition: GaussianPsf.cc:116