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
CoaddBoundedField.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 /*
3  * LSST Data Management System
4  * Copyright 2008-2014 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 #ifndef LSST_MEAS_ALGORITHMS_CoaddBoundedField_h_INCLUDED
25 #define LSST_MEAS_ALGORITHMS_CoaddBoundedField_h_INCLUDED
26 
28 #include "lsst/afw/image/Wcs.h"
30 
31 namespace lsst { namespace meas { namespace algorithms {
32 
35 
38  PTR(afw::image::Wcs const) wcs_,
39  PTR(afw::geom::polygon::Polygon const) validPolygon_,
40  double weight_=1.0
41  ) : field(field_), wcs(wcs_), validPolygon(validPolygon_),
42  weight(weight_) {}
43 
45  PTR(afw::image::Wcs const) wcs;
46  PTR(afw::geom::polygon::Polygon const) validPolygon;
47  double weight;
48 };
49 
51  public afw::table::io::PersistableFacade<CoaddBoundedField>,
52  public afw::math::BoundedField
53 {
54 public:
55 
57  typedef std::vector<Element> ElementVector;
58 
59  explicit CoaddBoundedField(
60  afw::geom::Box2I const & bbox,
62  ElementVector const & elements
63  );
64 
65  explicit CoaddBoundedField(
66  afw::geom::Box2I const & bbox,
68  ElementVector const & elements,
69  double default_
70  );
71 
73  virtual double evaluate(afw::geom::Point2D const & position) const;
74 
78  virtual bool isPersistable() const { return true; }
79 
80  // Factory used to read CoaddPsf from an InputArchive; defined only in the source file.
81  class Factory;
82 
83  virtual PTR(afw::math::BoundedField) operator*(double const scale) const;
84 
85 protected:
86 
87  // See afw::table::io::Persistable::getPersistenceName
88  virtual std::string getPersistenceName() const;
89 
90  // See afw::table::io::Persistable::getPythonModule
91  virtual std::string getPythonModule() const;
92 
93  // See afw::table::io::Persistable::write
94  virtual void write(OutputArchiveHandle & handle) const;
95 
96 private:
97 
98  bool _throwOnMissing; // instead of using _default, raise an exception
99  double _default; // when none of the elements contribute at a point, return this value
100  PTR(afw::image::Wcs const) _coaddWcs; // coordinate system this field is defined in
101  ElementVector _elements; // vector of constituent fields being coadded
102 };
103 
104 }}} // namespace lsst::meas::algorithms
105 
106 #endif // !LSST_MEAS_ALGORITHMS_CoaddBoundedField_h_INCLUDED
Struct used to hold one Exposure&#39;s data in a CoaddBoundedField.
#define PTR(...)
Definition: base.h:41
boost::shared_ptr< afw::image::Wcs const > wcs
Implementation of the WCS standard for a any projection.
Definition: Wcs.h:107
virtual bool isPersistable() const
Return true if the CoaddBoundedField persistable (always true).
An integer coordinate rectangle.
Definition: Box.h:53
table::Key< table::Array< Kernel::Pixel > > image
Definition: FixedKernel.cc:117
CoaddBoundedFieldElement(boost::shared_ptr< afw::math::BoundedField > field_, boost::shared_ptr< afw::image::Wcs const > wcs_, boost::shared_ptr< afw::geom::polygon::Polygon const > validPolygon_, double weight_=1.0)
tbl::Key< double > default_
An abstract base class for 2-d functions defined on an integer bounding boxes.
Definition: BoundedField.h:49
boost::shared_ptr< afw::math::BoundedField > field
tbl::Key< int > coaddWcs
boost::shared_ptr< afw::geom::polygon::Polygon const > validPolygon