LSST Applications g0d97872fb5+4fd969bb9d,g1653933729+34a971ddd9,g28da252d5a+072f89fe25,g2bbee38e9b+a99b0ab4cd,g2bc492864f+a99b0ab4cd,g2ca4be77d2+c0e3b27cd8,g2cdde0e794+704103fe75,g3156d2b45e+6e87dc994a,g347aa1857d+a99b0ab4cd,g35bb328faa+34a971ddd9,g3a166c0a6a+a99b0ab4cd,g3e281a1b8c+8ec26ec694,g4005a62e65+ba0306790b,g414038480c+9ed5ed841a,g569e0e2b34+cb4faa46ad,g5a97de2502+520531a62c,g717e5f8c0f+29153700a5,g7ede599f99+367733290c,g80478fca09+17051a22cc,g82479be7b0+f2f1ea0a87,g858d7b2824+29153700a5,g8b782ad322+29153700a5,g8cd86fa7b1+05420e7f7d,g9125e01d80+34a971ddd9,ga5288a1d22+e7f674aaf3,gae0086650b+34a971ddd9,gae74b0b5c6+45ef5cdc51,gb58c049af0+ace264a4f2,gc28159a63d+a99b0ab4cd,gcf0d15dbbd+8051a81198,gda6a2b7d83+8051a81198,gdaeeff99f8+7774323b41,gdf4d240d4a+34a971ddd9,ge2409df99d+cb167bac99,ge33fd446bb+29153700a5,ge79ae78c31+a99b0ab4cd,gf0baf85859+890af219f9,gf5289d68f6+9faa5c5784,w.2024.36
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
lsst::gauss2d::fit::GaussianParametricEllipse Class Reference

A Parameter-based implementation of lsst::gauss2d::EllipseData and ParametricEllipse. More...

#include <gaussianparametricellipse.h>

Inheritance diagram for lsst::gauss2d::fit::GaussianParametricEllipse:
lsst::gauss2d::EllipseData lsst::gauss2d::fit::ParametricEllipse lsst::gauss2d::Object lsst::gauss2d::fit::Parametric lsst::gauss2d::fit::QuasiEllipse lsst::gauss2d::Object

Public Member Functions

 GaussianParametricEllipse (std::shared_ptr< SigmaXParameterD > sigma_x, std::shared_ptr< SigmaYParameterD > sigma_y, std::shared_ptr< RhoParameterD > rho=nullptr)
 Construct a GaussianParametricEllipse from Parameter instances.
 
 GaussianParametricEllipse (double sigma_x=0, double sigma_y=0, double rho=0)
 Construct a GaussianParametricEllipse from values.
 
ParamRefsget_parameters (ParamRefs &params, ParamFilter *filter=nullptr) const override
 Add Parameter refs matching the filter to a vector, in order.
 
ParamCRefsget_parameters_const (ParamCRefs &params, ParamFilter *filter=nullptr) const override
 Same as get_parameters(), but for const refs.
 
double get_rho () const override
 Get rho.
 
double get_hwhm_x () const override
 Get the x-axis half-width at half-maximum.
 
double get_hwhm_y () const override
 Get the y-axis half-width at half-maximum.
 
double get_sigma_x () const override
 Get sigma_x.
 
double get_sigma_y () const override
 Get sigma_y.
 
double get_size_x () const override
 Get the size_x value.
 
double get_size_y () const override
 Get the size_y value.
 
std::array< double, 3 > get_xyr () const override
 Get sigma_x, sigma_y, rho.
 
std::array< double, 3 > get_hxyr () const override
 Get hwhm_x, hwhm_y, rho.
 
RhoParameterDget_rho_param () const override
 
SigmaXParameterDget_sigma_x_param () const
 Explicit alias for get_size_x_param.
 
SigmaYParameterDget_sigma_y_param () const
 Explicit alias for get_size_y_param.
 
SizeXParameterDget_size_x_param () const override
 
SizeYParameterDget_size_y_param () const override
 
std::shared_ptr< RhoParameterDget_rho_param_ptr () override
 
std::shared_ptr< SigmaXParameterDget_sigma_x_param_ptr ()
 Explicit alias for get_sigma_x_param_ptr.
 
std::shared_ptr< SigmaYParameterDget_sigma_y_param_ptr ()
 Explicit alias for get_sigma_y_param_ptr.
 
std::shared_ptr< SizeXParameterDget_size_x_param_ptr () override
 
std::shared_ptr< SizeYParameterDget_size_y_param_ptr () override
 
void set (double sigma_x, double sigma_y, double rho) override
 Set sigma_x, sigma_y, rho.
 
void set_h (double hwhm_x, double hwhm_y, double rho) override
 Set hwhm_x, hwhm_y, rho (half-width at half-max)
 
void set_rho (double rho) override
 Set the correlation parameter (rho)
 
void set_hwhm_x (double hwhm_x) override
 Set the x-axis half-width at half-max (FWHM/2)
 
void set_hwhm_y (double hwhm_y) override
 Set the y-axis half-width at half-max (FWHM/2)
 
void set_sigma_x (double sigma_x) override
 Set the x-axis dispersion (sigma)
 
void set_sigma_y (double sigma_y) override
 Set the y-axis dispersion (sigma)
 
void set_size_x (double sigma_x) override
 
void set_size_y (double sigma_y) override
 
void set_hxyr (const std::array< double, 3 > &hxyr) override
 Set hwhm_x, hwhm_y, rho from an array.
 
void set_xyr (const std::array< double, 3 > &xyr) override
 Set sigma_x, sigma_y, rho from an array.
 
std::string repr (bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
 Return a full, callable string representation of this.
 
std::string str () const override
 Return a brief, human-readable string representation of this.
 
virtual void convolve (const Ellipse &ell)
 Convolve this ellipse with another.
 
virtual double get_area () const
 Return the area of this ellipse, equal to pi*sigma_major*sigma_minor.
 
virtual double get_cov_xy () const
 Return the covariance, equal to sigma_x*sigma_y*rho.
 
virtual double get_radius_trace () const
 Return the trace radius, equal to sqrt(sigma_x^2 + sigma_y^2)
 
virtual double get_sigma_x_sq () const
 Get the square of sigma_x.
 
virtual double get_sigma_y_sq () const
 Get the square of sigma_y.
 
virtual double get_sigma_xy () const
 Return sigma_x*sigma_y.
 
virtual void set (const Covariance &covar)
 Set values from a Covariance object.
 
virtual void set (const EllipseMajor &ellipse)
 Set values from an EllipseMajor object.
 
bool operator== (const EllipseData &other) const
 
bool operator!= (const EllipseData &other) const
 
ParamRefs get_parameters_new (ParamFilter *filter=nullptr) const
 Same as get_parameters(), but returning a new vector.
 
ParamCRefs get_parameters_const_new (ParamFilter *filter=nullptr) const
 Same as get_parameters_const(), but returning a new vector.
 

Static Public Member Functions

static void check (double size_x, double size_y, double rho, std::string_view error_suffix="")
 Check whether Ellipse parameter values are valid, throwing if not.
 
static void check_size (double size, std::string_view error_suffix="")
 Check whether an x- or x-yaxis size value is valid.
 
static void check_rho (double rho, std::string_view error_suffix="")
 Check whether a rho value is valid.
 
static std::string_view null_str (const std::string_view &namespace_separator)
 
static std::string_view null_str (const std::string_view &namespace_separator)
 

Static Public Attributes

static constexpr std::string_view CC_NAMESPACE_SEPARATOR = "::"
 The C++ namespace separator.
 
static constexpr std::string_view NULL_STR_GENERAL = "None"
 
static constexpr std::string_view PY_NAMESPACE_SEPARATOR = "."
 
static constexpr std::string_view CC_NAMESPACE_SEPARATOR = "::"
 The C++ namespace separator.
 
static constexpr std::string_view NULL_STR_GENERAL = "None"
 
static constexpr std::string_view PY_NAMESPACE_SEPARATOR = "."
 

Detailed Description

A Parameter-based implementation of lsst::gauss2d::EllipseData and ParametricEllipse.

Definition at line 15 of file gaussianparametricellipse.h.

Constructor & Destructor Documentation

◆ GaussianParametricEllipse() [1/2]

lsst::gauss2d::fit::GaussianParametricEllipse::GaussianParametricEllipse ( std::shared_ptr< SigmaXParameterD > sigma_x,
std::shared_ptr< SigmaYParameterD > sigma_y,
std::shared_ptr< RhoParameterD > rho = nullptr )
explicit

Construct a GaussianParametricEllipse from Parameter instances.

Parameters
sigma_xThe SigmaXParameter to reference.
sigma_yThe SigmaYParameter to reference.
rhoThe RhoParameter to reference. Default-initialized if null.

Definition at line 17 of file gaussianparametricellipse.cc.

20 : _sigma_x(sigma_x == nullptr ? std::make_shared<SigmaXParameterD>(0) : std::move(sigma_x)),
21 _sigma_y(sigma_y == nullptr ? std::make_shared<SigmaYParameterD>(0) : std::move(sigma_y)),
22 _rho(rho == nullptr ? std::make_shared<RhoParameterD>(0) : std::move(rho)) {};
T make_shared(T... args)
T move(T... args)
STL namespace.

◆ GaussianParametricEllipse() [2/2]

lsst::gauss2d::fit::GaussianParametricEllipse::GaussianParametricEllipse ( double sigma_x = 0,
double sigma_y = 0,
double rho = 0 )
explicit

Construct a GaussianParametricEllipse from values.

Parameters
sigma_xThe value of the otherwise default-initialized SigmaXParameter.
sigma_yThe value of the otherwise default-initialized SigmaYParameter.
rhoThe value of the otherwise default-initialized RhoParameter.

Definition at line 23 of file gaussianparametricellipse.cc.

24 : _sigma_x(std::make_shared<SigmaXParameterD>(sigma_x)),
25 _sigma_y(std::make_shared<SigmaYParameterD>(sigma_y)),
26 _rho(std::make_shared<RhoParameterD>(rho)) {};

Member Function Documentation

◆ check()

static void lsst::gauss2d::EllipseData::check ( double size_x,
double size_y,
double rho,
std::string_view error_suffix = "" )
inlinestaticinherited

Check whether Ellipse parameter values are valid, throwing if not.

Definition at line 137 of file ellipse.h.

137 {
138 if (!(size_x >= 0) || !(size_y >= 0) || !(rho >= -1 && rho <= 1)) {
139 throw std::invalid_argument("Invalid size_x, size_y, rho=" + to_string_float(size_x) + ","
140 + to_string_float(size_y) + "," + to_string_float(rho)
141 + "; sigma_x,y >= 0 and 1 >= rho >= -1 required."
142 + std::string(error_suffix));
143 }
144 }
std::string to_string_float(const T value, const int precision=6, const bool scientific=true)
Definition to_string.h:15

◆ check_rho()

static void lsst::gauss2d::EllipseData::check_rho ( double rho,
std::string_view error_suffix = "" )
inlinestaticinherited

Check whether a rho value is valid.

Definition at line 153 of file ellipse.h.

153 {
154 if (!(rho >= -1 && rho <= 1)) {
155 throw std::invalid_argument("Invalid rho=" + to_string_float(rho) + "; 1 >= rho >= -1 required."
156 + std::string(error_suffix));
157 }
158 }

◆ check_size()

static void lsst::gauss2d::EllipseData::check_size ( double size,
std::string_view error_suffix = "" )
inlinestaticinherited

Check whether an x- or x-yaxis size value is valid.

Definition at line 146 of file ellipse.h.

146 {
147 if (!(size >= 0)) {
148 throw std::invalid_argument("Invalid size=" + to_string_float(size) + "; size >= 0 required."
149 + std::string(error_suffix));
150 }
151 }

◆ convolve()

void lsst::gauss2d::EllipseData::convolve ( const Ellipse & ell)
virtualinherited

Convolve this ellipse with another.

Definition at line 149 of file ellipse.cc.

149 {
150 double sigma_x_ell = ell.get_sigma_x();
151 double sigma_y_ell = ell.get_sigma_y();
152 double sigma_x = this->get_sigma_x();
153 sigma_x = sqrt(sigma_x * sigma_x + sigma_x_ell * sigma_x_ell);
154 double sigma_y = this->get_sigma_y();
155 sigma_y = sqrt(sigma_y * sigma_y + sigma_y_ell * sigma_y_ell);
156 double rho = (this->get_cov_xy() + ell.get_cov_xy()) / (sigma_x * sigma_y);
157 this->set(sigma_x, sigma_y, rho);
158}
virtual double get_cov_xy() const
Return the covariance, equal to sigma_x*sigma_y*rho.
Definition ellipse.cc:160
virtual double get_sigma_y() const =0
Get sigma_y.
virtual double get_sigma_x() const =0
Get sigma_x.
daf::base::PropertySet * set
Definition fits.cc:931

◆ get_area()

double lsst::gauss2d::EllipseData::get_area ( ) const
virtualinherited

Return the area of this ellipse, equal to pi*sigma_major*sigma_minor.

Definition at line 142 of file ellipse.cc.

142 {
143 double rho = this->get_rho();
144 return M_PI * this->get_sigma_xy() * sqrt(1 - rho * rho);
145}
#define M_PI
Definition ListMatch.cc:31
virtual double get_rho() const =0
Get rho.
virtual double get_sigma_xy() const
Return sigma_x*sigma_y.
Definition ellipse.cc:147

◆ get_cov_xy()

double lsst::gauss2d::EllipseData::get_cov_xy ( ) const
virtualinherited

Return the covariance, equal to sigma_x*sigma_y*rho.

Definition at line 160 of file ellipse.cc.

160{ return this->get_sigma_x() * this->get_sigma_y() * this->get_rho(); }

◆ get_hwhm_x()

double lsst::gauss2d::fit::GaussianParametricEllipse::get_hwhm_x ( ) const
overridevirtual

Get the x-axis half-width at half-maximum.

Reimplemented from lsst::gauss2d::EllipseData.

Definition at line 36 of file gaussianparametricellipse.cc.

36 {
37 return lsst::gauss2d::M_SIGMA_HWHM * _sigma_x->get_value();
38}
const double M_SIGMA_HWHM
Definition ellipse.h:39

◆ get_hwhm_y()

double lsst::gauss2d::fit::GaussianParametricEllipse::get_hwhm_y ( ) const
overridevirtual

Get the y-axis half-width at half-maximum.

Reimplemented from lsst::gauss2d::EllipseData.

Definition at line 39 of file gaussianparametricellipse.cc.

39 {
40 return lsst::gauss2d::M_SIGMA_HWHM * _sigma_y->get_value();
41}

◆ get_hxyr()

std::array< double, 3 > lsst::gauss2d::fit::GaussianParametricEllipse::get_hxyr ( ) const
overridevirtual

Get hwhm_x, hwhm_y, rho.

Reimplemented from lsst::gauss2d::EllipseData.

Definition at line 47 of file gaussianparametricellipse.cc.

47 {
48 return {this->get_hwhm_x(), this->get_hwhm_y(), this->get_rho()};
49}
double get_hwhm_x() const override
Get the x-axis half-width at half-maximum.
double get_hwhm_y() const override
Get the y-axis half-width at half-maximum.

◆ get_parameters()

ParamRefs & lsst::gauss2d::fit::GaussianParametricEllipse::get_parameters ( ParamRefs & params,
ParamFilter * filter = nullptr ) const
overridevirtual

Add Parameter refs matching the filter to a vector, in order.

Parameters
paramsThe vector to add to.
filterThe filter to apply to this Object's parameters.
Returns
A ref to params (for method chaining)

Implements lsst::gauss2d::fit::Parametric.

Definition at line 28 of file gaussianparametricellipse.cc.

28 {
29 return _get_parameters<ParamRefs>(params, filter, *_sigma_x, *_sigma_y, *_rho);
30}

◆ get_parameters_const()

ParamCRefs & lsst::gauss2d::fit::GaussianParametricEllipse::get_parameters_const ( ParamCRefs & params,
ParamFilter * filter = nullptr ) const
overridevirtual

Same as get_parameters(), but for const refs.

Implements lsst::gauss2d::fit::Parametric.

Definition at line 32 of file gaussianparametricellipse.cc.

32 {
33 return _get_parameters<ParamCRefs>(params, filter, *_sigma_x, *_sigma_y, *_rho);
34}

◆ get_parameters_const_new()

ParamCRefs lsst::gauss2d::fit::Parametric::get_parameters_const_new ( ParamFilter * filter = nullptr) const
inlineinherited

Same as get_parameters_const(), but returning a new vector.

Definition at line 33 of file parametric.h.

33 {
34 ParamCRefs params{};
35 get_parameters_const(params, filter);
36 return params;
37 }
virtual ParamCRefs & get_parameters_const(ParamCRefs &params, ParamFilter *filter=nullptr) const =0
Same as get_parameters(), but for const refs.
std::vector< ParamBaseCRef > ParamCRefs
Definition param_defs.h:11

◆ get_parameters_new()

ParamRefs lsst::gauss2d::fit::Parametric::get_parameters_new ( ParamFilter * filter = nullptr) const
inlineinherited

Same as get_parameters(), but returning a new vector.

Definition at line 27 of file parametric.h.

27 {
28 ParamRefs params{};
29 get_parameters(params, filter);
30 return params;
31 }
virtual ParamRefs & get_parameters(ParamRefs &params, ParamFilter *filter=nullptr) const =0
Add Parameter refs matching the filter to a vector, in order.
std::vector< ParamBaseRef > ParamRefs
Definition param_defs.h:13

◆ get_radius_trace()

double lsst::gauss2d::EllipseData::get_radius_trace ( ) const
virtualinherited

Return the trace radius, equal to sqrt(sigma_x^2 + sigma_y^2)

Definition at line 173 of file ellipse.cc.

173{ return sqrt(this->get_sigma_x_sq() + this->get_sigma_y_sq()); }
virtual double get_sigma_x_sq() const
Get the square of sigma_x.
Definition ellipse.cc:175
virtual double get_sigma_y_sq() const
Get the square of sigma_y.
Definition ellipse.cc:180

◆ get_rho()

double lsst::gauss2d::fit::GaussianParametricEllipse::get_rho ( ) const
overridevirtual

Get rho.

Implements lsst::gauss2d::EllipseData.

Definition at line 42 of file gaussianparametricellipse.cc.

42{ return _rho->get_value(); }

◆ get_rho_param()

RhoParameterD & lsst::gauss2d::fit::GaussianParametricEllipse::get_rho_param ( ) const
overridevirtual

Implements lsst::gauss2d::fit::ParametricEllipse.

Definition at line 55 of file gaussianparametricellipse.cc.

55{ return *_rho; }

◆ get_rho_param_ptr()

std::shared_ptr< RhoParameterD > lsst::gauss2d::fit::GaussianParametricEllipse::get_rho_param_ptr ( )
overridevirtual

Implements lsst::gauss2d::fit::ParametricEllipse.

Definition at line 61 of file gaussianparametricellipse.cc.

61{ return _rho; }

◆ get_sigma_x()

double lsst::gauss2d::fit::GaussianParametricEllipse::get_sigma_x ( ) const
overridevirtual

Get sigma_x.

Implements lsst::gauss2d::EllipseData.

Definition at line 43 of file gaussianparametricellipse.cc.

43{ return _sigma_x->get_value(); }

◆ get_sigma_x_param()

SigmaXParameterD & lsst::gauss2d::fit::GaussianParametricEllipse::get_sigma_x_param ( ) const

Explicit alias for get_size_x_param.

Definition at line 56 of file gaussianparametricellipse.cc.

56{ return *_sigma_x; }

◆ get_sigma_x_param_ptr()

std::shared_ptr< SigmaXParameterD > lsst::gauss2d::fit::GaussianParametricEllipse::get_sigma_x_param_ptr ( )

Explicit alias for get_sigma_x_param_ptr.

Definition at line 62 of file gaussianparametricellipse.cc.

62{ return _sigma_x; }

◆ get_sigma_x_sq()

double lsst::gauss2d::EllipseData::get_sigma_x_sq ( ) const
virtualinherited

Get the square of sigma_x.

Definition at line 175 of file ellipse.cc.

175 {
176 double sigma = this->get_sigma_x();
177 return sigma * sigma;
178}
afw::table::Key< double > sigma

◆ get_sigma_xy()

double lsst::gauss2d::EllipseData::get_sigma_xy ( ) const
virtualinherited

Return sigma_x*sigma_y.

Definition at line 147 of file ellipse.cc.

147{ return this->get_sigma_x() * this->get_sigma_y(); }

◆ get_sigma_y()

double lsst::gauss2d::fit::GaussianParametricEllipse::get_sigma_y ( ) const
overridevirtual

Get sigma_y.

Implements lsst::gauss2d::EllipseData.

Definition at line 44 of file gaussianparametricellipse.cc.

44{ return _sigma_y->get_value(); }

◆ get_sigma_y_param()

SigmaYParameterD & lsst::gauss2d::fit::GaussianParametricEllipse::get_sigma_y_param ( ) const

Explicit alias for get_size_y_param.

Definition at line 57 of file gaussianparametricellipse.cc.

57{ return *_sigma_y; }

◆ get_sigma_y_param_ptr()

std::shared_ptr< SigmaYParameterD > lsst::gauss2d::fit::GaussianParametricEllipse::get_sigma_y_param_ptr ( )

Explicit alias for get_sigma_y_param_ptr.

Definition at line 63 of file gaussianparametricellipse.cc.

63{ return _sigma_y; }

◆ get_sigma_y_sq()

double lsst::gauss2d::EllipseData::get_sigma_y_sq ( ) const
virtualinherited

Get the square of sigma_y.

Definition at line 180 of file ellipse.cc.

180 {
181 double sigma = this->get_sigma_y();
182 return sigma * sigma;
183}

◆ get_size_x()

double lsst::gauss2d::fit::GaussianParametricEllipse::get_size_x ( ) const
overridevirtual

Get the size_x value.

Implements lsst::gauss2d::fit::QuasiEllipse.

Definition at line 45 of file gaussianparametricellipse.cc.

45{ return _sigma_x->get_value(); }

◆ get_size_x_param()

SizeXParameterD & lsst::gauss2d::fit::GaussianParametricEllipse::get_size_x_param ( ) const
overridevirtual

Implements lsst::gauss2d::fit::ParametricEllipse.

Definition at line 58 of file gaussianparametricellipse.cc.

58{ return *_sigma_x; };

◆ get_size_x_param_ptr()

std::shared_ptr< SizeXParameterD > lsst::gauss2d::fit::GaussianParametricEllipse::get_size_x_param_ptr ( )
overridevirtual

Implements lsst::gauss2d::fit::ParametricEllipse.

Definition at line 64 of file gaussianparametricellipse.cc.

64{ return _sigma_x; };

◆ get_size_y()

double lsst::gauss2d::fit::GaussianParametricEllipse::get_size_y ( ) const
overridevirtual

Get the size_y value.

Implements lsst::gauss2d::fit::QuasiEllipse.

Definition at line 46 of file gaussianparametricellipse.cc.

46{ return _sigma_y->get_value(); }

◆ get_size_y_param()

SizeYParameterD & lsst::gauss2d::fit::GaussianParametricEllipse::get_size_y_param ( ) const
overridevirtual

Implements lsst::gauss2d::fit::ParametricEllipse.

Definition at line 59 of file gaussianparametricellipse.cc.

59{ return *_sigma_y; };

◆ get_size_y_param_ptr()

std::shared_ptr< SizeYParameterD > lsst::gauss2d::fit::GaussianParametricEllipse::get_size_y_param_ptr ( )
overridevirtual

Implements lsst::gauss2d::fit::ParametricEllipse.

Definition at line 65 of file gaussianparametricellipse.cc.

65{ return _sigma_y; };

◆ get_xyr()

std::array< double, 3 > lsst::gauss2d::fit::GaussianParametricEllipse::get_xyr ( ) const
overridevirtual

Get sigma_x, sigma_y, rho.

Reimplemented from lsst::gauss2d::EllipseData.

Definition at line 51 of file gaussianparametricellipse.cc.

51 {
52 return {this->get_sigma_x(), this->get_sigma_y(), this->get_rho()};
53}

◆ null_str() [1/2]

static std::string_view lsst::gauss2d::Object::null_str ( const std::string_view & namespace_separator)
inlinestaticinherited

Definition at line 49 of file object.h.

49 {
50 return namespace_separator == CC_NAMESPACE_SEPARATOR ? "nullptr" : NULL_STR_GENERAL;
51 }
static constexpr std::string_view CC_NAMESPACE_SEPARATOR
The C++ namespace separator.
Definition object.h:45
static constexpr std::string_view NULL_STR_GENERAL
Definition object.h:46

◆ null_str() [2/2]

static std::string_view lsst::gauss2d::Object::null_str ( const std::string_view & namespace_separator)
inlinestaticinherited

Definition at line 49 of file object.h.

49 {
50 return namespace_separator == CC_NAMESPACE_SEPARATOR ? "nullptr" : NULL_STR_GENERAL;
51 }

◆ operator!=()

bool lsst::gauss2d::EllipseData::operator!= ( const EllipseData & other) const
inlineinherited

Definition at line 217 of file ellipse.h.

217{ return !(*this == other); };

◆ operator==()

bool lsst::gauss2d::EllipseData::operator== ( const EllipseData & other) const
inlineinherited

Definition at line 216 of file ellipse.h.

216{ return get_xyr() == other.get_xyr(); };
virtual std::array< double, 3 > get_xyr() const
Get sigma_x, sigma_y, rho.
Definition ellipse.cc:169

◆ repr()

std::string lsst::gauss2d::fit::GaussianParametricEllipse::repr ( bool name_keywords = false,
std::string_view namespace_separator = Object::CC_NAMESPACE_SEPARATOR ) const
overridevirtual

Return a full, callable string representation of this.

Parameters
name_keywordsWhether to prefix arguments with "{name}=", where name is the arg name in the header (as with keyword arguments in Python).
namespace_separatorThe string to use to delimit namespaces, i.e. :: in C++ and . in Python.
Returns
A callable string representation of this, which should return an an identical object to this.
Note
The representation with name_keywords=false must be callable in C++. The representation with name_keywords=true should be callable in Python, if there are any bindings.

Implements lsst::gauss2d::EllipseData.

Definition at line 95 of file gaussianparametricellipse.cc.

95 {
96 return type_name_str<GaussianParametricEllipse>(false, namespace_separator) + "("
97 + (name_keywords ? "sigma_x=" : "") + _sigma_x->repr(name_keywords, namespace_separator) + ", "
98 + (name_keywords ? "sigma_y=" : "") + _sigma_y->repr(name_keywords, namespace_separator) + ", "
99 + (name_keywords ? "rho=" : "") + _rho->repr(name_keywords, namespace_separator) + ")";
100}

◆ set() [1/3]

void lsst::gauss2d::EllipseData::set ( const Covariance & covar)
virtualinherited

Set values from a Covariance object.

Definition at line 263 of file ellipse.cc.

263 {
264 double sigma_x = covar.get_sigma_x_sq();
265 double sigma_y = covar.get_sigma_y_sq();
266 sigma_x = sqrt(sigma_x);
267 sigma_y = sqrt(sigma_y);
268 double rho = (sigma_x == 0 || sigma_y == 0) ? 0 : covar.get_cov_xy() / (sigma_x * sigma_y);
269 this->set(sigma_x, sigma_y, rho);
270}

◆ set() [2/3]

void lsst::gauss2d::EllipseData::set ( const EllipseMajor & ellipse)
virtualinherited

Set values from an EllipseMajor object.

Definition at line 272 of file ellipse.cc.

272 {
273 const double r_major = ellipse.get_r_major();
274 if (r_major == 0) {
275 this->set(0, 0, 0);
276 return;
277 }
278 const double axrat = ellipse.get_axrat();
279 if (axrat == 1) {
280 this->set(r_major, r_major, 0);
281 return;
282 }
283 const auto [sin_th, cos_th] = sincos(ellipse.get_angle_radians());
284 const double sin_th_sq = sin_th * sin_th;
285 const double cos_th_sq = cos_th * cos_th;
286
287 const double r_major_sq = r_major * r_major;
288 const double r_minor_sq = r_major_sq * axrat * axrat;
289 const double sigma_x = sqrt(cos_th_sq * r_major_sq + sin_th_sq * r_minor_sq);
290 const double sigma_y = sqrt(sin_th_sq * r_major_sq + cos_th_sq * r_minor_sq);
291 double rho = (sigma_x == 0 || sigma_y == 0)
292 ? 0
293 : sin_th * cos_th * (r_major_sq - r_minor_sq) / (sigma_x * sigma_y);
294 this->set(sigma_x, sigma_y, rho);
295}
std::pair< S, S > sincos(S arg)
Definition ellipse.cc:36

◆ set() [3/3]

void lsst::gauss2d::fit::GaussianParametricEllipse::set ( double sigma_x,
double sigma_y,
double rho )
overridevirtual

Set sigma_x, sigma_y, rho.

Reimplemented from lsst::gauss2d::EllipseData.

Definition at line 67 of file gaussianparametricellipse.cc.

67 {
68 set_sigma_x(sigma_x);
69 set_sigma_y(sigma_y);
70 set_rho(rho);
71}
void set_sigma_y(double sigma_y) override
Set the y-axis dispersion (sigma)
void set_rho(double rho) override
Set the correlation parameter (rho)
void set_sigma_x(double sigma_x) override
Set the x-axis dispersion (sigma)

◆ set_h()

void lsst::gauss2d::fit::GaussianParametricEllipse::set_h ( double hwhm_x,
double hwhm_y,
double rho )
overridevirtual

Set hwhm_x, hwhm_y, rho (half-width at half-max)

Reimplemented from lsst::gauss2d::EllipseData.

Definition at line 72 of file gaussianparametricellipse.cc.

72 {
73 set_hwhm_x(hwhm_x);
74 set_hwhm_y(hwhm_y);
75 set_rho(rho);
76}
void set_hwhm_y(double hwhm_y) override
Set the y-axis half-width at half-max (FWHM/2)
void set_hwhm_x(double hwhm_x) override
Set the x-axis half-width at half-max (FWHM/2)

◆ set_hwhm_x()

void lsst::gauss2d::fit::GaussianParametricEllipse::set_hwhm_x ( double hwhm_x)
inlineoverridevirtual

Set the x-axis half-width at half-max (FWHM/2)

Reimplemented from lsst::gauss2d::EllipseData.

Definition at line 77 of file gaussianparametricellipse.cc.

77 {
78 _sigma_x->set_value(lsst::gauss2d::M_HWHM_SIGMA * hwhm_x);
79}
const double M_HWHM_SIGMA
Definition ellipse.h:38

◆ set_hwhm_y()

void lsst::gauss2d::fit::GaussianParametricEllipse::set_hwhm_y ( double hwhm_y)
inlineoverridevirtual

Set the y-axis half-width at half-max (FWHM/2)

Reimplemented from lsst::gauss2d::EllipseData.

Definition at line 80 of file gaussianparametricellipse.cc.

80 {
81 _sigma_y->set_value(lsst::gauss2d::M_HWHM_SIGMA * hwhm_y);
82}

◆ set_hxyr()

void lsst::gauss2d::fit::GaussianParametricEllipse::set_hxyr ( const std::array< double, 3 > & hxyr)
overridevirtual

Set hwhm_x, hwhm_y, rho from an array.

Reimplemented from lsst::gauss2d::EllipseData.

Definition at line 88 of file gaussianparametricellipse.cc.

88 {
89 this->set_h(hxyr[0], hxyr[1], hxyr[2]);
90}
void set_h(double hwhm_x, double hwhm_y, double rho) override
Set hwhm_x, hwhm_y, rho (half-width at half-max)

◆ set_rho()

void lsst::gauss2d::fit::GaussianParametricEllipse::set_rho ( double rho)
inlineoverridevirtual

Set the correlation parameter (rho)

Implements lsst::gauss2d::EllipseData.

Definition at line 83 of file gaussianparametricellipse.cc.

83{ _rho->set_value(rho); }

◆ set_sigma_x()

void lsst::gauss2d::fit::GaussianParametricEllipse::set_sigma_x ( double sigma_x)
inlineoverridevirtual

Set the x-axis dispersion (sigma)

Implements lsst::gauss2d::EllipseData.

Definition at line 84 of file gaussianparametricellipse.cc.

84{ _sigma_x->set_value(sigma_x); }

◆ set_sigma_y()

void lsst::gauss2d::fit::GaussianParametricEllipse::set_sigma_y ( double sigma_y)
inlineoverridevirtual

Set the y-axis dispersion (sigma)

Implements lsst::gauss2d::EllipseData.

Definition at line 85 of file gaussianparametricellipse.cc.

85{ _sigma_y->set_value(sigma_y); }

◆ set_size_x()

void lsst::gauss2d::fit::GaussianParametricEllipse::set_size_x ( double sigma_x)
inlineoverridevirtual

Implements lsst::gauss2d::fit::ParametricEllipse.

Definition at line 86 of file gaussianparametricellipse.cc.

86{ _sigma_x->set_value(size_x); }

◆ set_size_y()

void lsst::gauss2d::fit::GaussianParametricEllipse::set_size_y ( double sigma_y)
inlineoverridevirtual

Implements lsst::gauss2d::fit::ParametricEllipse.

Definition at line 87 of file gaussianparametricellipse.cc.

87{ _sigma_y->set_value(size_y); }

◆ set_xyr()

void lsst::gauss2d::fit::GaussianParametricEllipse::set_xyr ( const std::array< double, 3 > & xyr)
overridevirtual

Set sigma_x, sigma_y, rho from an array.

Reimplemented from lsst::gauss2d::EllipseData.

Definition at line 91 of file gaussianparametricellipse.cc.

91 {
92 this->set(xyr[0], xyr[1], xyr[2]);
93}

◆ str()

std::string lsst::gauss2d::fit::GaussianParametricEllipse::str ( ) const
overridevirtual

Return a brief, human-readable string representation of this.

Implements lsst::gauss2d::EllipseData.

Definition at line 102 of file gaussianparametricellipse.cc.

102 {
103 return type_name_str<GaussianParametricEllipse>(true) + "(sigma_x=" + _sigma_x->str()
104 + ", sigma_y=" + _sigma_y->str() + ", rho=" + _rho->str() + ")";
105}

Member Data Documentation

◆ CC_NAMESPACE_SEPARATOR [1/2]

constexpr std::string_view lsst::gauss2d::Object::CC_NAMESPACE_SEPARATOR = "::"
staticconstexprinherited

The C++ namespace separator.

Definition at line 45 of file object.h.

◆ CC_NAMESPACE_SEPARATOR [2/2]

constexpr std::string_view lsst::gauss2d::Object::CC_NAMESPACE_SEPARATOR = "::"
staticconstexprinherited

The C++ namespace separator.

Definition at line 45 of file object.h.

◆ NULL_STR_GENERAL [1/2]

constexpr std::string_view lsst::gauss2d::Object::NULL_STR_GENERAL = "None"
staticconstexprinherited

Definition at line 46 of file object.h.

◆ NULL_STR_GENERAL [2/2]

constexpr std::string_view lsst::gauss2d::Object::NULL_STR_GENERAL = "None"
staticconstexprinherited

Definition at line 46 of file object.h.

◆ PY_NAMESPACE_SEPARATOR [1/2]

constexpr std::string_view lsst::gauss2d::Object::PY_NAMESPACE_SEPARATOR = "."
staticconstexprinherited

Definition at line 47 of file object.h.

◆ PY_NAMESPACE_SEPARATOR [2/2]

constexpr std::string_view lsst::gauss2d::Object::PY_NAMESPACE_SEPARATOR = "."
staticconstexprinherited

Definition at line 47 of file object.h.


The documentation for this class was generated from the following files: