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

Classes

struct  angle_type
 Auxiliary data structure for pair of angles. More...
 
struct  angle_type_deg
 Auxiliary data structure for pair of angles. More...
 
struct  angle_type_rad
 Auxiliary data structure for pair of angles. More...
 
struct  J2000
 Conversion of source location. More...
 
class  JAstronomy
 Auxiliary class to make coordinate transformations for a specific geographical location of the detector. More...
 
struct  JEllipsoid
 Ellipsoid. More...
 
struct  JGalacticCoordinates
 Location of astrophysical source in Galactic coordinates. More...
 
struct  JGeographicalLocation
 Location of detector. More...
 
struct  JMorphology
 Inteface for source morphology simulation. More...
 
struct  JMorphology_t
 Helper for source morphology. More...
 
struct  JMorphologyBinary
 Implementation of binary source morphology. More...
 
struct  JMorphologyGauss
 Implementation of Gaussian source morphology. More...
 
struct  JMorphologyGauss2D
 Implementation of 2D-Gaussian source morphology. More...
 
struct  JMorphologyHistogram
 Implementation of histogram source morphology. More...
 
struct  JMorphologyPoint
 Implementation of point source morphology. More...
 
struct  JNeutrinoDirection
 Direction of incident neutrino. More...
 
struct  JResolution
 Inteface for detector resolution simulation. More...
 
struct  JResolution_t
 Helper for detector resolution. More...
 
struct  JResolutionGauss
 Implementation of Gaussian detector resolution. More...
 
struct  JResolutionLog
 Implementation of detector resolution based on histogram filled according <tt>log10(alpha). More...
 
struct  JResolutionTF1
 Implementation of detector resolution based on a formula. More...
 
struct  JResolutionTH1
 Implementation of detector resolution based on histogram. More...
 
struct  JSourceLocation
 Location of astrophysical source. More...
 
struct  JSourceLocationJ2000
 Location of astrophysical source. More...
 
struct  JStarTrek
 Auxiliary class for source tracking. More...
 

Functions

double getTimeMJD (time_t t1_s)
 Get MJD time given UTC time.
 
double getTimeUTC (time_t t1_s)
 Get UTC time given MJD time.
 
double getRadians (const double angle)
 Convert angle to radians.
 
double getDegrees (const double angle)
 Convert angle to degrees.
 
double getRadians (const int angle, const int amin, const double asec)
 Convert angle to radians.
 
double getHourAngle (const int hour, const int min, const double sec)
 Convert hour angle to radians.
 
double getMeridianConvergenceAngle (const JGeographicalLocation &location)
 Get Meridian convergence angle.
 
double getMeridianConvergenceAngle (const JGeographicalLocation &location, const JEllipsoid &ellipsoid)
 Get Meridian convergence angle.
 

Variables

static const double NUMBER_OF_SECONDS_PER_HOUR = 60.0 * 60.0
 
static const double NUMBER_OF_SECONDS_PER_DAY = NUMBER_OF_SECONDS_PER_HOUR * 24.0
 
static const double NUMBER_OF_SECONDS_PER_YEAR = NUMBER_OF_SECONDS_PER_DAY * 365.0
 
static const double NUMBER_OF_SECONDS_PER_SEDERIAL_DAY = NUMBER_OF_SECONDS_PER_HOUR * 23.9344696
 
static const double LATITUDE_MIN_DEG = -80.0
 Minimal latitude angle [deg] of UTM for meridian convergence angle calculation.
 
static const double LATITUDE_MAX_DEG = 84.0
 Maximal latitude angle [deg] of UTM for meridian convergence angle calculation.
 
static const double MJD_EPOCH = 40587.0
 MJD of the Unix Epoch, i.e. 00:00 Jan 1 1970 (UTC) [d].
 
static const double MJD_EPOCH_S = MJD_EPOCH * NUMBER_OF_SECONDS_PER_DAY
 MJD of the Unix Epoch, i.e. 00:00 Jan 1 1970 (UTC) [s].
 
static const JEllipsoid EARTH_WGS84 = { 6378137.0, 0.00669438 }
 Earth ellipsoid according WGS84.
 
static const JGeographicalLocation ANTARES (42, 48, 06, 10)
 
static const JGeographicalLocation SICILY (36, 16, 16, 06)
 
static const JGeographicalLocation PYLOS (36, 33, 16, 06)
 
static const JGeographicalLocation ARCA (0.63342, 0.27883)
 
static const JGeographicalLocation ORCA (0.74702, 0.10511)
 
static const JSourceLocation GALACTIC_CENTER (-0.5062816, -1.633335)
 
static const JSourceLocation RXJ1713 (getRadians(-39, -46, 0.0), getHourAngle(17, 13, 7))
 
static const JSourceLocation VELAX (getRadians(-45, -10, -35.2), getHourAngle(8, 35, 20.66))
 

Detailed Description

Author
mdejong

Function Documentation

◆ getTimeMJD()

double JASTRONOMY::getTimeMJD ( time_t t1_s)

Get MJD time given UTC time.

Parameters
t1_sUTC time [s]
Returns
MJD time [s]

Definition at line 86 of file JAstronomy.hh.

87 {
88 return t1_s + MJD_EPOCH_S;
89 }
static const double MJD_EPOCH_S
MJD of the Unix Epoch, i.e. 00:00 Jan 1 1970 (UTC) [s].
Definition JAstronomy.hh:52

◆ getTimeUTC()

double JASTRONOMY::getTimeUTC ( time_t t1_s)

Get UTC time given MJD time.

Parameters
t1_sMJD time [s]
Returns
UTC time [s]

Definition at line 98 of file JAstronomy.hh.

99 {
100 return t1_s - MJD_EPOCH_S;
101 }

◆ getRadians() [1/2]

double JASTRONOMY::getRadians ( const double angle)
inline

Convert angle to radians.

Parameters
angleangle [deg]
Returns
angle [rad]

Definition at line 110 of file JAstronomy.hh.

111 {
112 return PI * angle / 180.0;
113 }

◆ getDegrees()

double JASTRONOMY::getDegrees ( const double angle)
inline

Convert angle to degrees.

Parameters
angleangle [rad]
Returns
angle [deg]

Definition at line 122 of file JAstronomy.hh.

123 {
124 return 180.0 * angle / PI;
125 }

◆ getRadians() [2/2]

double JASTRONOMY::getRadians ( const int angle,
const int amin,
const double asec )
inline

Convert angle to radians.

Parameters
angleangle [deg]
aminarcminutes
asecarcseconds
Returns
angle [rad]

Definition at line 136 of file JAstronomy.hh.

139 {
140 return PI * ((double) angle +
141 (double) amin / 60.0 +
142 (double) asec / 3600.0) / 180.0;
143 }

◆ getHourAngle()

double JASTRONOMY::getHourAngle ( const int hour,
const int min,
const double sec )
inline

Convert hour angle to radians.

Parameters
hourhour
minminutes
secseconds
Returns
angle [rad]

Definition at line 154 of file JAstronomy.hh.

157 {
158 double ha = PI * ((double) hour / 12.0 +
159 (double) min / 720.0 +
160 (double) sec / 43200.0);
161
162 if (ha > PI) {
163 ha -= 2*PI;
164 }
165
166 return ha;
167 }

◆ getMeridianConvergenceAngle() [1/2]

double JASTRONOMY::getMeridianConvergenceAngle ( const JGeographicalLocation & location)
inline

Get Meridian convergence angle.

The meridian convergence angle is the angle between the true meridian of a point on the surface of the earth's ellipsoid and the Prime Meridian of the projection zone where the point is located, that is, the angle between the coordinate north and the true north of the Gaussian plane rectangular coordinate system. see https://gis.stackexchange.com/questions/115531/calculating-grid-convergence-true-north-to-grid-north

Parameters
locationgeographical location
Returns
meridian convergence angle [rad]

Definition at line 928 of file JAstronomy.hh.

929 {
930 const double omega = location.getLongitude() - getUTMLongitude(getUTMZone(location.getLongitude()));
931 const double gamma = atan(tan(omega) * sin(location.getLatitude()));
932
933 return gamma;
934 }
double getLongitude() const
Get longitude.
double getLatitude() const
Get latitude.

◆ getMeridianConvergenceAngle() [2/2]

double JASTRONOMY::getMeridianConvergenceAngle ( const JGeographicalLocation & location,
const JEllipsoid & ellipsoid )
inline

Get Meridian convergence angle.

Angular difference of the UTM Northing direction to the geodetic North. It is positive to the East. For example, for ANTARES, convergence angle = -1.93 deg E, i.e. UTM North pointing a bit towards the geographical West. Code from aanet/evt/Det.cc.

Parameters
locationgeographical location
ellipsoidEarth ellipsoid
Returns
meridian convergence angle [rad]

Definition at line 948 of file JAstronomy.hh.

949 {
950 const double latitude_deg = getDegrees(location.getLatitude());
951
952 if (latitude_deg > LATITUDE_MAX_DEG ||
953 latitude_deg < LATITUDE_MIN_DEG) {
955 "UTM coordinate system not defined for given Latitude: "
956 << latitude_deg << " [deg] <> [" << FIXED(5,2) << LATITUDE_MAX_DEG << "," << FIXED(5,2) << LATITUDE_MIN_DEG << "]");
957 }
958
959 // detector position, longitude and latitude in rad
960 const double lambda = location.getLongitude();
961 const double phi = location.getLatitude();
962
963 // find UTM zone and central meridian
964 // longitude of the central meridian of UTM zone in rad
965 const double omega = lambda - getUTMLongitude(getUTMZone(location.getLongitude()));
966
967 const double rho = ellipsoid.radius_m*(1.-ellipsoid.eccentricity)/pow(1.-ellipsoid.eccentricity*pow(sin(phi),2),3./2.);
968 const double nu = ellipsoid.radius_m/sqrt(1-ellipsoid.eccentricity*pow(sin(phi),2.));
969 const double psi = nu/rho;
970 const double t = tan(phi);
971
972 // power series for convergence angle
973 const double gamma = sin(phi) * omega
974 - sin(phi) * pow(omega,3.)/3. * pow(cos(phi),2.) * (2.*pow(psi,2.)-psi)
975 - sin(phi) * pow(omega,5.)/15. * pow(cos(phi),4.) * (pow(psi,4.)*(11.-24.*pow(t,2.))-
976 pow(psi,3.)*(11.-36.*pow(t,2.))+
977 2.*pow(psi,2.)*(1.-7.*pow(t,2.))+
978 psi*pow(t,2.)
979 )
980 - sin(phi) * pow(omega,7.)/315. * pow(cos(phi),6.) * (17.-26.*pow(t,2.)+2.*pow(t,4.));
981
982 return gamma;
983 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
static Ellipsoid ellipsoid[]
Exception for accessing a value in a collection that is outside of its range.
double getDegrees(const double angle)
Convert angle to degrees.
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448

Variable Documentation

◆ NUMBER_OF_SECONDS_PER_HOUR

const double JASTRONOMY::NUMBER_OF_SECONDS_PER_HOUR = 60.0 * 60.0
static

Definition at line 43 of file JAstronomy.hh.

◆ NUMBER_OF_SECONDS_PER_DAY

const double JASTRONOMY::NUMBER_OF_SECONDS_PER_DAY = NUMBER_OF_SECONDS_PER_HOUR * 24.0
static

Definition at line 44 of file JAstronomy.hh.

◆ NUMBER_OF_SECONDS_PER_YEAR

const double JASTRONOMY::NUMBER_OF_SECONDS_PER_YEAR = NUMBER_OF_SECONDS_PER_DAY * 365.0
static

Definition at line 45 of file JAstronomy.hh.

◆ NUMBER_OF_SECONDS_PER_SEDERIAL_DAY

const double JASTRONOMY::NUMBER_OF_SECONDS_PER_SEDERIAL_DAY = NUMBER_OF_SECONDS_PER_HOUR * 23.9344696
static

Definition at line 46 of file JAstronomy.hh.

◆ LATITUDE_MIN_DEG

const double JASTRONOMY::LATITUDE_MIN_DEG = -80.0
static

Minimal latitude angle [deg] of UTM for meridian convergence angle calculation.

Definition at line 48 of file JAstronomy.hh.

◆ LATITUDE_MAX_DEG

const double JASTRONOMY::LATITUDE_MAX_DEG = 84.0
static

Maximal latitude angle [deg] of UTM for meridian convergence angle calculation.

Definition at line 49 of file JAstronomy.hh.

◆ MJD_EPOCH

const double JASTRONOMY::MJD_EPOCH = 40587.0
static

MJD of the Unix Epoch, i.e. 00:00 Jan 1 1970 (UTC) [d].

Definition at line 51 of file JAstronomy.hh.

◆ MJD_EPOCH_S

const double JASTRONOMY::MJD_EPOCH_S = MJD_EPOCH * NUMBER_OF_SECONDS_PER_DAY
static

MJD of the Unix Epoch, i.e. 00:00 Jan 1 1970 (UTC) [s].

Definition at line 52 of file JAstronomy.hh.

◆ EARTH_WGS84

const JEllipsoid JASTRONOMY::EARTH_WGS84 = { 6378137.0, 0.00669438 }
static

Earth ellipsoid according WGS84.

Definition at line 77 of file JAstronomy.hh.

77{ 6378137.0, 0.00669438 };

◆ ANTARES

const JGeographicalLocation JASTRONOMY::ANTARES(42, 48, 06, 10) ( 42 ,
48 ,
06 ,
10  )
static

◆ SICILY

const JGeographicalLocation JASTRONOMY::SICILY(36, 16, 16, 06) ( 36 ,
16 ,
16 ,
06  )
static

◆ PYLOS

const JGeographicalLocation JASTRONOMY::PYLOS(36, 33, 16, 06) ( 36 ,
33 ,
16 ,
06  )
static

◆ ARCA

const JGeographicalLocation JASTRONOMY::ARCA(0.63342, 0.27883) ( 0. 63342,
0. 27883 )
static

◆ ORCA

const JGeographicalLocation JASTRONOMY::ORCA(0.74702, 0.10511) ( 0. 74702,
0. 10511 )
static

◆ GALACTIC_CENTER

const JSourceLocation JASTRONOMY::GALACTIC_CENTER(-0.5062816, -1.633335) ( -0. 5062816,
-1. 633335 )
static

◆ RXJ1713

const JSourceLocation JASTRONOMY::RXJ1713(getRadians(-39, -46, 0.0), getHourAngle(17, 13, 7)) ( getRadians(-39, -46, 0.0) ,
getHourAngle(17, 13, 7)  )
static

◆ VELAX

const JSourceLocation JASTRONOMY::VELAX(getRadians(-45, -10, -35.2), getHourAngle(8, 35, 20.66)) ( getRadians(-45, -10, -35.2) ,
getHourAngle(8, 35, 20.66)  )
static