Jpp 20.0.0-rc.9-22-g74b57fa79
the software that should make you happy
Loading...
Searching...
No Matches
JASTRONOMY::JMorphologyGauss2D Struct Reference

Implementation of 2D-Gaussian source morphology. More...

#include <JMorphology.hh>

Inheritance diagram for JASTRONOMY::JMorphologyGauss2D:
JLANG::JClonable< JClonable_t, JDerived_t >

Public Types

typedef JClonable< JClonable_t >::clone_type clone_type
 

Public Member Functions

virtual std::istream & read (std::istream &in) override
 Read source morphology from input stream.
 
virtual std::ostream & write (std::ostream &out) const override
 Write source morphology to output stream.
 
virtual JSourceLocation get () const override
 Get location on sky.
 
virtual clone_type clone () const override
 Get clone of this object.
 

Public Attributes

double sigmaX_deg
 
double sigmaY_deg
 

Detailed Description

Implementation of 2D-Gaussian source morphology.

Note that all input angles are in degrees.

Definition at line 239 of file JMorphology.hh.

Member Typedef Documentation

◆ clone_type

template<class JClonable_t , class JDerived_t >
JClonable<JClonable_t>::clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone_type
inherited

Definition at line 61 of file JClonable.hh.

Member Function Documentation

◆ read()

virtual std::istream & JASTRONOMY::JMorphologyGauss2D::read ( std::istream & in)
inlineoverridevirtual

Read source morphology from input stream.

Parameters
ininput stream
Returns
input stream

Definition at line 248 of file JMorphology.hh.

249 {
250 return JMorphology::read(in, *this)
251 >> this->sigmaX_deg >> this->sigmaY_deg;
252 }
static std::istream & read(std::istream &in, JSourceLocation &source)
Read source location in degrees from input stream.

◆ write()

virtual std::ostream & JASTRONOMY::JMorphologyGauss2D::write ( std::ostream & out) const
inlineoverridevirtual

Write source morphology to output stream.

Parameters
outoutput stream
Returns
output stream

Definition at line 261 of file JMorphology.hh.

262 {
263 return JMorphology::write(out, *this)
264 << ' ' << this->sigmaX_deg << ' ' << this->sigmaY_deg;
265 }
static std::ostream & write(std::ostream &out, const JSourceLocation &source)
Write source location in degrees to output stream.

◆ get()

virtual JSourceLocation JASTRONOMY::JMorphologyGauss2D::get ( ) const
inlineoverridevirtual

Get location on sky.

Returns
location on sky

Definition at line 273 of file JMorphology.hh.

274 {
275 using namespace JPP;
276
277 JDirection3D u(0.0, 0.0, 1.0);
278
279 if (sigmaX_deg > 0.0 ||
280 sigmaY_deg > 0.0) {
281
282 const double x = sin(gRandom->Gaus(0.0, getRadians(sigmaX_deg)));
283 const double y = sin(gRandom->Gaus(0.0, getRadians(sigmaY_deg)));
284
285 u = JDirection3D(x, y, sqrt(1.0 - x*x - y*y));
286 }
287
288 const JRotation3D Rs(this->getSourceLocation());
289
290 u.rotate_back(Rs);
291
292 return JSourceLocation(u);
293 }
Data structure for direction in three dimensions.
double getRadians(const double angle)
Convert angle to radians.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Location of astrophysical source.

◆ clone()

template<class JClonable_t , class JDerived_t >
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

Member Data Documentation

◆ sigmaX_deg

double JASTRONOMY::JMorphologyGauss2D::sigmaX_deg

Definition at line 296 of file JMorphology.hh.

◆ sigmaY_deg

double JASTRONOMY::JMorphologyGauss2D::sigmaY_deg

Definition at line 297 of file JMorphology.hh.


The documentation for this struct was generated from the following file: