LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+0dd8ce4237,g1470d8bcf6+3ea6592b6f,g2079a07aa2+86d27d4dc4,g2305ad1205+5ca4c0b359,g295015adf3+d10818ec9d,g2a9a014e59+6f9be1b9cd,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+703ba97ebf,g487adcacf7+4fa16da234,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ffa42b374e,g5a732f18d5+53520f316c,g64a986408d+0dd8ce4237,g858d7b2824+0dd8ce4237,g8a8a8dda67+585e252eca,g99cad8db69+d39438377f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+f1d96605c8,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+e5339d463f,gc120e1dc64+da31e9920e,gc28159a63d+0e5473021a,gcf0d15dbbd+703ba97ebf,gdaeeff99f8+f9a426f77a,ge6526c86ff+889fc9d533,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf18bd8381d+7268b93478,gff1a9f87cc+0dd8ce4237,w.2024.16
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
lsst::afw::geom::ellipses::Distortion Class Reference

A complex ellipticity with magnitude \(|e| = \frac{a^2 - b^2}{a^2 + b^2}\). More...

#include <Distortion.h>

Inheritance diagram for lsst::afw::geom::ellipses::Distortion:
lsst::afw::geom::ellipses::detail::EllipticityBase

Public Types

enum  ParameterEnum { E1 = 0 , E2 = 1 }
 
using Jacobian = Eigen::Matrix2d
 

Public Member Functions

 Distortion (std::complex< double > const &complex)
 
 Distortion (double e1=0.0, double e2=0.0)
 
 Distortion (Distortion const &other)
 
 Distortion (Distortion &&other)
 
 ~Distortion ()=default
 
 Distortion (ConformalShear const &other)
 
 Distortion (ReducedShear const &other)
 
Distortionoperator= (Distortion const &other)
 
Distortionoperator= (Distortion &&other)
 
Distortionoperator= (ConformalShear const &other)
 
Distortionoperator= (ReducedShear const &other)
 
Jacobian dAssign (Distortion const &other)
 
Jacobian dAssign (ConformalShear const &other)
 
Jacobian dAssign (ReducedShear const &other)
 
double getAxisRatio () const
 
void normalize ()
 
std::complex< double > & getComplex ()
 
std::complex< double > const & getComplex () const
 
void setComplex (std::complex< double > const &v)
 
double getE1 () const
 
void setE1 (double e1)
 
double getE2 () const
 
void setE2 (double e2)
 
double getE () const
 
void setE (double e)
 
double getTheta () const
 

Static Public Member Functions

static std::string getName ()
 

Protected Attributes

std::complex< double > _complex
 

Detailed Description

A complex ellipticity with magnitude \(|e| = \frac{a^2 - b^2}{a^2 + b^2}\).

For a more complete definition, see Bernstein and Jarvis (2002); this the same as their distortion \(\delta\) (eq. 2.7).

Definition at line 44 of file Distortion.h.

Member Typedef Documentation

◆ Jacobian

Definition at line 47 of file EllipticityBase.h.

Member Enumeration Documentation

◆ ParameterEnum

Constructor & Destructor Documentation

◆ Distortion() [1/6]

lsst::afw::geom::ellipses::Distortion::Distortion ( std::complex< double > const & complex)
inlineexplicit

Definition at line 46 of file Distortion.h.

46: detail::EllipticityBase(complex) {}

◆ Distortion() [2/6]

lsst::afw::geom::ellipses::Distortion::Distortion ( double e1 = 0.0,
double e2 = 0.0 )
inlineexplicit

Definition at line 48 of file Distortion.h.

48: detail::EllipticityBase(e1, e2) {}

◆ Distortion() [3/6]

lsst::afw::geom::ellipses::Distortion::Distortion ( Distortion const & other)
inline

Definition at line 50 of file Distortion.h.

50: detail::EllipticityBase(other.getComplex()) {}

◆ Distortion() [4/6]

lsst::afw::geom::ellipses::Distortion::Distortion ( Distortion && other)
inline

Definition at line 52 of file Distortion.h.

52: Distortion(other) {}
Distortion(std::complex< double > const &complex)
Definition Distortion.h:46

◆ ~Distortion()

lsst::afw::geom::ellipses::Distortion::~Distortion ( )
default

◆ Distortion() [5/6]

lsst::afw::geom::ellipses::Distortion::Distortion ( ConformalShear const & other)
inlineexplicit

Definition at line 55 of file Distortion.h.

55{ this->operator=(other); }
Distortion & operator=(Distortion const &other)
Definition Distortion.h:59

◆ Distortion() [6/6]

lsst::afw::geom::ellipses::Distortion::Distortion ( ReducedShear const & other)
inlineexplicit

Definition at line 57 of file Distortion.h.

57{ this->operator=(other); }

Member Function Documentation

◆ dAssign() [1/3]

detail::EllipticityBase::Jacobian lsst::afw::geom::ellipses::Distortion::dAssign ( ConformalShear const & other)

Definition at line 56 of file Distortion.cc.

56 {
57 Jacobian result = Jacobian::Zero();
58 double eta = other.getE();
59 double alpha, beta;
60 if (eta < 1E-8) {
61 alpha = (1.0 - eta * eta / 3.0);
62 beta = -2.0 / 3.0;
63 } else {
64 double delta = std::tanh(eta);
65 alpha = delta / eta;
66 beta = (1.0 - delta * delta - alpha) / (eta * eta);
67 }
68 _complex = other.getComplex() * alpha;
69 result(0, 0) = alpha + other.getE1() * other.getE1() * beta;
70 result(1, 1) = alpha + other.getE2() * other.getE2() * beta;
71 result(1, 0) = result(0, 1) = other.getE1() * other.getE2() * beta;
72 return result;
73}
py::object result
Definition _schema.cc:429
T tanh(T... args)

◆ dAssign() [2/3]

Jacobian lsst::afw::geom::ellipses::Distortion::dAssign ( Distortion const & other)
inline

Definition at line 70 of file Distortion.h.

70 {
71 _complex = other._complex;
72 return Jacobian::Identity();
73 }

◆ dAssign() [3/3]

detail::EllipticityBase::Jacobian lsst::afw::geom::ellipses::Distortion::dAssign ( ReducedShear const & other)

Definition at line 75 of file Distortion.cc.

75 {
76 Jacobian result = Jacobian::Zero();
77 double g = other.getE();
78 double alpha = 2.0 / (1 + g * g);
79 double beta = -alpha * alpha;
80 _complex = other.getComplex() * alpha;
81 result(0, 0) = alpha + other.getE1() * other.getE1() * beta;
82 result(1, 1) = alpha + other.getE2() * other.getE2() * beta;
83 result(1, 0) = result(0, 1) = other.getE1() * other.getE2() * beta;
84 return result;
85}

◆ getAxisRatio()

double lsst::afw::geom::ellipses::Distortion::getAxisRatio ( ) const

Definition at line 34 of file Distortion.cc.

34 {
35 double e = getE();
36 return std::sqrt((1.0 - e) / (1.0 + e));
37}
T sqrt(T... args)

◆ getComplex() [1/2]

std::complex< double > & lsst::afw::geom::ellipses::detail::EllipticityBase::getComplex ( )
inlineinherited

Definition at line 51 of file EllipticityBase.h.

51{ return _complex; }

◆ getComplex() [2/2]

std::complex< double > const & lsst::afw::geom::ellipses::detail::EllipticityBase::getComplex ( ) const
inlineinherited

Definition at line 53 of file EllipticityBase.h.

53{ return _complex; }

◆ getE()

double lsst::afw::geom::ellipses::detail::EllipticityBase::getE ( ) const
inlineinherited

Definition at line 75 of file EllipticityBase.h.

75{ return std::sqrt(std::norm(_complex)); }

◆ getE1()

double lsst::afw::geom::ellipses::detail::EllipticityBase::getE1 ( ) const
inlineinherited

Definition at line 57 of file EllipticityBase.h.

57{ return _complex.real(); }
T real(T... args)

◆ getE2()

double lsst::afw::geom::ellipses::detail::EllipticityBase::getE2 ( ) const
inlineinherited

Definition at line 66 of file EllipticityBase.h.

66{ return _complex.imag(); }
T imag(T... args)

◆ getName()

static std::string lsst::afw::geom::ellipses::Distortion::getName ( )
inlinestatic

Definition at line 83 of file Distortion.h.

83{ return "Distortion"; }

◆ getTheta()

double lsst::afw::geom::ellipses::detail::EllipticityBase::getTheta ( ) const
inlineinherited

Definition at line 78 of file EllipticityBase.h.

78{ return 0.5 * std::arg(_complex); }

◆ normalize()

void lsst::afw::geom::ellipses::Distortion::normalize ( )

Definition at line 87 of file Distortion.cc.

87 {
88 if (getE() > 1.0) {
90 "Distortion magnitude cannot be greater than one.");
91 }
92}
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
Reports invalid arguments.
Definition Runtime.h:66

◆ operator=() [1/4]

Distortion & lsst::afw::geom::ellipses::Distortion::operator= ( ConformalShear const & other)

Definition at line 39 of file Distortion.cc.

39 {
40 double eta = other.getE();
41 if (eta < 1E-8) {
42 _complex = other.getComplex() * (1.0 - eta * eta / 3.0);
43 } else {
44 double delta = std::tanh(eta);
45 _complex = other.getComplex() * delta / eta;
46 }
47 return *this;
48}

◆ operator=() [2/4]

Distortion & lsst::afw::geom::ellipses::Distortion::operator= ( Distortion && other)
inline

Definition at line 64 of file Distortion.h.

64{ return *this = other; }

◆ operator=() [3/4]

Distortion & lsst::afw::geom::ellipses::Distortion::operator= ( Distortion const & other)
inline

Definition at line 59 of file Distortion.h.

59 {
60 _complex = other._complex;
61 return *this;
62 }

◆ operator=() [4/4]

Distortion & lsst::afw::geom::ellipses::Distortion::operator= ( ReducedShear const & other)

Definition at line 50 of file Distortion.cc.

50 {
51 double g = other.getE();
52 _complex = other.getComplex() * 2.0 / (1 + g * g);
53 return *this;
54}

◆ setComplex()

void lsst::afw::geom::ellipses::detail::EllipticityBase::setComplex ( std::complex< double > const & v)
inlineinherited

Definition at line 55 of file EllipticityBase.h.

55{ _complex = v; }

◆ setE()

void lsst::afw::geom::ellipses::detail::EllipticityBase::setE ( double e)
inlineinherited

Definition at line 76 of file EllipticityBase.h.

76{ _complex *= e / getE(); }

◆ setE1()

void lsst::afw::geom::ellipses::detail::EllipticityBase::setE1 ( double e1)
inlineinherited

Definition at line 58 of file EllipticityBase.h.

58 {
59#if __cplusplus < 201103L
61#else
62 _complex.real(e1);
63#endif
64 }

◆ setE2()

void lsst::afw::geom::ellipses::detail::EllipticityBase::setE2 ( double e2)
inlineinherited

Definition at line 67 of file EllipticityBase.h.

67 {
68#if __cplusplus < 201103L
70#else
71 _complex.imag(e2);
72#endif
73 }

Member Data Documentation

◆ _complex

std::complex<double> lsst::afw::geom::ellipses::detail::EllipticityBase::_complex
protectedinherited

Definition at line 91 of file EllipticityBase.h.


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