lsst.meas.algorithms
g4a7591d645+fa9daf83c6
Toggle main menu visibility
Loading...
Searching...
No Matches
include
lsst
meas
algorithms
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
27
#include "
lsst/geom/Box.h
"
28
#include "
lsst/afw/math/BoundedField.h
"
29
#include "
lsst/afw/geom/SkyWcs.h
"
30
#include "
lsst/afw/geom/polygon/Polygon.h
"
31
32
namespace
lsst
{
33
namespace
meas
{
34
namespace
algorithms
{
35
37
struct
CoaddBoundedFieldElement
{
38
CoaddBoundedFieldElement
(
std::shared_ptr<afw::math::BoundedField>
field_,
std::shared_ptr<afw::geom::SkyWcs const>
wcs_,
39
std::shared_ptr<afw::geom::polygon::Polygon const>
validPolygon_,
double
weight_ = 1.0)
40
:
field
(field_),
wcs
(wcs_),
validPolygon
(validPolygon_),
weight
(weight_) {}
41
48
bool
operator==
(
CoaddBoundedFieldElement
const
& rhs)
const
;
49
51
bool
operator!=
(
CoaddBoundedFieldElement
const
& rhs)
const
{
return
!(*
this
== rhs); };
52
53
std::shared_ptr<afw::math::BoundedField>
field
;
54
std::shared_ptr<afw::geom::SkyWcs const>
wcs
;
55
std::shared_ptr<afw::geom::polygon::Polygon const>
validPolygon
;
56
double
weight
;
57
};
58
59
class
CoaddBoundedField
:
public
afw::table::io::PersistableFacade
<CoaddBoundedField>,
60
public
afw::math::BoundedField
{
61
public
:
62
typedef
CoaddBoundedFieldElement
Element
;
63
typedef
std::vector<Element>
ElementVector
;
64
65
explicit
CoaddBoundedField
(
geom::Box2I
const
& bbox,
std::shared_ptr<afw::geom::SkyWcs const>
coaddWcs,
66
ElementVector
const
& elements);
67
68
explicit
CoaddBoundedField
(
geom::Box2I
const
& bbox,
std::shared_ptr<afw::geom::SkyWcs const>
coaddWcs,
69
ElementVector
const
& elements,
double
default_);
70
72
double
evaluate
(
geom::Point2D
const
& position)
const override
;
73
75
std::shared_ptr<afw::geom::SkyWcs const>
getCoaddWcs
()
const
{
return
_coaddWcs; };
76
78
double
getDefault
()
const
{
return
_default; };
79
81
ElementVector
getElements
()
const
{
return
_elements; };
82
84
bool
getThrowOnMissing
()
const
{
return
_throwOnMissing; };
85
89
virtual
bool
isPersistable
() const noexcept
override
{
return
true
; }
90
91
// Factory used to read CoaddPsf from an InputArchive; defined only in the source file.
92
class
Factory;
93
94
std::shared_ptr<afw::math::BoundedField>
operator*
(
double
const
scale)
const override
;
95
97
bool
operator==
(
BoundedField
const
& rhs)
const override
;
98
99
protected
:
100
// See afw::table::io::Persistable::getPersistenceName
101
std::string
getPersistenceName
()
const override
;
102
103
// See afw::table::io::Persistable::getPythonModule
104
std::string
getPythonModule
()
const override
;
105
106
// See afw::table::io::Persistable::write
107
void
write
(
OutputArchiveHandle
& handle)
const override
;
108
109
private
:
110
bool
_throwOnMissing;
// instead of using _default, raise an exception
111
double
_default;
// when none of the elements contribute at a point, return this value
112
std::shared_ptr<afw::geom::SkyWcs const>
_coaddWcs;
// coordinate system this field is defined in
113
ElementVector
_elements;
// vector of constituent fields being coadded
114
115
std::string
toString
()
const override
{
116
std::ostringstream
os;
117
os <<
"CoaddBoundedField with "
<< _elements.size() <<
" elements, default "
<< _default;
118
return
os.
str
();
119
}
120
};
121
122
}
// namespace algorithms
123
}
// namespace meas
124
}
// namespace lsst
125
126
#endif
// !LSST_MEAS_ALGORITHMS_CoaddBoundedField_h_INCLUDED
BoundedField.h
Box.h
Polygon.h
SkyWcs.h
std::ostringstream
std::string
lsst::afw::math::BoundedField
lsst::afw::math::BoundedField::BoundedField
BoundedField(BoundedField const &)=default
lsst::afw::table::io::PersistableFacade
lsst::afw::math::BoundedField::OutputArchiveHandle
io::OutputArchiveHandle OutputArchiveHandle
lsst::geom::Box2I
lsst::meas::algorithms::CoaddBoundedField::ElementVector
std::vector< Element > ElementVector
Definition
CoaddBoundedField.h:63
lsst::meas::algorithms::CoaddBoundedField::CoaddBoundedField
CoaddBoundedField(geom::Box2I const &bbox, std::shared_ptr< afw::geom::SkyWcs const > coaddWcs, ElementVector const &elements)
Definition
CoaddBoundedField.cc:73
lsst::meas::algorithms::CoaddBoundedField::getThrowOnMissing
bool getThrowOnMissing() const
Get the throwOnMissing setting.
Definition
CoaddBoundedField.h:84
lsst::meas::algorithms::CoaddBoundedField::Element
CoaddBoundedFieldElement Element
Definition
CoaddBoundedField.h:62
lsst::meas::algorithms::CoaddBoundedField::getDefault
double getDefault() const
Get the default value.
Definition
CoaddBoundedField.h:78
lsst::meas::algorithms::CoaddBoundedField::isPersistable
virtual bool isPersistable() const noexcept override
Return true if the CoaddBoundedField persistable (always true).
Definition
CoaddBoundedField.h:89
lsst::meas::algorithms::CoaddBoundedField::getCoaddWcs
std::shared_ptr< afw::geom::SkyWcs const > getCoaddWcs() const
Get the coaddWcs.
Definition
CoaddBoundedField.h:75
lsst::meas::algorithms::CoaddBoundedField::getElements
ElementVector getElements() const
Get the elements vector.
Definition
CoaddBoundedField.h:81
lsst::meas::algorithms::CoaddBoundedField::write
void write(OutputArchiveHandle &handle) const override
Definition
CoaddBoundedField.cc:233
lsst::meas::algorithms::CoaddBoundedField::operator*
std::shared_ptr< afw::math::BoundedField > operator*(double const scale) const override
Definition
CoaddBoundedField.cc:254
lsst::meas::algorithms::CoaddBoundedField::getPythonModule
std::string getPythonModule() const override
Definition
CoaddBoundedField.cc:231
lsst::meas::algorithms::CoaddBoundedField::evaluate
double evaluate(geom::Point2D const &position) const override
Definition
CoaddBoundedField.cc:89
lsst::meas::algorithms::CoaddBoundedField::toString
std::string toString() const override
Definition
CoaddBoundedField.h:115
lsst::meas::algorithms::CoaddBoundedField::operator==
bool operator==(BoundedField const &rhs) const override
BoundedFields (of the same sublcass) are equal if their bounding boxes and parameters are equal.
Definition
CoaddBoundedField.cc:258
lsst::meas::algorithms::CoaddBoundedField::getPersistenceName
std::string getPersistenceName() const override
Definition
CoaddBoundedField.cc:229
lsst::geom::Point2D
Point< double, 2 > Point2D
lsst::meas::algorithms
Definition
mainpage.dox:13
lsst::meas
lsst
std::shared_ptr
std::ostringstream::str
T str(T... args)
lsst::meas::algorithms::CoaddBoundedFieldElement
Struct used to hold one Exposure's data in a CoaddBoundedField.
Definition
CoaddBoundedField.h:37
lsst::meas::algorithms::CoaddBoundedFieldElement::wcs
std::shared_ptr< afw::geom::SkyWcs const > wcs
Definition
CoaddBoundedField.h:54
lsst::meas::algorithms::CoaddBoundedFieldElement::operator!=
bool operator!=(CoaddBoundedFieldElement const &rhs) const
Elements are equal if all their components are equal.
Definition
CoaddBoundedField.h:51
lsst::meas::algorithms::CoaddBoundedFieldElement::field
std::shared_ptr< afw::math::BoundedField > field
Definition
CoaddBoundedField.h:53
lsst::meas::algorithms::CoaddBoundedFieldElement::validPolygon
std::shared_ptr< afw::geom::polygon::Polygon const > validPolygon
Definition
CoaddBoundedField.h:55
lsst::meas::algorithms::CoaddBoundedFieldElement::CoaddBoundedFieldElement
CoaddBoundedFieldElement(std::shared_ptr< afw::math::BoundedField > field_, std::shared_ptr< afw::geom::SkyWcs const > wcs_, std::shared_ptr< afw::geom::polygon::Polygon const > validPolygon_, double weight_=1.0)
Definition
CoaddBoundedField.h:38
lsst::meas::algorithms::CoaddBoundedFieldElement::weight
double weight
Definition
CoaddBoundedField.h:56
lsst::meas::algorithms::CoaddBoundedFieldElement::operator==
bool operator==(CoaddBoundedFieldElement const &rhs) const
Elements are equal if all their components are equal.
Definition
CoaddBoundedField.cc:68
std::vector
Generated on
for lsst.meas.algorithms by
1.17.0