Jpp  19.1.0
the software that should make you happy
JAstronomy.hh
Go to the documentation of this file.
1 #ifndef __JASTRONOMY__
2 #define __JASTRONOMY__
3 
4 #include <iostream>
5 
6 #include "JMath/JConstants.hh"
7 #include "JMath/JMatrix3D.hh"
8 #include "JMath/JSVD3D.hh"
10 
11 /**
12  * \file
13  *
14  * Interface methods for slalib and auxiliary classes and methods for astronomy.
15  * \author mdejong, fhuang, azegarelli
16  */
17 namespace JASTRONOMY {}
18 namespace JPP { using namespace JASTRONOMY; }
19 
20 namespace JASTRONOMY {
21 
22  extern "C"
23  {
24  // To convert Modified Julian Date to Greenwich Mean Sidereal Time (in rads):
25  double sla_gmst_(double& ut1);
26  double sla_gmsta_(double& ut1, double& part_day);
27 
28  // To calculate the difference between the mean & apparant places of the Equinox (in rads):
29  double sla_eqeqx_(double& ut1);
30 
31  // To convert local equatorial to horizontal coords and vice versa:
32  void sla_de2h_(double& hourangle, double& declination, double& observer_latitude,
33  double& azimuth, double& elevation); // azimuth: [0,2pi], elevation: [-pi/2,pi/2]
34  void sla_dh2e_(double& azimuth, double& elevation, double& observer_latitude,
35  double& hourangle, double& declination); // HA: [-pi,pi], Dec: [-pi/2,pi/2]
36 
37  // To convert equatorial to ecliptic coordinates and vice versa:
38  void sla_eqecl_(double& rightascension, double& declination, double& time,
39  double& ecliptic_longitude, double& ecliptic_latitude);
40  void sla_ecleq_(double& ecliptic_longitude, double& ecliptic_latitude, double& time,
41  double& rightascension, double& declination);
42 
43  // To convert equatorial to galactic coords and vice versa:
44  void sla_eqgal_(double& rightascension, double& declination,
45  double& galactic_longitude, double& galactic_latitude);
46  void sla_galeq_(double& galactic_longitude, double& galactic_latitude,
47  double& rightascension, double& declination);
48 
49  // To convert galactic to supergalactic coords and vice versa:
50  void sla_galsup_(double& galactic_longitude, double& galactic_latitude,
51  double& sgalactic_longitude, double& sgalactic_latitude);
52  void sla_supgal_(double& sgalactic_longitude, double& sgalactic_latitude,
53  double& galactic_longitude, double& galactic_latitude);
54 
55  // To convert Gregorian Calender Date to Modified Julian Date:
56  // (Note: MJD = JD - 2400000.5,
57  // i.e.\ JD = # of days since noon 1st of januari 4713 BC
58  // and MJD = # of days since midnight 17th of november 1858 AD)
59  void sla_caldj_(int& year, int& month, int& day,
60  double& mjd, int& status);
61 
62  // calendar to year, days
63  void sla_clyd_(int& year, int& month, int& day, int& nyears, int& ndays, int&status);
64 
65  // MJD to Gregorian Calendar Date, expressed in single array
66  void sla_djcal_(int& precision, double& mjd, // input : number of decimal places of days in fraction, MJD
67  int result[4], int& status); // output: GCD, status
68 
69  // days to hour, min, sec
70  void sla_dd2tf_(int& ndec, double& day, // input : number of decimal places of seconds, interval in days
71  char sign[1], int result[4]); // output: + or -, hours, minutes, seconds
72 
73  // To obtain the difference in dynamical Terrestial Time and the current time (UT1) in secs, at the current time (UT1):
74  // (Note: instead of the current time (UT1) one can also use current time (UTC) since UTC-UT1 < 0.9 secs
75  double sla_dtt_(double& ut1);
76 
77  // To obtain approx. topocentric apparent (RA & Dec) and angular size of planet/moon/sun from an observer:
78  void sla_rdplan_(double& dtt, int& object, const double& longitude, const double& latitude, // longitude is +/- if east/west of prime meridian
79  double& rightascension, double& declination, double& diam);
80 
81  // To calculate the precession between epochs:
82  void sla_preces_(char *system, double& ep0, double& ep1, double& ra, double& dec, int length);
83 
84  // To calculate the matrix of precession and nutation (IAU 1976, FK)
85  // input: epoch, Julian Epoch for mean coordinates; mjd, modified Julian date (JD -2400000.5) for true coordinates
86  // output: combined precission-nutation matrix
87  void sla_prenut_(double& epoch, double& mjd, double rmatpn[3][3] );
88 
89  }
90 
91 
92  static const double MJD_EPOCH = 40587.0; // MJD of the Unix Epoch, i.e.\ 00:00 Jan 1 1970 (UTC)
93 
94  static const double NUMBER_OF_SECONDS_PER_HOUR = 60.0 * 60.0;
98 
99  /*
100  * Bring angle between 0 and 2 pi
101  * \param angle Input angle [rad]
102  * \return angle [rad]
103  */
104  inline double wrap( double angle )
105  {
106  int n = int(angle / (2 * JMATH::PI)) - (angle < 0);
107  angle -= n * 2 * JMATH::PI;
108  return angle;
109  }
110 
111  /*
112  * Get UTM zone from longitude
113  * \param angle Input longitude [rad]
114  * \return UTM zone
115  */
116  inline int get_utm_zone(double lat)
117  {
118  return 1 + int( ( JMATH::PI + lat ) / ( 6 * JMATH::PI / 180 ) );
119  }
120 
121  /* Compute longitude of the central meridian given the UTM zone
122  * \param utmzone Input UTM zone [int]
123  * \return Longitude of central meridian [rad]
124  */
125  inline double longitude_of_central_meridian(int utmzone)
126  {
127  const double zone_width = 6 * JMATH::PI / 180;
128  return -JMATH::PI + (utmzone -1)*zone_width + zone_width/2;
129  }
130 
131  /*
132  * Compute meridian convergence angle
133  * Angular difference of the UTM Northing direction to the geodetic North. It is positive to the East.
134  * For example, for ANTARES, convergence angle = -1.93 deg E, i.e.UTM North pointing a bit towards the geographical west.
135  * Code from aanet/evt/Det.cc
136  * \param longitude longitude [rad]
137  * \param latitude latitude [rad]
138  * \return meridian convergence angle [rad]
139  */
140  inline double compute_meridian_convergence_angle( double longitude, double latitude )
141  {
142 
143  double latitude_deg = latitude * 180/JMATH::PI;
144 
145  if ( latitude_deg > 84. || latitude_deg < -80.)
146  {
147  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.";
148  return 0;
149  }
150 
151  // detector position, longitude and latitude in rad
152  double lambda = longitude;
153  double phi = latitude;
154 
155  // find UTM zone and central meridian
156  // longitude of the central meridian of UTM zone in rad
158  double omega = lambda-lambda0;
159 
160  // parameters of the Earth ellipsoid
161  double a = 6378137.; // semi-major axis in meters (WGS84)
162  double e2 = 0.0066943800; // eccentricity (WGS84)
163 
164  double rho = a*(1.-e2)/pow(1.-e2*pow(sin(phi),2),3./2.);
165  double nu = a/sqrt(1-e2*pow(sin(phi),2.));
166  double psi = nu/rho;
167  double t = tan(phi);
168 
169  // power series for convergence angle
170  double gamma = sin(phi) * omega
171  - sin(phi) * pow(omega,3.)/3. * pow(cos(phi),2.) * (2.*pow(psi,2.)-psi)
172  - sin(phi) * pow(omega,5.)/15. * pow(cos(phi),4.) * (pow(psi,4.)*(11.-24.*pow(t,2.))-
173  pow(psi,3.)*(11.-36.*pow(t,2.))+
174  2.*pow(psi,2.)*(1.-7.*pow(t,2.))+
175  psi*pow(t,2.)
176  )
177  - sin(phi) * pow(omega,7.)/315. * pow(cos(phi),6.) * (17.-26.*pow(t,2.)+2.*pow(t,4.));
178 
179  return gamma;
180  }
181 
182  /**
183  * Convert (Dec, RA) to J2000. Adapted from aanet/astro/Astro.cc
184  *
185  * \param mjd Modified Julian Date (= # of days since midnight 17th of november 1858 AD)
186  * \param in_dec Input dec
187  * \param in_ra Input RA
188  * \param out_dec Output dec
189  * \param out_ra Output RA
190  * \param reverse if 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)
191  */
192 
193  inline void correct_to_j2000(double& in_dec, double& in_ra, double& mjd, double& out_dec, double& out_ra, bool reverse=false)
194  {
195  // --- get the rotation matrix ----
196  // NOTE: (from seatray Astro): Julian epoch of J2000 time definition
197  // is 2000, corrsponding by definition to 2451545.0 TT (unmodified)
198  // Julian date!
199 
200  double epoch = 2000;
201  double rmatpn[3][3] {};
202  sla_prenut_(epoch, mjd, rmatpn); // SLALIB function to get the matrix of precession and nutation
203 
204  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]);
205  JMATH::JMatrix3D& M_T = M.transpose(); // transpose 'cause of fortan matrix convention
206  JMATH::JSVD3D V(M_T);
207 
208  double theta = JMATH::PI/2 - in_dec;
209  double phi = in_ra; // get the (theta, phi) from (in_dec, in_ra)
210  double v[3]; // get the vector in the form (x, y, z) from (theta, phi)
211  v[0] = sin (theta) * cos(phi);
212  v[1] = sin (theta) * sin(phi);
213  v[2] = cos (theta);
214  // multiplying the matrix with v and get the transformed vector
215  if (reverse){
216  M_T.transform(v[0],v[1],v[2]);
217  }
218  else{
219  JMATH::JMatrix3D M_T_Inv;
220  M_T_Inv = V.invert();
221  M_T_Inv.transform(v[0],v[1],v[2]);
222  }
223 
224  // get the (phi, theta) from v2
225  double phi_2 = atan2( v[1], v[0] ); double theta_2 = acos(v[2]);
226  // convert (phi,theta) to declination and right ascention
227  out_ra = wrap(phi_2);
228  out_dec = JMATH::PI/2 - theta_2;
229  }
230 
231 
232  /**
233  * Convert angle to radians.
234  *
235  * \param angle angle [deg]
236  * \return angle [rad]
237  */
238  inline double getRadians(const double angle)
239  {
240  return JMATH::PI * angle / 180.0;
241  }
242 
243 
244  /**
245  * Convert angle to radians.
246  *
247  * \param angle angle [deg]
248  * \param amin arcminutes
249  * \param asec arcseconds
250  * \return angle [rad]
251  */
252  inline double getRadians(const int angle,
253  const int amin,
254  const double asec)
255  {
256  return JMATH::PI * ((double) angle +
257  (double) amin / 60.0 +
258  (double) asec / 3600.0) / 180.0;
259  }
260 
261 
262  /**
263  * Convert hour angle to radians.
264  *
265  * \param hour hour
266  * \param min minutes
267  * \param sec seconds
268  * \return angle [rad]
269  */
270  inline double getHourAngle(const int hour,
271  const int min,
272  const double sec)
273  {
274  double ha = (JMATH::PI * (double) hour / 12.0 +
275  JMATH::PI * (double) min / 720.0 +
276  JMATH::PI * (double) sec / 43200.0);
277 
278  if (ha > JMATH::PI) {
279  ha -= 2*JMATH::PI;
280  }
281 
282  return ha;
283  }
284 
285 
286  /**
287  * Location of astrophysical source.
288  */
290  public:
291 
292  /**
293  * Default constructor.
294  */
296  __declination (0.0),
297  __right_ascension(0.0)
298  {}
299 
300 
301  /**
302  * Constructor.
303  *
304  * \param declination declination
305  * \param right_ascension right ascension
306  */
308  const double right_ascension) :
310  __right_ascension(right_ascension)
311  {}
312 
313  const double& getDeclination() const { return __declination; }
314  const double& getRightAscension() const { return __right_ascension; }
315 
316  /**
317  * Get declination in J2000.
318  *
319  * \param t1 number of seconds since MJD
320  */
321  double getDeclinationJ2000(const double t1) const
322  {
323  double mjd = t1 / NUMBER_OF_SECONDS_PER_DAY;
324  double dec_j2000; double ra_j2000;
325  double &dec = const_cast<double&> (__declination);
326  double &ra = const_cast<double&> (__right_ascension);
327  correct_to_j2000(dec, ra, mjd, dec_j2000, ra_j2000, false);
328  const double const_dec_j2000 = dec_j2000;
329  return const_dec_j2000;
330  }
331 
332  /**
333  * Get Right Ascension in J2000.
334  *
335  * \param t1 number of seconds since MJD
336  */
337  double getRightAscensionJ2000(const double t1) const
338  {
339  double mjd = t1 / NUMBER_OF_SECONDS_PER_DAY;
340  double dec_j2000; double ra_j2000;
341  double &dec = const_cast<double&> (__declination);
342  double &ra = const_cast<double&> (__right_ascension);
343  correct_to_j2000(dec, ra, mjd, dec_j2000, ra_j2000, false);
344  const double const_ra_j2000 = ra_j2000;
345  return const_ra_j2000;
346  }
347 
348  protected:
351  };
352 
353  /**
354  * Location of astrophysical source in Galactic coordinates.
355  */
357  public:
358 
359  /**
360  * Default constructor.
361  */
363  __gal_latitude (0.0),
364  __gal_longitude(0.0)
365  {}
366 
367  /**
368  * Constructor.
369  *
370  * \param gal_latitude Galactic latitude [rad]
371  * \param gal_longitude Galactic longitude [rad]
372  */
373  JGalacticCoordinates(const double gal_latitude,
374  const double gal_longitude) :
375  __gal_latitude (gal_latitude),
376  __gal_longitude(gal_longitude)
377  {}
378 
379  const double& getGalacticLatitude() const { return __gal_latitude; }
380  const double& getGalacticLongitude() const { return __gal_longitude; }
381 
382  protected:
385  };
386 
387  /**
388  * Direction of incident neutrino.
389  */
391  public:
392 
393  /**
394  * Default constructor.
395  */
397  __zenith (0.0),
398  __azimuth(0.0)
399  {}
400 
401 
402  /**
403  * Constructor.
404  *
405  * \param zenith zenith
406  * \param azimuth azimuth
407  */
408  JNeutrinoDirection(const double& zenith,
409  const double& azimuth) :
410  __zenith (zenith),
411  __azimuth(azimuth)
412  {}
413 
414  const double& getZenith() const { return __zenith; }
415  const double& getAzimuth() const { return __azimuth; }
416 
417  protected:
418  double __zenith;
419  double __azimuth;
420  };
421 
422 
423  /**
424  * Location of detector.
425  */
427  public:
428 
429  /**
430  * Default constructor.
431  */
433  __latitude (0.0),
434  __longitude(0.0)
435  {}
436 
437 
438  /**
439  * Constructor.
440  *
441  * \param latitude latitude
442  * \param longitude longitude
443  */
445  const double longitude) :
448  {}
449 
450 
451  /**
452  * Constructor.
453  *
454  * \param degreesNorth degrees North
455  * \param minutesNorth minutes North
456  * \param degreesEast degrees East
457  * \param minutesEast minutes East
458  */
459  JGeographicalLocation(const int degreesNorth,
460  const int minutesNorth,
461  const int degreesEast,
462  const int minutesEast)
463  {
464  __latitude = (degreesNorth + minutesNorth / 60.0) * JMATH::PI / 180.0;
465  __longitude = (degreesEast + minutesEast / 60.0) * JMATH::PI / 180.0;
466  }
467 
468  const double& getLatitude() const { return __latitude; }
469  const double& getLongitude() const { return __longitude; }
470 
471  protected:
472  double __latitude;
473  double __longitude;
474  };
475 
476 
477 
478  /**
479  * Auxiliary class to make coordinate transformations for a specific geographical location of the detector.
480  *
481  * Note: SLALIB ref. system : (x,y,z) = (N,E,up)
482  * ANTARES ref. system for d10_c00_s00 : (x,y,z) = (N,W,up)
483  * ANTARES ref. system for real det. : (x,y,z) = (E,N,up)
484  */
485  class JAstronomy :
486  public JGeographicalLocation
487  {
488  public:
489 
490  /**
491  * Constructor.
492  *
493  * \param location location of detector
494  */
496  JGeographicalLocation(location)
497  {}
498 
499 
500  /**
501  * Get direction pointing to source.
502  *
503  * \param t1 number of seconds since MJD
504  * \param pos source location
505  * \return direction of neutrino
506  */
508  const JSourceLocation& pos) const
509  {
510  double mjd = t1 / NUMBER_OF_SECONDS_PER_DAY; // [days]
511 
512  double longitude = getLongitude();
513  double latitude = getLatitude();
514 
515  // Convert current mjd (UTC) to local sidereal time,
516  // taking into account the Equation of the Equinoxes:
517  // Note: LST = GMST + local longitude, where l.l. is +/- if east/west of prime meridian
518 
519  double gmst = sla_gmst_ (mjd); // gmst = Greenwich mean sidereal time
520  double eqeqx = sla_eqeqx_(mjd); // Note: Equation of the Equinoxes < 1.15 secs
521  double lst = gmst + longitude + eqeqx;
522 
523  // Transform time-independent equatorial coordinates to time-dependent equatorial coordinates (i.e.\ ra->ha):
524 
525  double dec = pos.getDeclination();
526  double ra = pos.getRightAscension();
527  double ha = lst - ra;
528 
529  // Convert time-dependent equatorial coordinates to local horizontal coordinates:
530  // Note: azimuth: [0,2pi] and elevation: [-pi,pi]
531 
532  double azimuth;
533  double elevation;
534 
535  sla_de2h_(ha, dec, latitude, azimuth, elevation);
536 
537  double theta = -elevation + JMATH::PI/2.0;
538  double phi = -azimuth + JMATH::PI/2.0;
539 
540  // invert direction
541 
542  theta = JMATH::PI - theta;
543  phi = phi + JMATH::PI;
544 
545  if (phi > JMATH::PI)
546  phi -= 2.0*JMATH::PI;
547 
548  return JNeutrinoDirection(theta,phi);
549  }
550 
551  /**
552  * Get location of source given a neutrino direction (zenith,azimuth) and time.
553  *
554  * \param t1 number of seconds since MJD
555  * \param dir direction of neutrino
556  * \return source location
557  */
558 
560  const JGEOMETRY3D::JAngle3D& dir) const
561  {
562  double longitude = getLongitude();
563  double latitude = getLatitude();
564 
565  double zenith = JMATH::PI - dir.getTheta();
566  double azimuth_utm = wrap(dir.getPhi() - JMATH::PI);
567 
568  double meridian_convergence_angle = compute_meridian_convergence_angle(longitude, latitude);
569  double azimuth_geo = azimuth_utm - meridian_convergence_angle;
570 
571  double elevation = -zenith + JMATH::PI/2.0;
572  double azimuth_sla = wrap(JMATH::PI/2.0 - azimuth_geo);
573 
574  double ha;
575  double dec;
576 
577  sla_dh2e_(azimuth_sla, elevation, latitude, ha, dec);
578 
579  double mjd = t1 / NUMBER_OF_SECONDS_PER_DAY; // [days]
580  double gmst = sla_gmst_ (mjd); // gmst = Greenwich mean sidereal time
581  double eqeqx = sla_eqeqx_(mjd); // Note: Equation of the Equinoxes < 1.15 secs
582  double lst = gmst + longitude + eqeqx;
583  double ra = lst - ha;
584 
585  ra = wrap(ra); // Bring RA in [0, 2pi]
586  return JSourceLocation(dec, ra);
587 
588  }
589 
590  /**
591  * Get location of source in galactic coordinates given a neutrino direction and time.
592  *
593  * \param t1 number of seconds since MJD
594  * \param dir direction of neutrino
595  * \return source galactic coordinates
596  */
597 
599  const JGEOMETRY3D::JAngle3D& dir) const
600  {
601  const JSourceLocation& source_location = getLocationOfSourceFromZenithAzimuth(t1, dir);
602  const double dec_j2000 = source_location.getDeclinationJ2000(t1);
603  const double ra_j2000 = source_location.getRightAscensionJ2000(t1);
604  double &dec_j2000_n = const_cast<double&> (dec_j2000);
605  double &ra_j2000_n = const_cast<double&> (ra_j2000);
606  double galactic_longitude; double galactic_latitude;
607  sla_eqgal_(ra_j2000_n, dec_j2000_n, galactic_longitude, galactic_latitude);
608  return JGalacticCoordinates(galactic_latitude, galactic_longitude);
609  }
610 
611  /**
612  * Get location of source.
613  *
614  * \param t1 number of seconds since MJD
615  * \param dir direction of neutrino
616  * \return source location
617  */
619  const JNeutrinoDirection& dir) const
620  {
621  double longitude = getLongitude();
622  double latitude = getLatitude();
623 
624  // invert direction
625 
626  double theta = JMATH::PI - dir.getZenith();
627  double phi = dir.getAzimuth() - JMATH::PI;
628 
629  if (phi < 0.0) {
630  phi += 2.0*JMATH::PI;
631  }
632 
633  double elevation = -theta + JMATH::PI/2.0;
634  double azimuth = -phi + JMATH::PI/2.0;
635 
636  // Convert time-dependent equatorial coordinates to local horizontal coordinates:
637  // Note: azimuth: [0,2pi] and elevation: [-pi,pi]
638 
639  double ha;
640  double dec;
641 
642  sla_dh2e_(azimuth, elevation, latitude, ha, dec);
643 
644  // Get current mjd (UTC):
645 
646  double mjd = t1 / NUMBER_OF_SECONDS_PER_DAY; // [days]
647 
648  // Convert current mjd (UTC) to local sidereal time,
649  // taking into account the Equation of the Equinoxes:
650  // Note: LST = GMST + local longitude, where l.l. is +/- if east/west of prime meridian
651 
652  double gmst = sla_gmst_ (mjd); // gmst = Greenwich mean sidereal time
653  double eqeqx = sla_eqeqx_(mjd); // Note: Equation of the Equinoxes < 1.15 secs
654  double lst = gmst + longitude + eqeqx;
655 
656  // Transform time-independent equatorial coordinates to time-dependent equatorial coordinates (i.e.\ ra->ha):
657 
658  double ra = lst - ha;
659 
660  if (ra > JMATH::PI) {
661  ra -= 2.0*JMATH::PI;
662  }
663 
664  return JSourceLocation(dec, ra);
665  }
666  };
667 
668 
669  /**
670  * Dot product.
671  *
672  * \param first neutrino direction
673  * \param second neutrino direction
674  * \return dot product
675  */
676  inline double getDot(const JNeutrinoDirection& first,
677  const JNeutrinoDirection& second)
678  {
679  return
680  cos(first.getZenith()) * cos(second.getZenith()) +
681  sin(first.getZenith()) * sin(second.getZenith()) *
682  cos(first.getAzimuth() - second.getAzimuth());
683  }
684 
685 
686  /**
687  * Dot product.
688  *
689  * \param first source location
690  * \param second source location
691  * \return dot product
692  */
693  inline double getDot(const JSourceLocation& first,
694  const JSourceLocation& second)
695  {
696  return
697  sin(first.getDeclination()) * sin(second.getDeclination()) +
698  cos(first.getDeclination()) * cos(second.getDeclination()) *
699  cos(first.getRightAscension() - second.getRightAscension());
700  }
701 
702 
703  // detector locations
704 
705  static const JGeographicalLocation Antares(42, 48, 06, 10);
706  static const JGeographicalLocation Sicily (36, 16, 16, 06);
707  static const JGeographicalLocation Pylos (36, 33, 16, 06);
708  static const JGeographicalLocation ARCA (36, 17, 15, 58);
709  static const JGeographicalLocation ORCA (42, 48, 06, 02);
710 
711  // source locations
712 
713  static const JSourceLocation galacticCenter(-0.5062816, -1.633335);
714  static const JSourceLocation RXJ1713 (getRadians(-39, -46, 0.0), getHourAngle(17, 13, 7));
715  static const JSourceLocation VELAX (getRadians(-45, -10, -35.2), getHourAngle( 8, 35, 20.66));
716 }
717 
718 #endif
Mathematical constants.
Auxiliary class to make coordinate transformations for a specific geographical location of the detect...
Definition: JAstronomy.hh:487
JNeutrinoDirection getDirectionOfNeutrino(const double &t1, const JSourceLocation &pos) const
Get direction pointing to source.
Definition: JAstronomy.hh:507
JAstronomy(const JGeographicalLocation &location)
Constructor.
Definition: JAstronomy.hh:495
JSourceLocation getLocationOfSource(const double t1, const JNeutrinoDirection &dir) const
Get location of source.
Definition: JAstronomy.hh:618
JSourceLocation getLocationOfSourceFromZenithAzimuth(const double t1, const JGEOMETRY3D::JAngle3D &dir) const
Get location of source given a neutrino direction (zenith,azimuth) and time.
Definition: JAstronomy.hh:559
JGalacticCoordinates getGalacticCoordinatesOfSource(const double t1, const JGEOMETRY3D::JAngle3D &dir) const
Get location of source in galactic coordinates given a neutrino direction and time.
Definition: JAstronomy.hh:598
Location of astrophysical source in Galactic coordinates.
Definition: JAstronomy.hh:356
JGalacticCoordinates()
Default constructor.
Definition: JAstronomy.hh:362
const double & getGalacticLongitude() const
Definition: JAstronomy.hh:380
JGalacticCoordinates(const double gal_latitude, const double gal_longitude)
Constructor.
Definition: JAstronomy.hh:373
const double & getGalacticLatitude() const
Definition: JAstronomy.hh:379
const double & getLongitude() const
Definition: JAstronomy.hh:469
const double & getLatitude() const
Definition: JAstronomy.hh:468
JGeographicalLocation()
Default constructor.
Definition: JAstronomy.hh:432
JGeographicalLocation(const int degreesNorth, const int minutesNorth, const int degreesEast, const int minutesEast)
Constructor.
Definition: JAstronomy.hh:459
JGeographicalLocation(const double latitude, const double longitude)
Constructor.
Definition: JAstronomy.hh:444
Direction of incident neutrino.
Definition: JAstronomy.hh:390
JNeutrinoDirection()
Default constructor.
Definition: JAstronomy.hh:396
JNeutrinoDirection(const double &zenith, const double &azimuth)
Constructor.
Definition: JAstronomy.hh:408
const double & getAzimuth() const
Definition: JAstronomy.hh:415
const double & getZenith() const
Definition: JAstronomy.hh:414
Location of astrophysical source.
Definition: JAstronomy.hh:289
const double & getDeclination() const
Definition: JAstronomy.hh:313
double getDeclinationJ2000(const double t1) const
Get declination in J2000.
Definition: JAstronomy.hh:321
JSourceLocation()
Default constructor.
Definition: JAstronomy.hh:295
const double & getRightAscension() const
Definition: JAstronomy.hh:314
JSourceLocation(const double declination, const double right_ascension)
Constructor.
Definition: JAstronomy.hh:307
double getRightAscensionJ2000(const double t1) const
Get Right Ascension in J2000.
Definition: JAstronomy.hh:337
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:35
double getTheta() const
Get theta angle.
Definition: JAngle3D.hh:86
double getPhi() const
Get phi angle.
Definition: JAngle3D.hh:97
JMatrix3D & transpose()
Transpose.
void transform(double &__x, double &__y, double &__z) const
Transform.
Singular value decomposition.
Definition: JSVD3D.hh:27
const JMatrix3D & invert(const double precision=1.0e-12) const
Get inverted matrix.
Definition: JSVD3D.hh:192
const double a
Definition: JQuadrature.cc:42
static const JGeographicalLocation Sicily(36, 16, 16, 06)
static const JSourceLocation VELAX(getRadians(-45, -10, -35.2), getHourAngle(8, 35, 20.66))
double getHourAngle(const int hour, const int min, const double sec)
Convert hour angle to radians.
Definition: JAstronomy.hh:270
double getDot(const JSourceLocation &first, const JSourceLocation &second)
Dot product.
Definition: JAstronomy.hh:693
void sla_clyd_(int &year, int &month, int &day, int &nyears, int &ndays, int &status)
double wrap(double angle)
Definition: JAstronomy.hh:104
double longitude_of_central_meridian(int utmzone)
Definition: JAstronomy.hh:125
static const double NUMBER_OF_SECONDS_PER_YEAR
Definition: JAstronomy.hh:96
void sla_dh2e_(double &azimuth, double &elevation, double &observer_latitude, double &hourangle, double &declination)
void sla_ecleq_(double &ecliptic_longitude, double &ecliptic_latitude, double &time, double &rightascension, double &declination)
void sla_djcal_(int &precision, double &mjd, int result[4], int &status)
static const JSourceLocation RXJ1713(getRadians(-39, -46, 0.0), getHourAngle(17, 13, 7))
double sla_gmst_(double &ut1)
void sla_galeq_(double &galactic_longitude, double &galactic_latitude, double &rightascension, double &declination)
void sla_prenut_(double &epoch, double &mjd, double rmatpn[3][3])
void sla_dd2tf_(int &ndec, double &day, char sign[1], int result[4])
double compute_meridian_convergence_angle(double longitude, double latitude)
Definition: JAstronomy.hh:140
void sla_eqgal_(double &rightascension, double &declination, double &galactic_longitude, double &galactic_latitude)
void sla_galsup_(double &galactic_longitude, double &galactic_latitude, double &sgalactic_longitude, double &sgalactic_latitude)
static const double NUMBER_OF_SECONDS_PER_DAY
Definition: JAstronomy.hh:95
double sla_gmsta_(double &ut1, double &part_day)
void sla_eqecl_(double &rightascension, double &declination, double &time, double &ecliptic_longitude, double &ecliptic_latitude)
static const JGeographicalLocation ORCA(42, 48, 06, 02)
static const double NUMBER_OF_SECONDS_PER_SEDERIAL_DAY
Definition: JAstronomy.hh:97
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.
Definition: JAstronomy.hh:193
double getRadians(const int angle, const int amin, const double asec)
Convert angle to radians.
Definition: JAstronomy.hh:252
double sla_eqeqx_(double &ut1)
void sla_preces_(char *system, double &ep0, double &ep1, double &ra, double &dec, int length)
static const JGeographicalLocation ARCA(36, 17, 15, 58)
static const double NUMBER_OF_SECONDS_PER_HOUR
Definition: JAstronomy.hh:94
void sla_supgal_(double &sgalactic_longitude, double &sgalactic_latitude, double &galactic_longitude, double &galactic_latitude)
int get_utm_zone(double lat)
Definition: JAstronomy.hh:116
static const double MJD_EPOCH
Definition: JAstronomy.hh:92
static const JGeographicalLocation Pylos(36, 33, 16, 06)
void sla_rdplan_(double &dtt, int &object, const double &longitude, const double &latitude, double &rightascension, double &declination, double &diam)
void sla_de2h_(double &hourangle, double &declination, double &observer_latitude, double &azimuth, double &elevation)
double sla_dtt_(double &ut1)
static const JGeographicalLocation Antares(42, 48, 06, 10)
static const JSourceLocation galacticCenter(-0.5062816, -1.633335)
void sla_caldj_(int &year, int &month, int &day, double &mjd, int &status)
int sign(const T &value)
Get sign of value.
Definition: JLib.hh:20
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:97
static const double PI
Mathematical constants.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
const int n
Definition: JPolint.hh:786
data_type v[N+1][M+1]
Definition: JPolint.hh:866
const char *const hourangle
Definition: io_ascii.hh:57