lsst.gauss2d gbf99507273+b0138be388
 
Loading...
Searching...
No Matches
lsst::gauss2d::Ellipse Class Reference

An Ellipse with sigma_x, sigma_y, and rho values. More...

#include <ellipse.h>

Inheritance diagram for lsst::gauss2d::Ellipse:
lsst::gauss2d::EllipseData lsst::gauss2d::Object

Public Member Functions

 Ellipse (std::shared_ptr< EllipseData > data)
 
 Ellipse (double sigma_x=0, double sigma_y=0, double rho=0)
 Construct a new Ellipse object with default float values.
 
 Ellipse (const Covariance &covar)
 
 Ellipse (const EllipseMajor &ellipse)
 
const EllipseDataget_data () const
 Return a const ref to this ellipse's data.
 
double get_rho () const override
 Get rho.
 
double get_sigma_x () const override
 Get sigma_x.
 
double get_sigma_y () const override
 Get sigma_y.
 
std::shared_ptr< Ellipsemake_convolution (const Ellipse &ell) const
 Return the convolution of this with another ellipse.
 
std::unique_ptr< Ellipsemake_convolution_uniq (const Ellipse &ell) const
 Same as make_convolution(), but returning a unique_ptr.
 
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)
 
void set_sigma_y (double sigma_y) override
 Set the y-axis dispersion (sigma)
 
std::string repr (bool name_keywords=false, std::string_view namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override
 
std::string str () const override
 Return a brief, human-readable string representation of this.
 
bool operator== (const Ellipse &other) const
 
bool operator!= (const Ellipse &other) const
 
- Public Member Functions inherited from lsst::gauss2d::EllipseData
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_hwhm_x () const
 Get the x-axis half-width at half-maximum.
 
virtual double get_hwhm_y () const
 Get the y-axis half-width at half-maximum.
 
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 std::array< double, 3 > get_hxyr () const
 Get hwhm_x, hwhm_y, rho.
 
virtual std::array< double, 3 > get_xyr () const
 Get sigma_x, sigma_y, rho.
 
virtual void set (double sigma_x, double sigma_y, double rho)
 Set sigma_x, sigma_y, rho.
 
virtual void set (const Covariance &covar)
 Set values from a Covariance object.
 
virtual void set (const EllipseMajor &ellipse)
 Set values from an EllipseMajor object.
 
virtual void set_h (double hwhm_x, double hwhm_y, double rho)
 Set hwhm_x, hwhm_y, rho (half-width at half-max)
 
virtual void set_hwhm_x (double hwhm_x)
 Set the x-axis half-width at half-max (FWHM/2)
 
virtual void set_hwhm_y (double hwhm_y)
 Set the y-axis half-width at half-max (FWHM/2)
 
virtual void set_hxyr (const std::array< double, 3 > &hxyr)
 Set hwhm_x, hwhm_y, rho from an array.
 
virtual void set_xyr (const std::array< double, 3 > &xyr)
 Set sigma_x, sigma_y, rho from an array.
 
bool operator== (const EllipseData &other) const
 
bool operator!= (const EllipseData &other) const
 

Additional Inherited Members

- Static Public Member Functions inherited from lsst::gauss2d::EllipseData
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 Public Member Functions inherited from lsst::gauss2d::Object
static std::string_view null_str (const std::string_view &namespace_separator)
 
- Static Public Attributes inherited from lsst::gauss2d::Object
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

An Ellipse with sigma_x, sigma_y, and rho values.

This ellipse parameterization requires sigma_x and sigma_y >=0, and the correlation -1 < rho < 1.

Note
This ellipse parameterization can be represented as a matrix, with sigma_x and sigma_y on the diagonal, and the other two values set to rho.

Constructor & Destructor Documentation

◆ Ellipse()

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

Construct a new Ellipse object with default float values.

Parameters
sigma_xThe initial sigma_x value (default 0)
sigma_yThe initial sigma_y value (default 0)
rhoThe intial rho value (default 0)

Member Function Documentation

◆ get_rho()

double lsst::gauss2d::Ellipse::get_rho ( ) const
overridevirtual

Get rho.

Implements lsst::gauss2d::EllipseData.

◆ get_sigma_x()

double lsst::gauss2d::Ellipse::get_sigma_x ( ) const
overridevirtual

Get sigma_x.

Implements lsst::gauss2d::EllipseData.

◆ get_sigma_y()

double lsst::gauss2d::Ellipse::get_sigma_y ( ) const
overridevirtual

Get sigma_y.

Implements lsst::gauss2d::EllipseData.

◆ make_convolution()

std::shared_ptr< Ellipse > lsst::gauss2d::Ellipse::make_convolution ( const Ellipse & ell) const

Return the convolution of this with another ellipse.

Convolution simply sums the values of the covariance matrix terms.

Parameters
ellThe ellipse to convolve with.
Returns
A new ellipse with values set to the convolution.

◆ repr()

std::string lsst::gauss2d::Ellipse::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.

◆ set_rho()

void lsst::gauss2d::Ellipse::set_rho ( double rho)
overridevirtual

Set the correlation parameter (rho)

Implements lsst::gauss2d::EllipseData.

◆ set_sigma_x()

void lsst::gauss2d::Ellipse::set_sigma_x ( double sigma_x)
overridevirtual

Set the x-axis dispersion (sigma)

Implements lsst::gauss2d::EllipseData.

◆ set_sigma_y()

void lsst::gauss2d::Ellipse::set_sigma_y ( double sigma_y)
overridevirtual

Set the y-axis dispersion (sigma)

Implements lsst::gauss2d::EllipseData.

◆ str()

std::string lsst::gauss2d::Ellipse::str ( ) const
overridevirtual

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

Implements lsst::gauss2d::EllipseData.


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