Jpp  18.5.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
JASTRONOMY Namespace Reference

Classes

class  JSourceLocation
 Location of astrophysical source. More...
 
class  JGalacticCoordinates
 Location of astrophysical source in Galactic coordinates. More...
 
class  JNeutrinoDirection
 Direction of incident neutrino. More...
 
class  JGeographicalLocation
 Location of detector. More...
 
class  JAstronomy
 Auxiliary class to make coordinate transformations for a specific geographical location of the detector. More...
 
struct  JStarTrek
 Auxiliary class for source tracking. More...
 

Functions

double sla_gmst_ (double &ut1)
 
double sla_gmsta_ (double &ut1, double &part_day)
 
double sla_eqeqx_ (double &ut1)
 
void sla_de2h_ (double &hourangle, double &declination, double &observer_latitude, double &azimuth, double &elevation)
 
void sla_dh2e_ (double &azimuth, double &elevation, double &observer_latitude, double &hourangle, double &declination)
 
void sla_eqecl_ (double &rightascension, double &declination, double &time, double &ecliptic_longitude, double &ecliptic_latitude)
 
void sla_ecleq_ (double &ecliptic_longitude, double &ecliptic_latitude, double &time, double &rightascension, double &declination)
 
void sla_eqgal_ (double &rightascension, double &declination, double &galactic_longitude, double &galactic_latitude)
 
void sla_galeq_ (double &galactic_longitude, double &galactic_latitude, double &rightascension, double &declination)
 
void sla_galsup_ (double &galactic_longitude, double &galactic_latitude, double &sgalactic_longitude, double &sgalactic_latitude)
 
void sla_supgal_ (double &sgalactic_longitude, double &sgalactic_latitude, double &galactic_longitude, double &galactic_latitude)
 
void sla_caldj_ (int &year, int &month, int &day, double &mjd, int &status)
 
void sla_clyd_ (int &year, int &month, int &day, int &nyears, int &ndays, int &status)
 
void sla_djcal_ (int &precision, double &mjd, int result[4], int &status)
 
void sla_dd2tf_ (int &ndec, double &day, char sign[1], int result[4])
 
double sla_dtt_ (double &ut1)
 
void sla_rdplan_ (double &dtt, int &object, const double &longitude, const double &latitude, double &rightascension, double &declination, double &diam)
 
void sla_preces_ (char *system, double &ep0, double &ep1, double &ra, double &dec, int length)
 
void sla_prenut_ (double &epoch, double &mjd, double rmatpn[3][3])
 
double wrap (double angle)
 
int get_utm_zone (double lat)
 
double longitude_of_central_meridian (int utmzone)
 
double compute_meridian_convergence_angle (double longitude, double latitude)
 
void correct_to_j2000 (double &in_dec, double &in_ra, double &mjd, double &out_dec, double &out_ra, bool reverse=false)
 Convert (Dec, RA) to J2000. More...
 
double getRadians (const double angle)
 Convert angle to radians. More...
 
double getRadians (const int angle, const int amin, const double asec)
 Convert angle to radians. More...
 
double getHourAngle (const int hour, const int min, const double sec)
 Convert hour angle to radians. More...
 
double getDot (const JNeutrinoDirection &first, const JNeutrinoDirection &second)
 Dot product. More...
 
double getDot (const JSourceLocation &first, const JSourceLocation &second)
 Dot product. More...
 

Variables

static const double MJD_EPOCH = 40587.0
 
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 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 (36, 17, 15, 58)
 
static const JGeographicalLocation ORCA (42, 48, 06, 02)
 
static const JSourceLocation galacticCenter (-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

double JASTRONOMY::sla_gmst_ ( double &  ut1)
double JASTRONOMY::sla_gmsta_ ( double &  ut1,
double &  part_day 
)
double JASTRONOMY::sla_eqeqx_ ( double &  ut1)
void JASTRONOMY::sla_de2h_ ( double &  hourangle,
double &  declination,
double &  observer_latitude,
double &  azimuth,
double &  elevation 
)
void JASTRONOMY::sla_dh2e_ ( double &  azimuth,
double &  elevation,
double &  observer_latitude,
double &  hourangle,
double &  declination 
)
void JASTRONOMY::sla_eqecl_ ( double &  rightascension,
double &  declination,
double &  time,
double &  ecliptic_longitude,
double &  ecliptic_latitude 
)
void JASTRONOMY::sla_ecleq_ ( double &  ecliptic_longitude,
double &  ecliptic_latitude,
double &  time,
double &  rightascension,
double &  declination 
)
void JASTRONOMY::sla_eqgal_ ( double &  rightascension,
double &  declination,
double &  galactic_longitude,
double &  galactic_latitude 
)
void JASTRONOMY::sla_galeq_ ( double &  galactic_longitude,
double &  galactic_latitude,
double &  rightascension,
double &  declination 
)
void JASTRONOMY::sla_galsup_ ( double &  galactic_longitude,
double &  galactic_latitude,
double &  sgalactic_longitude,
double &  sgalactic_latitude 
)
void JASTRONOMY::sla_supgal_ ( double &  sgalactic_longitude,
double &  sgalactic_latitude,
double &  galactic_longitude,
double &  galactic_latitude 
)
void JASTRONOMY::sla_caldj_ ( int &  year,
int &  month,
int &  day,
double &  mjd,
int &  status 
)
void JASTRONOMY::sla_clyd_ ( int &  year,
int &  month,
int &  day,
int &  nyears,
int &  ndays,
int &  status 
)
void JASTRONOMY::sla_djcal_ ( int &  precision,
double &  mjd,
int  result[4],
int &  status 
)
void JASTRONOMY::sla_dd2tf_ ( int &  ndec,
double &  day,
char  sign[1],
int  result[4] 
)
double JASTRONOMY::sla_dtt_ ( double &  ut1)
void JASTRONOMY::sla_rdplan_ ( double &  dtt,
int &  object,
const double &  longitude,
const double &  latitude,
double &  rightascension,
double &  declination,
double &  diam 
)
void JASTRONOMY::sla_preces_ ( char *  system,
double &  ep0,
double &  ep1,
double &  ra,
double &  dec,
int  length 
)
void JASTRONOMY::sla_prenut_ ( double &  epoch,
double &  mjd,
double  rmatpn[3][3] 
)
double JASTRONOMY::wrap ( double  angle)
inline

Definition at line 102 of file JAstronomy.hh.

103  {
104  int n = int(angle / (2 * JMATH::PI)) - (angle < 0);
105  angle -= n * 2 * JMATH::PI;
106  return angle;
107  }
const int n
Definition: JPolint.hh:786
static const double PI
Mathematical constants.
int JASTRONOMY::get_utm_zone ( double  lat)
inline

Definition at line 114 of file JAstronomy.hh.

115  {
116  return 1 + int( ( JMATH::PI + lat ) / ( 6 * JMATH::PI / 180 ) );
117  }
static const double PI
Mathematical constants.
double JASTRONOMY::longitude_of_central_meridian ( int  utmzone)
inline

Definition at line 123 of file JAstronomy.hh.

124  {
125  const double zone_width = 6 * JMATH::PI / 180;
126  return -JMATH::PI + (utmzone -1)*zone_width + zone_width/2;
127  }
static const double PI
Mathematical constants.
double JASTRONOMY::compute_meridian_convergence_angle ( double  longitude,
double  latitude 
)
inline

Definition at line 138 of file JAstronomy.hh.

139  {
140 
141  double latitude_deg = latitude * 180/JMATH::PI;
142 
143  if ( latitude_deg > 84. || latitude_deg < -80.)
144  {
145  std::cout << "UTM coordinate system not defined for given Latitude: %f (max 84 deg N or min -80 deg S), setting meridian convergence angle to 0 deg.";
146  return 0;
147  }
148 
149  // detector position, longitude and latitude in rad
150  double lambda = longitude;
151  double phi = latitude;
152 
153  // find UTM zone and central meridian
154  // longitude of the central meridian of UTM zone in rad
155  double lambda0 = longitude_of_central_meridian( get_utm_zone( longitude ) );
156  double omega = lambda-lambda0;
157 
158  // parameters of the Earth ellipsoid
159  double a = 6378137.; // semi-major axis in meters (WGS84)
160  double e2 = 0.0066943800; // eccentricity (WGS84)
161 
162  double rho = a*(1.-e2)/pow(1.-e2*pow(sin(phi),2),3./2.);
163  double nu = a/sqrt(1-e2*pow(sin(phi),2.));
164  double psi = nu/rho;
165  double t = tan(phi);
166 
167  // power series for convergence angle
168  double gamma = sin(phi) * omega
169  - sin(phi) * pow(omega,3.)/3. * pow(cos(phi),2.) * (2.*pow(psi,2.)-psi)
170  - sin(phi) * pow(omega,5.)/15. * pow(cos(phi),4.) * (pow(psi,4.)*(11.-24.*pow(t,2.))-
171  pow(psi,3.)*(11.-36.*pow(t,2.))+
172  2.*pow(psi,2.)*(1.-7.*pow(t,2.))+
173  psi*pow(t,2.)
174  )
175  - sin(phi) * pow(omega,7.)/315. * pow(cos(phi),6.) * (17.-26.*pow(t,2.)+2.*pow(t,4.));
176 
177  return gamma;
178  }
then usage set_variable ACOUSTICS_WORKDIR $WORKDIR set_variable FORMULA sin([0]+2 *$PI *([1]+[2]*x)*x)" set_variable DY 1.0e-8 mkdir $WORKDIR for DETECTOR in $DETECTORS[*]
then JCalibrateToT a
Definition: JTuneHV.sh:113
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:97
static const double PI
Mathematical constants.
int get_utm_zone(double lat)
Definition: JAstronomy.hh:114
double longitude_of_central_meridian(int utmzone)
Definition: JAstronomy.hh:123
void JASTRONOMY::correct_to_j2000 ( double &  in_dec,
double &  in_ra,
double &  mjd,
double &  out_dec,
double &  out_ra,
bool  reverse = false 
)
inline

Convert (Dec, RA) to J2000.

Adapted from aanet/astro/Astro.cc

Parameters
mjdModified Julian Date (= # of days since midnight 17th of november 1858 AD)
in_decInput dec
in_raInput RA
out_decOutput dec
out_raOutput RA
reverseif reverse = false, this function converts from ra,dec at a certain time to J2000, if reverse = true, it goes the other way (i.e. if you have a catalog position and want to compute a track, use reverse = true)

Definition at line 191 of file JAstronomy.hh.

192  {
193  // --- get the rotation matrix ----
194  // NOTE: (from seatray Astro): Julian epoch of J2000 time definition
195  // is 2000, corrsponding by definition to 2451545.0 TT (unmodified)
196  // Julian date!
197 
198  double epoch = 2000;
199  double rmatpn[3][3] {};
200  sla_prenut_(epoch, mjd, rmatpn); // SLALIB function to get the matrix of precession and nutation
201 
202  JMATH::JMatrix3D M = JMATH::JMatrix3D(rmatpn[0][0], rmatpn[0][1], rmatpn[0][2], rmatpn[1][0], rmatpn[1][1], rmatpn[1][2], rmatpn[2][0], rmatpn[2][1], rmatpn[2][2]);
203  JMATH::JMatrix3D& M_T = M.transpose(); // transpose 'cause of fortan matrix convention
204  JMATH::JSVD3D V(M_T);
205 
206  double theta = JMATH::PI/2 - in_dec;
207  double phi = in_ra; // get the (theta, phi) from (in_dec, in_ra)
208  double v[3]; // get the vector in the form (x, y, z) from (theta, phi)
209  v[0] = sin (theta) * cos(phi);
210  v[1] = sin (theta) * sin(phi);
211  v[2] = cos (theta);
212  // multiplying the matrix with v and get the transformed vector
213  if (reverse){
214  M_T.transform(v[0],v[1],v[2]);
215  }
216  else{
217  JMATH::JMatrix3D M_T_Inv;
218  M_T_Inv = V.invert();
219  M_T_Inv.transform(v[0],v[1],v[2]);
220  }
221 
222  // get the (phi, theta) from v2
223  double phi_2 = atan2( v[1], v[0] ); double theta_2 = acos(v[2]);
224  // convert (phi,theta) to declination and right ascention
225  out_ra = wrap(phi_2);
226  out_dec = JMATH::PI/2 - theta_2;
227  }
double wrap(double angle)
Definition: JAstronomy.hh:102
3 x 3 matrix
JMatrix3D & transpose()
Transpose.
void sla_prenut_(double &epoch, double &mjd, double rmatpn[3][3])
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
then usage set_variable ACOUSTICS_WORKDIR $WORKDIR set_variable FORMULA sin([0]+2 *$PI *([1]+[2]*x)*x)" set_variable DY 1.0e-8 mkdir $WORKDIR for DETECTOR in $DETECTORS[*]
Singular value decomposition.
Definition: JSVD3D.hh:27
static const double PI
Mathematical constants.
data_type v[N+1][M+1]
Definition: JPolint.hh:866
void transform(double &__x, double &__y, double &__z) const
Transform.
double JASTRONOMY::getRadians ( const double  angle)
inline

Convert angle to radians.

Parameters
angleangle [deg]
Returns
angle [rad]

Definition at line 236 of file JAstronomy.hh.

237  {
238  return JMATH::PI * angle / 180.0;
239  }
static const double PI
Mathematical constants.
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 250 of file JAstronomy.hh.

253  {
254  return JMATH::PI * ((double) angle +
255  (double) amin / 60.0 +
256  (double) asec / 3600.0) / 180.0;
257  }
static const double PI
Mathematical constants.
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 268 of file JAstronomy.hh.

271  {
272  double ha = (JMATH::PI * (double) hour / 12.0 +
273  JMATH::PI * (double) min / 720.0 +
274  JMATH::PI * (double) sec / 43200.0);
275 
276  if (ha > JMATH::PI) {
277  ha -= 2*JMATH::PI;
278  }
279 
280  return ha;
281  }
static const double PI
Mathematical constants.
then fatal Wrong number of arguments fi set_variable ARCHIVE $argv[1] set_variable VERSION $argv[2] set_variable DIR $argv[3] source JAcousticsToolkit sh set_variable DETECTOR $DIR $ACOUSTICS_DETECTOR if[[!-f $DETECTOR]]
double JASTRONOMY::getDot ( const JNeutrinoDirection first,
const JNeutrinoDirection second 
)
inline

Dot product.

Parameters
firstneutrino direction
secondneutrino direction
Returns
dot product

Definition at line 674 of file JAstronomy.hh.

676  {
677  return
678  cos(first.getZenith()) * cos(second.getZenith()) +
679  sin(first.getZenith()) * sin(second.getZenith()) *
680  cos(first.getAzimuth() - second.getAzimuth());
681  }
then usage set_variable ACOUSTICS_WORKDIR $WORKDIR set_variable FORMULA sin([0]+2 *$PI *([1]+[2]*x)*x)" set_variable DY 1.0e-8 mkdir $WORKDIR for DETECTOR in $DETECTORS[*]
const double & getZenith() const
Definition: JAstronomy.hh:412
const double & getAzimuth() const
Definition: JAstronomy.hh:413
double JASTRONOMY::getDot ( const JSourceLocation first,
const JSourceLocation second 
)
inline

Dot product.

Parameters
firstsource location
secondsource location
Returns
dot product

Definition at line 691 of file JAstronomy.hh.

693  {
694  return
695  sin(first.getDeclination()) * sin(second.getDeclination()) +
696  cos(first.getDeclination()) * cos(second.getDeclination()) *
697  cos(first.getRightAscension() - second.getRightAscension());
698  }
then usage set_variable ACOUSTICS_WORKDIR $WORKDIR set_variable FORMULA sin([0]+2 *$PI *([1]+[2]*x)*x)" set_variable DY 1.0e-8 mkdir $WORKDIR for DETECTOR in $DETECTORS[*]
const double & getDeclination() const
Definition: JAstronomy.hh:311
const double & getRightAscension() const
Definition: JAstronomy.hh:312

Variable Documentation

const double JASTRONOMY::MJD_EPOCH = 40587.0
static

Definition at line 90 of file JAstronomy.hh.

const double JASTRONOMY::NUMBER_OF_SECONDS_PER_HOUR = 60.0 * 60.0
static

Definition at line 92 of file JAstronomy.hh.

const double JASTRONOMY::NUMBER_OF_SECONDS_PER_DAY = NUMBER_OF_SECONDS_PER_HOUR * 24.0
static

Definition at line 93 of file JAstronomy.hh.

const double JASTRONOMY::NUMBER_OF_SECONDS_PER_YEAR = NUMBER_OF_SECONDS_PER_DAY * 365.0
static

Definition at line 94 of file JAstronomy.hh.

const double JASTRONOMY::NUMBER_OF_SECONDS_PER_SEDERIAL_DAY = NUMBER_OF_SECONDS_PER_HOUR * 23.9344696
static

Definition at line 95 of file JAstronomy.hh.

const JGeographicalLocation JASTRONOMY::Antares(42, 48, 06, 10)
static
const JGeographicalLocation JASTRONOMY::Sicily(36, 16, 16, 06)
static
const JGeographicalLocation JASTRONOMY::Pylos(36, 33, 16, 06)
static
const JGeographicalLocation JASTRONOMY::ARCA(36, 17, 15, 58)
static
const JGeographicalLocation JASTRONOMY::ORCA(42, 48, 06, 02)
static
const JSourceLocation JASTRONOMY::galacticCenter(-0.5062816,-1.633335)
static
const JSourceLocation JASTRONOMY::RXJ1713(getRadians(-39,-46,0.0), getHourAngle(17, 13, 7))
static
const JSourceLocation JASTRONOMY::VELAX(getRadians(-45,-10,-35.2), getHourAngle(8, 35, 20.66))
static