LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
LSSTDataManagementBasePackage
Separable.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008, 2009, 2010 LSST Corporation.
6  *
7  * This product includes software developed by the
8  * LSST Project (http://www.lsst.org/).
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the LSST License Statement and
21  * the GNU General Public License along with this program. If not,
22  * see <http://www.lsstcorp.org/LegalNotices/>.
23  */
24 
25 #ifndef LSST_AFW_GEOM_ELLIPSES_Separable_h_INCLUDED
26 #define LSST_AFW_GEOM_ELLIPSES_Separable_h_INCLUDED
27 
39 
40 namespace lsst { namespace afw { namespace geom { namespace ellipses {
41 
47 template <typename Ellipticity_, typename Radius_>
48 class Separable : public BaseCore {
49 public:
50 
51  typedef std::shared_ptr<Separable> Ptr;
52  typedef std::shared_ptr<Separable const> ConstPtr;
53 
54  enum ParameterEnum { E1=0, E2=1, RADIUS=2 };
55 
56  typedef Ellipticity_ Ellipticity;
57  typedef Radius_ Radius;
58 
59  double const getE1() const { return _ellipticity.getE1(); }
60  void setE1(double e1) { _ellipticity.setE1(e1); }
61 
62  double const getE2() const { return _ellipticity.getE2(); }
63  void setE2(double e2) { _ellipticity.setE2(e2); }
64 
65  Radius const & getRadius() const { return _radius; }
66  Radius & getRadius() { return _radius; }
67  void setRadius(double radius) { _radius = radius; }
68  void setRadius(Radius const & radius) { _radius = radius; }
69 
70  Ellipticity const & getEllipticity() const { return _ellipticity; }
72 
74  Ptr clone() const { return std::static_pointer_cast<Separable>(_clone()); }
75 
77  virtual std::string getName() const;
78 
83  virtual void normalize();
84 
85  virtual void readParameters(double const * iter);
86 
87  virtual void writeParameters(double * iter) const;
88 
90  Separable & operator=(Separable const & other);
91 
93  Separable & operator=(BaseCore const & other) { BaseCore::operator=(other); return *this; }
94 
96  explicit Separable(double e1=0.0, double e2=0.0, double radius=Radius(), bool normalize=true);
97 
99  explicit Separable(std::complex<double> const & complex,
100  double radius=Radius(), bool normalize=true);
101 
103  explicit Separable(Ellipticity const & ellipticity, double radius=Radius(), bool normalize=true);
104 
106  explicit Separable(BaseCore::ParameterVector const & vector, bool normalize=false);
107 
109  Separable(Separable const & other) : _ellipticity(other._ellipticity), _radius(other._radius) {}
110 
112  Separable(BaseCore const & other) { *this = other; }
113 
114 #ifndef SWIG
115  Separable(BaseCore::Transformer const & transformer) {
117  transformer.apply(*this);
118  }
119 
121  Separable(BaseCore::Convolution const & convolution) {
122  convolution.apply(*this);
123  }
124 #endif
125 protected:
126 
127  virtual BaseCore::Ptr _clone() const { return std::make_shared<Separable>(*this); }
128 
129  virtual void _assignToQuadrupole(double & ixx, double & iyy, double & ixy) const;
130  virtual void _assignFromQuadrupole(double ixx, double iyy, double ixy);
131 
132  virtual void _assignToAxes(double & a, double & b, double & theta) const;
133  virtual void _assignFromAxes(double a, double b, double theta);
134 
135  virtual Jacobian _dAssignToQuadrupole(double & ixx, double & iyy, double & ixy) const;
136  virtual Jacobian _dAssignFromQuadrupole(double ixx, double iyy, double ixy);
137 
138  virtual Jacobian _dAssignToAxes(double & a, double & b, double & theta) const;
139  virtual Jacobian _dAssignFromAxes(double a, double b, double theta);
140 
141 private:
142 
144 
147 };
148 
149 }}}} // namespace lsst::afw::geom::ellipses
150 
151 #endif // !LSST_AFW_GEOM_ELLIPSES_Separable_h_INCLUDED
int iter
virtual void readParameters(double const *iter)
void setRadius(Radius const &radius)
Definition: Separable.h:68
virtual void _assignToQuadrupole(double &ixx, double &iyy, double &ixy) const
virtual void writeParameters(double *iter) const
A temporary-only expression object for ellipse core transformations.
Definition: Transformer.h:47
Definitions for Ellipse::Transformer and BaseCore::Transformer.
Separable(double e1=0.0, double e2=0.0, double radius=Radius(), bool normalize=true)
Construct from parameter values.
std::shared_ptr< Separable > Ptr
Definition: Separable.h:51
virtual Jacobian _dAssignFromAxes(double a, double b, double theta)
Separable(BaseCore::Convolution const &convolution)
Converting copy constructor.
Definition: Separable.h:121
dictionary Separable
Definition: __init__.py:31
Definitions for BaseEllipse::Convolution and BaseCore::Convolution.
Ellipticity const & getEllipticity() const
Definition: Separable.h:70
std::shared_ptr< BaseCore > Ptr
Definition: BaseCore.h:59
Separable & operator=(Separable const &other)
Standard assignment.
Eigen::Vector3d ParameterVector
Parameter vector type.
Definition: BaseCore.h:65
void setRadius(double radius)
Definition: Separable.h:67
virtual void _assignFromQuadrupole(double ixx, double iyy, double ixy)
Eigen::Matrix3d Jacobian
Parameter Jacobian matrix type.
Definition: BaseCore.h:66
Radius const & getRadius() const
Definition: Separable.h:65
virtual void _assignFromAxes(double a, double b, double theta)
std::shared_ptr< Separable const > ConstPtr
Definition: Separable.h:52
double const getE1() const
Definition: Separable.h:59
Separable(BaseCore const &other)
Converting copy constructor.
Definition: Separable.h:112
virtual void _assignToAxes(double &a, double &b, double &theta) const
static BaseCore::Registrar< Separable > registrar
Definition: Separable.h:143
Forward declarations, typedefs, and definitions for BaseCore.
virtual Jacobian _dAssignToAxes(double &a, double &b, double &theta) const
virtual std::string getName() const
Return a string that identifies this parametrization.
An ellipse core with a complex ellipticity and radius parameterization.
Definition: radii.h:43
Ptr clone() const
Deep copy the ellipse core.
Definition: Separable.h:74
virtual void normalize()
Put the parameters into a &quot;standard form&quot;, and throw InvalidParameterError if they cannot be normaliz...
A base class for parametrizations of the &quot;core&quot; of an ellipse - the ellipticity and size...
Definition: BaseCore.h:53
virtual Jacobian _dAssignFromQuadrupole(double ixx, double iyy, double ixy)
Separable & operator=(BaseCore const &other)
Converting assignment.
Definition: Separable.h:93
afw::table::Key< double > b
double const getE2() const
Definition: Separable.h:62
virtual Jacobian _dAssignToQuadrupole(double &ixx, double &iyy, double &ixy) const
virtual BaseCore::Ptr _clone() const
Definition: Separable.h:127
Definitions for Ellipse::GridTransform and BaseCore::GridTransform.
A temporary-only expression object for ellipse core convolution.
Definition: Convolution.h:44
Separable(Separable const &other)
Copy constructor.
Definition: Separable.h:109
BaseCore & operator=(BaseCore const &other)
Set the parameters of this ellipse core from another.