LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
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 <boost/make_shared.hpp>
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  // See afw::table::io::Persistable::getPersistenceName
164  virtual std::string getPersistenceName() const;
165 
166  // See afw::table::io::Persistable::getPythonModule
167  virtual std::string getPythonModule() const;
168 
169  // See afw::table::io::Persistable::write
170  virtual void write(OutputArchiveHandle & handle) const;
171 
172  // Used by persistence only
173  explicit CoaddPsf(
174  afw::table::ExposureCatalog const & catalog,
175  PTR(afw::image::Wcs const) coaddWcs,
176  afw::geom::Point2D const & averagePosition,
177  std::string const & warpingKernelName="lanczos3",
178  int cacheSize=10000
179  );
180 
181 private:
182 
185  afw::table::Key<double> _weightKey;
187  std::string _warpingKernelName; // could be removed if we could get this from _warpingControl (#2949)
188  CONST_PTR(afw::math::WarpingControl) _warpingControl;
189 };
190 
191 }}} // namespace lsst::meas::algorithms
192 
193 #endif
virtual bool isPersistable() const
Return true if the CoaddPsf persistable (always true).
Definition: CoaddPsf.h:151
afw::geom::Box2I getBBox(int index)
Definition: CoaddPsf.cc:305
double getWeight(int index)
Definition: CoaddPsf.cc:291
memId getId() const
Return the Citizen&#39;s ID.
Definition: Citizen.cc:223
afw::geom::Point2D _averagePosition
Definition: CoaddPsf.h:186
#define PTR(...)
Definition: base.h:41
Point< double, 2 > Point2D
Definition: Point.h:286
boost::shared_ptr< afw::image::Wcs const > getWcs(int index)
Definition: CoaddPsf.cc:277
boost::shared_ptr< afw::image::Wcs const > _coaddWcs
Definition: CoaddPsf.h:184
afw::table::Key< double > _weightKey
Definition: CoaddPsf.h:185
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
Definition: CoaddPsf.cc:224
tbl::Key< int > cacheSize
Definition: CoaddPsf.cc:327
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
std::map< Citizen const *, CitizenInfo > table
Definition: Citizen.h:93
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:384
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:183
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:266
boost::shared_ptr< afw::math::WarpingControl const > _warpingControl
Definition: CoaddPsf.h:188
tbl::Key< std::string > warpingKernelName
Definition: CoaddPsf.cc:329
Support for warping an image to a new WCS.
Custom catalog class for ExposureRecord/Table.
Definition: Exposure.h:55
#define CONST_PTR(...)
Definition: base.h:47
io::OutputArchiveHandle OutputArchiveHandle
Definition: Persistable.h:114
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:388
tbl::PointKey< double > averagePosition
Definition: CoaddPsf.cc:328
ExposureCatalogT< ExposureRecord > ExposureCatalog
Definition: Exposure.h:415
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:386
A polymorphic base class for representing an image&#39;s Point Spread Function.
Definition: Psf.h:68
A CRTP facade class for subclasses of Persistable.
Definition: Persistable.h:182
boost::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:21
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)
Definition: CoaddPsf.cc:270
boost::shared_ptr< afw::geom::polygon::Polygon const > getValidPolygon(int index)
Definition: CoaddPsf.cc:284
tbl::Key< int > coaddWcs
virtual boost::shared_ptr< afw::detection::Psf > clone() const
Polymorphic deep copy. Usually unnecessary, as Psfs are immutable.
Definition: CoaddPsf.cc:176