LSST Applications g02d81e74bb+86cf3d8bc9,g180d380827+7a4e862ed4,g2079a07aa2+86d27d4dc4,g2305ad1205+e1ca1c66fa,g29320951ab+012e1474a1,g295015adf3+341ea1ce94,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g33d1c0ed96+0e5473021a,g3a166c0a6a+0e5473021a,g3ddfee87b4+c429d67c83,g48712c4677+f88676dd22,g487adcacf7+27e1e21933,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+b41db86c35,g5a732f18d5+53520f316c,g64a986408d+86cf3d8bc9,g858d7b2824+86cf3d8bc9,g8a8a8dda67+585e252eca,g99cad8db69+84912a7fdc,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+a2b54eae19,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+6681f309db,gc120e1dc64+f0fcc2f6d8,gc28159a63d+0e5473021a,gcf0d15dbbd+c429d67c83,gdaeeff99f8+f9a426f77a,ge6526c86ff+0433e6603d,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gff1a9f87cc+86cf3d8bc9,w.2024.17
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::ReducedShear Class Reference

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

#include <ReducedShear.h>

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

Public Types

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

Public Member Functions

 ReducedShear (std::complex< double > const &complex)
 
 ReducedShear (double e1=0.0, double e2=0.0)
 
 ReducedShear (ReducedShear const &other)
 
 ReducedShear (ReducedShear &&other)
 
 ~ReducedShear ()=default
 
 ReducedShear (Distortion const &other)
 
 ReducedShear (ConformalShear const &other)
 
ReducedShearoperator= (ReducedShear const &other)
 
ReducedShearoperator= (ReducedShear &&other)
 
ReducedShearoperator= (Distortion const &other)
 
ReducedShearoperator= (ConformalShear const &other)
 
Jacobian dAssign (ReducedShear const &other)
 
Jacobian dAssign (Distortion const &other)
 
Jacobian dAssign (ConformalShear 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-b}{a+b} \).

For a more complete definition, see Bernstein and Jarvis (2002); this the same as their reduced shear \(g\) (eq. 2.8).

Definition at line 45 of file ReducedShear.h.

Member Typedef Documentation

◆ Jacobian

Definition at line 47 of file EllipticityBase.h.

Member Enumeration Documentation

◆ ParameterEnum

Constructor & Destructor Documentation

◆ ReducedShear() [1/6]

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

Definition at line 47 of file ReducedShear.h.

47: detail::EllipticityBase(complex) {}

◆ ReducedShear() [2/6]

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

Definition at line 49 of file ReducedShear.h.

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

◆ ReducedShear() [3/6]

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

Definition at line 51 of file ReducedShear.h.

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

◆ ReducedShear() [4/6]

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

Definition at line 53 of file ReducedShear.h.

53: ReducedShear(other) {}
ReducedShear(std::complex< double > const &complex)

◆ ~ReducedShear()

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

◆ ReducedShear() [5/6]

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

Definition at line 56 of file ReducedShear.h.

56{ this->operator=(other); }
ReducedShear & operator=(ReducedShear const &other)

◆ ReducedShear() [6/6]

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

Definition at line 58 of file ReducedShear.h.

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

Member Function Documentation

◆ dAssign() [1/3]

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

Definition at line 79 of file ReducedShear.cc.

79 {
80 Jacobian result = Jacobian::Zero();
81 double eta = other.getE();
82 double alpha, beta;
83 if (eta < 1E-8) {
84 alpha = 0.5 - eta * eta / 24.0;
85 beta = -1.0 / 12;
86 } else {
87 double g = std::tanh(0.5 * eta);
88 alpha = g / eta;
89 beta = (0.5 * (1.0 - g * g) - alpha) / (eta * eta);
90 }
91 _complex = other.getComplex() * alpha;
92 result(0, 0) = alpha + other.getE1() * other.getE1() * beta;
93 result(1, 1) = alpha + other.getE2() * other.getE2() * beta;
94 result(1, 0) = result(0, 1) = other.getE1() * other.getE2() * beta;
95 return result;
96}
py::object result
Definition _schema.cc:429
T tanh(T... args)

◆ dAssign() [2/3]

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

Definition at line 60 of file ReducedShear.cc.

60 {
61 Jacobian result = Jacobian::Zero();
62 double delta = other.getE();
63 double s = std::sqrt(1.0 - delta * delta);
64 double alpha, beta;
65 if (delta < 1E-8) {
66 alpha = 0.5 + 0.125 * delta * delta;
67 beta = 0.25;
68 } else {
69 alpha = (1.0 - s) / (delta * delta);
70 beta = (2.0 * alpha - 1.0) / (delta * delta * s);
71 }
72 _complex = other.getComplex() * alpha;
73 result(0, 0) = alpha + other.getE1() * other.getE1() * beta;
74 result(1, 1) = alpha + other.getE2() * other.getE2() * beta;
75 result(1, 0) = result(0, 1) = other.getE1() * other.getE2() * beta;
76 return result;
77}
T sqrt(T... args)

◆ dAssign() [3/3]

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

Definition at line 71 of file ReducedShear.h.

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

◆ getAxisRatio()

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

Definition at line 33 of file ReducedShear.cc.

33 {
34 double e = getE();
35 return (1.0 - e) / (1.0 + e);
36}

◆ 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::ReducedShear::getName ( )
inlinestatic

Definition at line 84 of file ReducedShear.h.

84{ return "ReducedShear"; }

◆ 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::ReducedShear::normalize ( )
inline

Definition at line 82 of file ReducedShear.h.

82{}

◆ operator=() [1/4]

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

Definition at line 49 of file ReducedShear.cc.

49 {
50 double eta = other.getE();
51 if (eta < 1E-8) {
52 _complex = other.getComplex() * (0.5 - eta * eta / 12.0);
53 } else {
54 double g = std::tanh(0.5 * eta);
55 _complex = other.getComplex() * g / eta;
56 }
57 return *this;
58}

◆ operator=() [2/4]

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

Definition at line 38 of file ReducedShear.cc.

38 {
39 double delta = other.getE();
40 if (delta < 1E-8) {
41 _complex = other.getComplex() * (0.5 + 0.125 * delta * delta);
42 } else {
43 double g = (1.0 - std::sqrt(1.0 - delta * delta)) / delta;
44 _complex = other.getComplex() * g / delta;
45 }
46 return *this;
47}

◆ operator=() [3/4]

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

Definition at line 65 of file ReducedShear.h.

65{ return *this = other; }

◆ operator=() [4/4]

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

Definition at line 60 of file ReducedShear.h.

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

◆ 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: