LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
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
#define PTR(...)
Definition: base.h:41
afw::geom::Box2I getBBox(int index)
Definition: CoaddPsf.cc:296
double getWeight(int index)
Definition: CoaddPsf.cc:282
memId getId() const
Return the Citizen&#39;s ID.
Definition: Citizen.cc:223
afw::geom::Point2D _averagePosition
Definition: CoaddPsf.h:186
#define CONST_PTR(...)
Definition: base.h:47
boost::shared_ptr< afw::image::Wcs const > getWcs(int index)
Definition: CoaddPsf.cc:268
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
io::OutputArchiveHandle OutputArchiveHandle
Definition: Persistable.h:114
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:215
tbl::Key< int > cacheSize
Definition: CoaddPsf.cc:318
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:375
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:257
boost::shared_ptr< afw::math::WarpingControl const > _warpingControl
Definition: CoaddPsf.h:188
tbl::Key< std::string > warpingKernelName
Definition: CoaddPsf.cc:320
Support for warping an image to a new WCS.
Custom catalog class for ExposureRecord/Table.
Definition: Exposure.h:55
Point< double, 2 > Point2D
Definition: Point.h:286
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:379
tbl::PointKey< double > averagePosition
Definition: CoaddPsf.cc:319
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:377
A polymorphic base class for representing an image&#39;s Point Spread Function.
Definition: Psf.h:68
boost::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:21
A CRTP facade class for subclasses of Persistable.
Definition: Persistable.h:182
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:261
boost::shared_ptr< afw::geom::polygon::Polygon const > getValidPolygon(int index)
Definition: CoaddPsf.cc:275
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:167