Loading [MathJax]/extensions/tex2jax.js
LSST Applications 28.0.0,g1653933729+a8ce1bb630,g1a997c3884+a8ce1bb630,g28da252d5a+5bd70b7e6d,g2bbee38e9b+638fca75ac,g2bc492864f+638fca75ac,g3156d2b45e+07302053f8,g347aa1857d+638fca75ac,g35bb328faa+a8ce1bb630,g3a166c0a6a+638fca75ac,g3e281a1b8c+7bbb0b2507,g4005a62e65+17cd334064,g414038480c+5b5cd4fff3,g41af890bb2+4ffae9de63,g4e1a3235cc+0f1912dca3,g6249c6f860+3c3976f90c,g80478fca09+46aba80bd6,g82479be7b0+77990446f6,g858d7b2824+78ba4d1ce1,g89c8672015+f667a5183b,g9125e01d80+a8ce1bb630,ga5288a1d22+2a6264e9ca,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc22bb204ba+78ba4d1ce1,gc28159a63d+638fca75ac,gcf0d15dbbd+32ddb6096f,gd6b7c0dfd1+3e339405e9,gda3e153d99+78ba4d1ce1,gda6a2b7d83+32ddb6096f,gdaeeff99f8+1711a396fd,gdd5a9049c5+b18c39e5e3,ge2409df99d+a5e4577cdc,ge33fd446bb+78ba4d1ce1,ge79ae78c31+638fca75ac,gf0baf85859+64e8883e75,gf5289d68f6+e1b046a8d7,gfa443fc69c+91d9ed1ecf,gfda6b12a05+8419469a56
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Psf.h
Go to the documentation of this file.
1// -*- LSST-C++ -*-
2/*
3 * LSST Data Management System
4 * Copyright 2008-2013 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_Psf_h_INCLUDED
24#define LSST_AFW_DETECTION_Psf_h_INCLUDED
25
26#include <string>
27#include <limits>
28
29#include <memory>
30
31#include "lsst/pex/exceptions.h"
38
39namespace lsst {
40namespace afw {
41namespace detection {
42namespace detail {
43
45struct PsfCacheKey;
46
47} // namespace detail
48
53
54
81class Psf : public afw::table::io::PersistableFacade<Psf>,
82 public afw::typehandling::Storable {
83 static lsst::geom::Point2D makeNullPoint() {
85 }
86
87public:
90
93 COPY = 0,
94 INTERNAL = 1
98 };
99
100 Psf(Psf const&);
101 Psf& operator=(Psf const&) = delete;
102 Psf& operator=(Psf&&) = delete;
103
104 Psf(Psf&&);
105 ~Psf() override;
106
114 virtual std::shared_ptr<Psf> clone() const = 0;
115
122 std::shared_ptr<typehandling::Storable> cloneStorable() const override { return clone(); }
123
132 virtual std::shared_ptr<Psf> resized(int width, int height) const = 0;
133
154 std::shared_ptr<Image> computeImage(lsst::geom::Point2D position,
155 image::Color color = image::Color(),
156 ImageOwnerEnum owner = COPY) const;
157
158
181 std::shared_ptr<Image> computeKernelImage(lsst::geom::Point2D position,
182 image::Color color = image::Color(),
183 ImageOwnerEnum owner = COPY) const;
184
196 double computePeak(lsst::geom::Point2D position,
197 image::Color color = image::Color()) const;
198
210 double computeApertureFlux(double radius, lsst::geom::Point2D position,
211 image::Color color = image::Color()) const;
212
224 image::Color color = image::Color()) const;
225
237 image::Color color = image::Color()) const;
238
239
246
252 virtual lsst::geom::Point2D getAveragePosition() const;
253
261 lsst::geom::Box2I computeBBox(lsst::geom::Point2D position,
262 image::Color color = image::Color()) const;
263
271 lsst::geom::Box2I computeImageBBox(lsst::geom::Point2D position,
272 image::Color color = image::Color()) const;
273
283 image::Color color = image::Color()) const {
284 return computeBBox(position, color);
285 }
286
305 static std::shared_ptr<Image> recenterKernelImage(std::shared_ptr<Image> im,
306 lsst::geom::Point2D const& position,
307 std::string const& warpAlgorithm = "lanczos5",
308 unsigned int warpBuffer = 5);
309
314 std::size_t getCacheCapacity() const;
315
320 void setCacheCapacity(std::size_t capacity);
321
322protected:
330 explicit Psf(bool isFixed = false, std::size_t capacity = 100);
331
333
341 virtual std::shared_ptr<Image> doComputeImage(lsst::geom::Point2D const& position,
342 image::Color const& color) const;
343 virtual lsst::geom::Box2I doComputeImageBBox(lsst::geom::Point2D const& position,
344 image::Color const& color) const;
346
347private:
349
357 image::Color const& color) const = 0;
358 virtual double doComputeApertureFlux(double radius, lsst::geom::Point2D const& position,
359 image::Color const& color) const = 0;
361 image::Color const& color) const = 0;
363 image::Color const& color) const = 0;
365
366 bool const _isFixed;
368 std::unique_ptr<PsfCache> _imageCache;
369 std::unique_ptr<PsfCache> _kernelImageCache;
370};
371} // namespace detection
372} // namespace afw
373} // namespace lsst
374
375#endif // !LSST_AFW_DETECTION_Psf_h_INCLUDED
#define LSST_EXCEPTION_TYPE(t, b, c)
Macro used to define new types of exceptions without additional data.
Definition Exception.h:69
An exception thrown when we have an invalid PSF.
Definition Psf.h:52
A polymorphic base class for representing an image's Point Spread Function.
Definition Psf.h:82
Psf & operator=(Psf const &)=delete
std::shared_ptr< typehandling::Storable > cloneStorable() const override
Polymorphic deep-copy.
Definition Psf.h:122
math::Kernel::Pixel Pixel
Pixel type of Image returned by computeImage.
Definition Psf.h:88
virtual std::shared_ptr< Image > doComputeKernelImage(lsst::geom::Point2D const &position, image::Color const &color) const =0
These virtual member functions are private, not protected, because we only want derived classes to im...
Psf & operator=(Psf &&)=delete
virtual std::shared_ptr< Psf > resized(int width, int height) const =0
Return clone with specified kernel dimensions.
image::Color getAverageColor() const
Return the average Color of the stars used to construct the Psf.
Definition Psf.h:245
virtual std::shared_ptr< Psf > clone() const =0
Polymorphic deep-copy.
ImageOwnerEnum
Enum passed to computeImage and computeKernelImage to determine image ownership.
Definition Psf.h:92
virtual lsst::geom::Box2I doComputeBBox(lsst::geom::Point2D const &position, image::Color const &color) const =0
virtual double doComputeApertureFlux(double radius, lsst::geom::Point2D const &position, image::Color const &color) const =0
lsst::geom::Box2I computeKernelBBox(lsst::geom::Point2D position, image::Color color=image::Color()) const
Return the bounding box of the image returned by computeImage()
Definition Psf.h:282
virtual geom::ellipses::Quadrupole doComputeShape(lsst::geom::Point2D const &position, image::Color const &color) const =0
An ellipse core with quadrupole moments as parameters.
Definition Quadrupole.h:47
Describe the colour of a source.
Definition Color.h:25
Cache of most recently used values.
Definition CacheFwd.h:37
An integer coordinate rectangle.
Definition Box.h:55
Reports invalid arguments.
Definition Runtime.h:66
Point< double, 2 > Point2D
Definition Point.h:324