Jpp 19.3.0
the software that should make you happy
Loading...
Searching...
No Matches
JASTRONOMY::JSourceLocation Struct Reference

Location of astrophysical source. More...

#include <JAstronomy.hh>

Inheritance diagram for JASTRONOMY::JSourceLocation:
JASTRONOMY::angle_type_rad JASTRONOMY::angle_type JLANG::JEquals< JFirst_t, JSecond_t > JASTRONOMY::JMorphology JASTRONOMY::JMorphologyBinary JASTRONOMY::JMorphologyGauss JASTRONOMY::JMorphologyGauss2D JASTRONOMY::JMorphologyHistogram JASTRONOMY::JMorphologyPoint

Public Member Functions

 JSourceLocation ()
 Default constructor.
 
 JSourceLocation (const double dec, const double ra)
 Constructor.
 
 JSourceLocation (const double t1_s, const JSourceLocationJ2000 &location)
 Conversion constructor.
 
 JSourceLocation (const JAngle3D &angle)
 Constructor.
 
const JSourceLocationgetSourceLocation () const
 Get source location.
 
 operator JAngle3D () const
 Type conversion operator.
 
double getDeclination () const
 Get declination.
 
double getRightAscension () const
 Get right ascension.
 
double getDot (const JSourceLocation &location) const
 Dot product.
 
void set (const angle_type_deg &angle)
 Convert angle.
 
bool equals (const angle_type &angle, const double precision=std::numeric_limits< double >::min()) const
 Check equality.
 

Protected Attributes

double _theta_
 
double _phi_
 

Detailed Description

Location of astrophysical source.

Definition at line 439 of file JAstronomy.hh.

Constructor & Destructor Documentation

◆ JSourceLocation() [1/4]

JASTRONOMY::JSourceLocation::JSourceLocation ( )
inline

Default constructor.

Definition at line 445 of file JAstronomy.hh.

446 {}

◆ JSourceLocation() [2/4]

JASTRONOMY::JSourceLocation::JSourceLocation ( const double dec,
const double ra )
inline

Constructor.

Parameters
decdeclination [rad]
raright ascension [rad]

Definition at line 455 of file JAstronomy.hh.

456 :
457 angle_type_rad(dec, ra)
458 {}
angle_type_rad()
Default constructor.

◆ JSourceLocation() [3/4]

JASTRONOMY::JSourceLocation::JSourceLocation ( const double t1_s,
const JSourceLocationJ2000 & location )

Conversion constructor.

Parameters
t1_stime since MJD [s]
locationsource location

Definition at line 620 of file JAstronomy.hh.

620 :
622 {}
static angle_type_rad convert(const double t1_s, const angle_type_rad &location, const J2000::CONVERSION option)
Convert source location according J2000 at given time.

◆ JSourceLocation() [4/4]

JASTRONOMY::JSourceLocation::JSourceLocation ( const JAngle3D & angle)
inline

Constructor.

Parameters
anglepolar angles [rad]

Definition at line 475 of file JAstronomy.hh.

475 :
476 angle_type_rad(PI/2 - angle.getTheta(), angle.getPhi())
477 {}

Member Function Documentation

◆ getSourceLocation()

const JSourceLocation & JASTRONOMY::JSourceLocation::getSourceLocation ( ) const
inline

Get source location.

Returns
source location

Definition at line 485 of file JAstronomy.hh.

486 {
487 return static_cast<const JSourceLocation&>(*this);
488 }
JSourceLocation()
Default constructor.

◆ operator JAngle3D()

JASTRONOMY::JSourceLocation::operator JAngle3D ( ) const
inline

Type conversion operator.

Returns
polar angles [rad]

Definition at line 496 of file JAstronomy.hh.

497 {
498 return JAngle3D(PI/2 - _theta_, _phi_);
499 }

◆ getDeclination()

double JASTRONOMY::JSourceLocation::getDeclination ( ) const
inline

Get declination.

Definition at line 502 of file JAstronomy.hh.

◆ getRightAscension()

double JASTRONOMY::JSourceLocation::getRightAscension ( ) const
inline

Get right ascension.

Definition at line 503 of file JAstronomy.hh.

◆ getDot()

double JASTRONOMY::JSourceLocation::getDot ( const JSourceLocation & location) const
inline

Dot product.

Parameters
locationsource location
Returns
dot product

Definition at line 512 of file JAstronomy.hh.

513 {
514 return
515 cos(this->_theta_) * cos(location._theta_) * cos(this->_phi_ - location._phi_) +
516 sin(this->_theta_) * sin(location._theta_);
517 }

◆ set()

void JASTRONOMY::angle_type_rad::set ( const angle_type_deg & angle)
inlineinherited

Convert angle.

Parameters
angleangle [rad]

Definition at line 293 of file JAstronomy.hh.

294 {
295 static_cast<angle_type_rad&>(*this) = angle_type_rad(angle);
296 }

◆ equals()

bool JASTRONOMY::angle_type::equals ( const angle_type & angle,
const double precision = std::numeric_limits<double>::min() ) const
inlineinherited

Check equality.

Parameters
anglepair of angles
precisionprecision
Returns
true if angles are equal; else false

Definition at line 194 of file JAstronomy.hh.

196 {
197 return (fabs(this->_theta_ - angle._theta_) <= precision &&
198 fabs(this->_phi_ - angle._phi_) <= precision);
199 }

Member Data Documentation

◆ _theta_

double JASTRONOMY::angle_type::_theta_
protectedinherited

Definition at line 250 of file JAstronomy.hh.

◆ _phi_

double JASTRONOMY::angle_type::_phi_
protectedinherited

Definition at line 251 of file JAstronomy.hh.


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