LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
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"
35 
36 namespace lsst { namespace meas { namespace algorithms {
37 
44 class CoaddPsf : public afw::table::io::PersistableFacade<CoaddPsf>, public ImagePsf {
45 public:
46 
62  explicit CoaddPsf(
63  afw::table::ExposureCatalog const & catalog,
64  afw::image::Wcs const & coaddWcs,
65  std::string const & weightFieldName = "weight",
66  std::string const & warpingKernelName="lanczos3",
67  int cacheSize=10000
68  );
69 
71  virtual PTR(afw::detection::Psf) clone() const;
72 
80 
83 
85  int getComponentCount() const;
86 
89 
91  CONST_PTR(afw::image::Wcs) getWcs(int index);
92 
94  double getWeight(int index);
95 
97  afw::table::RecordId getId(int index);
98 
100  afw::geom::Box2I getBBox(int index);
101 
111  virtual bool isPersistable() const { return true; }
112 
113  // Factory used to read CoaddPsf from an InputArchive; defined only in the source file.
114  class Factory;
115 
116 protected:
117 
119  afw::geom::Point2D const & ccdXY,
120  afw::image::Color const & color
121  ) const;
122 
123  // See afw::table::io::Persistable::getPersistenceName
124  virtual std::string getPersistenceName() const;
125 
126  // See afw::table::io::Persistable::getPythonModule
127  virtual std::string getPythonModule() const;
128 
129  // See afw::table::io::Persistable::write
130  virtual void write(OutputArchiveHandle & handle) const;
131 
132  // Used by persistence only
133  explicit CoaddPsf(
134  afw::table::ExposureCatalog const & catalog,
135  PTR(afw::image::Wcs const) coaddWcs,
136  afw::geom::Point2D const & averagePosition,
137  std::string const & warpingKernelName="lanczos3",
138  int cacheSize=10000
139  );
140 
141 private:
142 
145  afw::table::Key<double> _weightKey;
147  std::string _warpingKernelName; // could be removed if we could get this from _warpingControl (#2949)
148  CONST_PTR(afw::math::WarpingControl) _warpingControl;
149 };
150 
151 }}} // namespace lsst::meas::algorithms
152 
153 #endif
virtual bool isPersistable() const
Return true if the CoaddPsf persistable (always true).
Definition: CoaddPsf.h:111
#define CONST_PTR(...)
Definition: base.h:47
afw::geom::Box2I getBBox(int index)
Return the bounding box (in component image Pixel coordinates) of the component image at index...
Definition: CoaddPsf.cc:304
double getWeight(int index)
Return the weight of the component image at index.
Definition: CoaddPsf.cc:287
afw::geom::Point2D _averagePosition
Definition: CoaddPsf.h:146
memId getId() const
Return the Citizen&#39;s ID.
Definition: Citizen.cc:223
boost::shared_ptr< afw::image::Wcs const > getWcs(int index)
Return the Wcs of the component image at index.
Definition: CoaddPsf.cc:277
boost::shared_ptr< afw::image::Wcs const > _coaddWcs
Definition: CoaddPsf.h:144
afw::table::Key< double > _weightKey
Definition: CoaddPsf.h:145
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
#define PTR(...)
Definition: base.h:41
tbl::Key< int > cacheSize
Definition: CoaddPsf.cc:326
boost::shared_ptr< afw::image::Wcs const > getCoaddWcs()
Return the Wcs of the coadd (defines the coordinate system of the Psf).
Definition: CoaddPsf.h:82
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:381
afw::table::ExposureCatalog _catalog
Definition: CoaddPsf.h:143
CoaddPsf is the Psf derived to be used for non-PSF-matched Coadd images.
Definition: CoaddPsf.h:44
int getComponentCount() const
Return the number of component Psfs in this CoaddPsf.
Definition: CoaddPsf.cc:260
boost::shared_ptr< afw::math::WarpingControl const > _warpingControl
Definition: CoaddPsf.h:148
tbl::Key< std::string > warpingKernelName
Definition: CoaddPsf.cc:328
Support for warping an image to a new WCS.
Custom catalog class for ExposureRecord/Table.
Definition: Exposure.h:49
tbl::Key< int > coaddWcs
Definition: CoaddPsf.cc:325
tbl::Key< tbl::Point< double > > averagePosition
Definition: CoaddPsf.cc:327
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:385
ExposureCatalogT< ExposureRecord > ExposureCatalog
Definition: Exposure.h:394
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:383
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
std::map< Citizen const *, CitizenInfo > table
Definition: Citizen.h:93
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:79
boost::shared_ptr< afw::detection::Psf const > getPsf(int index)
Return the Psf of the component image at index.
Definition: CoaddPsf.cc:267
virtual boost::shared_ptr< afw::detection::Psf > clone() const
Polymorphic deep copy. Usually unnecessary, as Psfs are immutable.
Definition: CoaddPsf.cc:167