LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
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 boost::shared_ptr<Separable> Ptr;
52  typedef boost::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 boost::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 boost::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 Jacobian _dAssignToAxes(double &a, double &b, double &theta) const
void setRadius(Radius const &radius)
Definition: Separable.h:68
A temporary-only expression object for ellipse core transformations.
Definition: Transformer.h:47
virtual void normalize()
Put the parameters into a &quot;standard form&quot;, and throw InvalidEllipseParameters if they cannot be norma...
Definitions for Ellipse::Transformer and BaseCore::Transformer.
boost::shared_ptr< BaseCore > Ptr
Definition: BaseCore.h:60
Definitions for BaseEllipse::Convolution and BaseCore::Convolution.
BaseCore & operator=(BaseCore const &other)
Set the parameters of this ellipse core from another.
Radius const & getRadius() const
Definition: Separable.h:65
Ellipticity const & getEllipticity() const
Definition: Separable.h:70
virtual std::string getName() const
Return a string that identifies this parametrization.
virtual void _assignFromAxes(double a, double b, double theta)
virtual void _assignToAxes(double &a, double &b, double &theta) const
Ptr clone() const
Deep copy the ellipse core.
Definition: Separable.h:74
Forward declarations, typedefs, and definitions for BaseCore.
Separable(double e1=0.0, double e2=0.0, double radius=Radius(), bool normalize=true)
Construct from parameter values.
Eigen::Vector3d ParameterVector
Parameter vector type.
Definition: BaseCore.h:66
virtual Jacobian _dAssignToQuadrupole(double &ixx, double &iyy, double &ixy) const
double const getE1() const
Definition: Separable.h:59
virtual Jacobian _dAssignFromQuadrupole(double ixx, double iyy, double ixy)
virtual void _assignFromQuadrupole(double ixx, double iyy, double ixy)
Separable(BaseCore::Convolution const &convolution)
Converting copy constructor.
Definition: Separable.h:121
boost::shared_ptr< Separable const > ConstPtr
Definition: Separable.h:52
An ellipse core with a complex ellipticity and radius parameterization.
Definition: radii.h:43
Eigen::Matrix3d Jacobian
Parameter Jacobian matrix type.
Definition: BaseCore.h:67
virtual void readParameters(double const *iter)
A base class for parametrizations of the &quot;core&quot; of an ellipse - the ellipticity and size...
Definition: BaseCore.h:54
Separable(Separable const &other)
Copy constructor.
Definition: Separable.h:109
Separable(BaseCore const &other)
Converting copy constructor.
Definition: Separable.h:112
afw::table::Key< double > b
virtual void _assignToQuadrupole(double &ixx, double &iyy, double &ixy) const
Separable & operator=(BaseCore const &other)
Converting assignment.
Definition: Separable.h:93
double const getE2() const
Definition: Separable.h:62
static BaseCore::Registrar< Separable > registrar
Definition: Separable.h:143
Separable & operator=(Separable const &other)
Standard assignment.
Definitions for Ellipse::GridTransform and BaseCore::GridTransform.
virtual void writeParameters(double *iter) const
boost::shared_ptr< Separable > Ptr
Definition: Separable.h:51
A temporary-only expression object for ellipse core convolution.
Definition: Convolution.h:44
virtual Jacobian _dAssignFromAxes(double a, double b, double theta)
void setRadius(double radius)
Definition: Separable.h:67
virtual BaseCore::Ptr _clone() const
Definition: Separable.h:127