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