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
CoaddPsf.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 
24 #if !defined(LSST_MEAS_ALGORITHMS_COADDPSF_H)
25 #define LSST_MEAS_ALGORITHMS_COADDPSF_H
26 
27 #include <memory>
28 #include "lsst/base.h"
30 #include "lsst/afw/image/Wcs.h"
32 #include "lsst/afw/table/types.h"
33 #include "lsst/afw/geom/Box.h"
36 
37 namespace lsst { namespace meas { namespace algorithms {
38 
45 class CoaddPsf : public afw::table::io::PersistableFacade<CoaddPsf>, public ImagePsf {
46 public:
47 
63  explicit CoaddPsf(
64  afw::table::ExposureCatalog const & catalog,
65  afw::image::Wcs const & coaddWcs,
66  std::string const & weightFieldName = "weight",
67  std::string const & warpingKernelName="lanczos3",
68  int cacheSize=10000
69  );
70 
72  virtual PTR(afw::detection::Psf) clone() const;
73 
81 
84 
86  int getComponentCount() const;
87 
96 
104  CONST_PTR(afw::image::Wcs) getWcs(int index);
105 
113  double getWeight(int index);
114 
122  afw::table::RecordId getId(int index);
123 
131  afw::geom::Box2I getBBox(int index);
132 
140  CONST_PTR(afw::geom::polygon::Polygon) getValidPolygon(int index);
141 
151  virtual bool isPersistable() const { return true; }
152 
153  // Factory used to read CoaddPsf from an InputArchive; defined only in the source file.
154  class Factory;
155 
156 protected:
157 
159  afw::geom::Point2D const & ccdXY,
160  afw::image::Color const & color
161  ) const;
162 
163  virtual afw::geom::Box2I doComputeBBox(
164  afw::geom::Point2D const & position,
165  afw::image::Color const & color
166  ) const;
167 
168  // See afw::table::io::Persistable::getPersistenceName
169  virtual std::string getPersistenceName() const;
170 
171  // See afw::table::io::Persistable::getPythonModule
172  virtual std::string getPythonModule() const;
173 
174  // See afw::table::io::Persistable::write
175  virtual void write(OutputArchiveHandle & handle) const;
176 
177  // Used by persistence only
178  explicit CoaddPsf(
179  afw::table::ExposureCatalog const & catalog,
180  PTR(afw::image::Wcs const) coaddWcs,
181  afw::geom::Point2D const & averagePosition,
182  std::string const & warpingKernelName="lanczos3",
183  int cacheSize=10000
184  );
185 
186 private:
187 
190  afw::table::Key<double> _weightKey;
192  std::string _warpingKernelName; // could be removed if we could get this from _warpingControl (#2949)
193  CONST_PTR(afw::math::WarpingControl) _warpingControl;
194 };
195 
196 }}} // namespace lsst::meas::algorithms
197 
198 #endif
virtual bool isPersistable() const
Return true if the CoaddPsf persistable (always true).
Definition: CoaddPsf.h:151
This file contains macros and MPL vectors that list the types that can be used for fields...
afw::geom::Box2I getBBox(int index)
Get the bounding box (in component image Pixel coordinates) of the component image at index...
Definition: CoaddPsf.cc:329
double getWeight(int index)
Get the weight of the component image at index.
Definition: CoaddPsf.cc:315
afw::geom::Point2D _averagePosition
Definition: CoaddPsf.h:191
io::OutputArchiveHandle OutputArchiveHandle
Definition: Persistable.h:112
boost::shared_ptr< afw::image::Wcs const > getWcs(int index)
Get the Wcs of the component image at index.
Definition: CoaddPsf.cc:301
boost::shared_ptr< afw::image::Wcs const > _coaddWcs
Definition: CoaddPsf.h:189
afw::table::Key< double > _weightKey
Definition: CoaddPsf.h:190
CoaddPsf(afw::table::ExposureCatalog const &catalog, afw::image::Wcs const &coaddWcs, std::string const &weightFieldName="weight", std::string const &warpingKernelName="lanczos3", int cacheSize=10000)
Main constructors for CoaddPsf.
Definition: CoaddPsf.cc:142
Implementation of the WCS standard for a any projection.
Definition: Wcs.h:107
boost::shared_ptr< afw::detection::Psf::Image > doComputeKernelImage(afw::geom::Point2D const &ccdXY, afw::image::Color const &color) const
These virtual member functions are private, not protected, because we only want derived classes to im...
Definition: CoaddPsf.cc:248
tbl::Key< int > cacheSize
Definition: CoaddPsf.cc:351
boost::shared_ptr< afw::image::Wcs const > getCoaddWcs()
Return the Wcs of the coadd (defines the coordinate system of the Psf).
Definition: CoaddPsf.h:83
table::Key< table::Array< Kernel::Pixel > > image
Definition: FixedKernel.cc:117
virtual std::string getPersistenceName() const
Return the unique name used to persist this object and look up its factory.
Definition: CoaddPsf.cc:437
std::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:20
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:188
std::map< Citizen const *, CitizenInfo > table
Definition: Citizen.h:90
CoaddPsf is the Psf derived to be used for non-PSF-matched Coadd images.
Definition: CoaddPsf.h:45
int getComponentCount() const
Return the number of component Psfs in this CoaddPsf.
Definition: CoaddPsf.cc:290
boost::shared_ptr< afw::math::WarpingControl const > _warpingControl
Definition: CoaddPsf.h:193
tbl::Key< std::string > warpingKernelName
Definition: CoaddPsf.cc:353
#define PTR(...)
Definition: base.h:41
Support for warping an image to a new WCS.
Custom catalog class for ExposureRecord/Table.
Definition: Exposure.h:56
Point< double, 2 > Point2D
Definition: Point.h:288
virtual afw::geom::Box2I doComputeBBox(afw::geom::Point2D const &position, afw::image::Color const &color) const
These virtual member functions are private, not protected, because we only want derived classes to im...
Definition: CoaddPsf.cc:224
An intermediate base class for Psfs that use an image representation.
Definition: ImagePsf.h:37
virtual void write(OutputArchiveHandle &handle) const
Write the object to one or more catalogs.
Definition: CoaddPsf.cc:441
tbl::PointKey< double > averagePosition
Definition: CoaddPsf.cc:352
ExposureCatalogT< ExposureRecord > ExposureCatalog
Definition: Exposure.h:420
#define CONST_PTR(...)
A shared pointer to a const object.
Definition: base.h:47
virtual std::string getPythonModule() const
Return the fully-qualified Python module that should be imported to guarantee that its factory is reg...
Definition: CoaddPsf.cc:439
A polymorphic base class for representing an image&#39;s Point Spread Function.
Definition: Psf.h:68
Basic LSST definitions.
A CRTP facade class for subclasses of Persistable.
Definition: Persistable.h:180
virtual afw::geom::Point2D getAveragePosition() const
Return the average of the positions of the stars that went into this Psf.
Definition: CoaddPsf.h:80
boost::shared_ptr< afw::detection::Psf const > getPsf(int index)
Get the Psf of the component image at index.
Definition: CoaddPsf.cc:294
boost::shared_ptr< afw::geom::polygon::Polygon const > getValidPolygon(int index)
Get the validPolygon (in component image Pixel coordinates) of the component image at index...
Definition: CoaddPsf.cc:308
tbl::Key< int > coaddWcs
memId getId() const
Return the Citizen&#39;s ID.
Definition: Citizen.cc:224
virtual boost::shared_ptr< afw::detection::Psf > clone() const
Polymorphic deep copy. Usually unnecessary, as Psfs are immutable.
Definition: CoaddPsf.cc:176