1#ifndef __JASTRONOMY__JASTRONOMY__
2#define __JASTRONOMY__JASTRONOMY__
22#include "slalib/slalib.h"
112 return PI * angle / 180.0;
124 return 180.0 * angle / PI;
140 return PI * ((double) angle +
141 (double) amin / 60.0 +
142 (double) asec / 3600.0) / 180.0;
158 double ha = PI * ((double) hour / 12.0 +
159 (double) min / 720.0 +
160 (double) sec / 43200.0);
195 const double precision = std::numeric_limits<double>::min())
const
198 fabs(this->
_phi_ - angle.
_phi_) <= precision);
211 return in >>
object._theta_
224 return out <<
FIXED(12,7) <<
object._theta_ <<
' '
225 <<
FIXED(12,7) <<
object._phi_;
406 slaPrenut(epoch, mjd, R);
409 R[1][0], R[1][1], R[1][2],
410 R[2][0], R[2][1], R[2][2]);
656 const double longitude) :
768 const double azimuth) :
844 const double longitude) :
858 const int minutesNorth,
859 const int degreesEast,
860 const int minutesEast) :
862 getRadians((double) degreesEast + (double) minutesEast / 60.0))
931 const double gamma = atan(tan(omega) * sin(location.
getLatitude()));
955 "UTM coordinate system not defined for given Latitude: "
965 const double omega = lambda - getUTMLongitude(getUTMZone(location.
getLongitude()));
969 const double psi = nu/rho;
970 const double t = tan(phi);
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.))+
980 - sin(phi) * pow(omega,7.)/315. * pow(cos(phi),6.) * (17.-26.*pow(t,2.)+2.*pow(t,4.));
1027 double gmst = slaGmst(mjd);
1028 double eqeqx = slaEqeqx(mjd);
1029 double lst = gmst + longitude + eqeqx;
1035 double ha = lst - ra;
1043 slaDe2h(ha, dec, latitude, &azimuth, &elevation);
1045 double theta = -elevation + PI/2.0;
1046 double phi = -azimuth + PI/2.0;
1089 double elevation = -theta + PI/2.0;
1090 double azimuth = -phi + PI/2.0;
1095 slaDh2e(azimuth, elevation, latitude, &ha, &dec);
1099 double gmst = slaGmst(mjd);
1100 double eqeqx = slaEqeqx(mjd);
1101 double lst = gmst + longitude + eqeqx;
1102 double ra = lst - ha;
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
static Ellipsoid ellipsoid[]
Auxiliary class to make coordinate transformations for a specific geographical location of the detect...
JSourceLocation getSourceLocation(const double t1_s, const JNeutrinoDirection &dir) const
Get location of source given time and neutrino direction.
JNeutrinoDirection getNeutrinoDirection(const double t1_s, const JSourceLocation &pos) const
Get direction pointing to source given time and source location.
JAstronomy(const JGeographicalLocation &location, const JEllipsoid &ellipsoid=EARTH_WGS84)
Constructor.
Data structure for angles in three dimensions.
Data structure for direction in three dimensions.
JDirection3D & transform(const JMatrix3D &T)
Transform.
double getTheta() const
Get theta angle.
double getPhi() const
Get phi angle.
Exception for accessing a value in a collection that is outside of its range.
JMatrix3D & transpose()
Transpose.
Singular value decomposition.
const JMatrix3D & invert(const double precision=1.0e-12) const
Get inverted matrix.
void convert(std::ostream &out, const Header &header, const CSV &csv)
static const JSourceLocation VELAX(getRadians(-45, -10, -35.2), getHourAngle(8, 35, 20.66))
static const JGeographicalLocation PYLOS(36, 33, 16, 06)
double getHourAngle(const int hour, const int min, const double sec)
Convert hour angle to radians.
static const JSourceLocation GALACTIC_CENTER(-0.5062816, -1.633335)
static const double NUMBER_OF_SECONDS_PER_YEAR
double getMeridianConvergenceAngle(const JGeographicalLocation &location)
Get Meridian convergence angle.
double getTimeMJD(time_t t1_s)
Get MJD time given UTC time.
static const JSourceLocation RXJ1713(getRadians(-39, -46, 0.0), getHourAngle(17, 13, 7))
static const double NUMBER_OF_SECONDS_PER_DAY
static const JGeographicalLocation ARCA(0.63342, 0.27883)
static const double NUMBER_OF_SECONDS_PER_SEDERIAL_DAY
double getDegrees(const double angle)
Convert angle to degrees.
static const double LATITUDE_MAX_DEG
Maximal latitude angle [deg] of UTM for meridian convergence angle calculation.
static const double LATITUDE_MIN_DEG
Minimal latitude angle [deg] of UTM for meridian convergence angle calculation.
static const double NUMBER_OF_SECONDS_PER_HOUR
static const JGeographicalLocation ORCA(0.74702, 0.10511)
static const JEllipsoid EARTH_WGS84
Earth ellipsoid according WGS84.
static const double MJD_EPOCH
MJD of the Unix Epoch, i.e. 00:00 Jan 1 1970 (UTC) [d].
static const double MJD_EPOCH_S
MJD of the Unix Epoch, i.e. 00:00 Jan 1 1970 (UTC) [s].
double getRadians(const double angle)
Convert angle to radians.
double getTimeUTC(time_t t1_s)
Get UTC time given MJD time.
static const JGeographicalLocation ANTARES(42, 48, 06, 10)
static const JGeographicalLocation SICILY(36, 16, 16, 06)
static const double PI
Mathematical constants.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
int getUTMZone(const double longitude)
Get UTM zone for given longitude.
static double getUTMLongitude(const int zone)
Get longitude of the central meridian for given UTM zone.
Auxiliary data structure for floating point format specification.
Conversion of source location.
CONVERSION
Conversion options.
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.
double eccentricity
Ellipsoid eccentricity squared.
const JEllipsoid & getEllipsoid() const
Get ellipsoid.
double radius_m
Ellipsoid radius [m];.
Location of astrophysical source in Galactic coordinates.
JGalacticCoordinates()
Default constructor.
double getDot(const JGalacticCoordinates &location) const
Dot product.
double getLongitude() const
Get longitude.
double getLatitude() const
Get latitude.
JGalacticCoordinates(const JAngle3D &angle)
Constructor.
const JGalacticCoordinates & getGalacticCoordinates() const
Get Galactic coordinates.
JGalacticCoordinates(const double latitude, const double longitude)
Constructor.
double getLongitude() const
Get longitude.
JGeographicalLocation(const JAngle3D &angle)
Constructor.
JGeographicalLocation()
Default constructor.
double getDot(const JGeographicalLocation &location) const
Dot product.
JGeographicalLocation(const int degreesNorth, const int minutesNorth, const int degreesEast, const int minutesEast)
Constructor.
JGeographicalLocation(const double latitude, const double longitude)
Constructor.
const JGeographicalLocation & getGeographicalLocation() const
Get geographical location.
double getLatitude() const
Get latitude.
Direction of incident neutrino.
JNeutrinoDirection(const double zenith, const double azimuth)
Constructor.
double getZenith() const
Get zenith.
const JNeutrinoDirection & getNeutrinoDirection() const
Get neutrino direction.
JNeutrinoDirection()
Default constructor.
JNeutrinoDirection(const JAngle3D &angle)
Constructor.
double getDot(const JNeutrinoDirection &dir) const
Dot product.
double getAzimuth() const
Get azimuth.
Location of astrophysical source.
const JSourceLocationJ2000 & getSourceLocation() const
Get source location.
JSourceLocationJ2000(const JAngle3D &angle)
Constructor.
JSourceLocationJ2000(const double dec, const double ra)
Constructor.
JSourceLocationJ2000()
Default constructor.
double getDot(const JSourceLocationJ2000 &location) const
Dot product.
double getRightAscension() const
Get right ascension.
double getDeclination() const
Get declination.
Location of astrophysical source.
const JSourceLocation & getSourceLocation() const
Get source location.
double getRightAscension() const
Get right ascension.
JSourceLocation()
Default constructor.
double getDot(const JSourceLocation &location) const
Dot product.
JSourceLocation(const double dec, const double ra)
Constructor.
double getDeclination() const
Get declination.
JSourceLocation(const JAngle3D &angle)
Constructor.
Auxiliary data structure for pair of angles.
angle_type_deg(const double theta, const double phi)
Constructor.
void set(const angle_type_rad &angle)
Convert angle.
angle_type_deg()
Default constructor.
Auxiliary data structure for pair of angles.
angle_type_rad()
Default constructor.
angle_type_rad(const double theta, const double phi)
Constructor.
void set(const angle_type_deg &angle)
Convert angle.
Auxiliary data structure for pair of angles.
angle_type()
Default constructor.
friend std::istream & operator>>(std::istream &in, angle_type &object)
Read pair of angles from input stream.
friend std::ostream & operator<<(std::ostream &out, const angle_type &object)
Write pair of angles to output stream.
bool equals(const angle_type &angle, const double precision=std::numeric_limits< double >::min()) const
Check equality.
angle_type(const double theta, const double phi)
Constructor.
Template definition of auxiliary base class for comparison of data structures.