Jpp  18.6.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
JASTRONOMY::JAstronomy Class Reference

Auxiliary class to make coordinate transformations for a specific geographical location of the detector. More...

#include <JAstronomy.hh>

Inheritance diagram for JASTRONOMY::JAstronomy:
JASTRONOMY::JGeographicalLocation

Public Member Functions

 JAstronomy (const JGeographicalLocation &location)
 Constructor. More...
 
JNeutrinoDirection getDirectionOfNeutrino (const double &t1, const JSourceLocation &pos) const
 Get direction pointing to source. More...
 
JSourceLocation getLocationOfSourceFromZenithAzimuth (const double t1, const JGEOMETRY3D::JAngle3D &dir) const
 Get location of source given a neutrino direction (zenith,azimuth) and time. More...
 
JGalacticCoordinates getGalacticCoordinatesOfSource (const double t1, const JGEOMETRY3D::JAngle3D &dir) const
 Get location of source in galactic coordinates given a neutrino direction and time. More...
 
JSourceLocation getLocationOfSource (const double t1, const JNeutrinoDirection &dir) const
 Get location of source. More...
 
const double & getLatitude () const
 
const double & getLongitude () const
 

Protected Attributes

double __latitude
 
double __longitude
 

Detailed Description

Auxiliary class to make coordinate transformations for a specific geographical location of the detector.

Note: SLALIB ref. system : (x,y,z) = (N,E,up) ANTARES ref. system for d10_c00_s00 : (x,y,z) = (N,W,up) ANTARES ref. system for real det. : (x,y,z) = (E,N,up)

Definition at line 483 of file JAstronomy.hh.

Constructor & Destructor Documentation

JASTRONOMY::JAstronomy::JAstronomy ( const JGeographicalLocation location)
inline

Constructor.

Parameters
locationlocation of detector

Definition at line 493 of file JAstronomy.hh.

493  :
494  JGeographicalLocation(location)
495  {}
JGeographicalLocation()
Default constructor.
Definition: JAstronomy.hh:430

Member Function Documentation

JNeutrinoDirection JASTRONOMY::JAstronomy::getDirectionOfNeutrino ( const double &  t1,
const JSourceLocation pos 
) const
inline

Get direction pointing to source.

Parameters
t1number of seconds since MJD
possource location
Returns
direction of neutrino

Definition at line 505 of file JAstronomy.hh.

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  }
Direction of incident neutrino.
Definition: JAstronomy.hh:388
double sla_eqeqx_(double &ut1)
void sla_de2h_(double &hourangle, double &declination, double &observer_latitude, double &azimuth, double &elevation)
const double & getLatitude() const
Definition: JAstronomy.hh:466
const double & getDeclination() const
Definition: JAstronomy.hh:311
double sla_gmst_(double &ut1)
static const double NUMBER_OF_SECONDS_PER_DAY
Definition: JAstronomy.hh:93
static const double PI
Mathematical constants.
const double & getLongitude() const
Definition: JAstronomy.hh:467
const double & getRightAscension() const
Definition: JAstronomy.hh:312
JSourceLocation JASTRONOMY::JAstronomy::getLocationOfSourceFromZenithAzimuth ( const double  t1,
const JGEOMETRY3D::JAngle3D dir 
) const
inline

Get location of source given a neutrino direction (zenith,azimuth) and time.

Parameters
t1number of seconds since MJD
dirdirection of neutrino
Returns
source location

Definition at line 557 of file JAstronomy.hh.

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  }
double sla_eqeqx_(double &ut1)
double getPhi() const
Get phi angle.
Definition: JAngle3D.hh:97
void sla_dh2e_(double &azimuth, double &elevation, double &observer_latitude, double &hourangle, double &declination)
double wrap(double angle)
Definition: JAstronomy.hh:102
double compute_meridian_convergence_angle(double longitude, double latitude)
Definition: JAstronomy.hh:138
double getTheta() const
Get theta angle.
Definition: JAngle3D.hh:86
Location of astrophysical source.
Definition: JAstronomy.hh:287
const double & getLatitude() const
Definition: JAstronomy.hh:466
double sla_gmst_(double &ut1)
static const double NUMBER_OF_SECONDS_PER_DAY
Definition: JAstronomy.hh:93
static const double PI
Mathematical constants.
const double & getLongitude() const
Definition: JAstronomy.hh:467
JGalacticCoordinates JASTRONOMY::JAstronomy::getGalacticCoordinatesOfSource ( const double  t1,
const JGEOMETRY3D::JAngle3D dir 
) const
inline

Get location of source in galactic coordinates given a neutrino direction and time.

Parameters
t1number of seconds since MJD
dirdirection of neutrino
Returns
source galactic coordinates

Definition at line 596 of file JAstronomy.hh.

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  }
double getRightAscensionJ2000(const double t1) const
Get Right Ascension in J2000.
Definition: JAstronomy.hh:335
Location of astrophysical source.
Definition: JAstronomy.hh:287
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
void sla_eqgal_(double &rightascension, double &declination, double &galactic_longitude, double &galactic_latitude)
double getDeclinationJ2000(const double t1) const
Get declination in J2000.
Definition: JAstronomy.hh:319
Location of astrophysical source in Galactic coordinates.
Definition: JAstronomy.hh:354
JSourceLocation JASTRONOMY::JAstronomy::getLocationOfSource ( const double  t1,
const JNeutrinoDirection dir 
) const
inline

Get location of source.

Parameters
t1number of seconds since MJD
dirdirection of neutrino
Returns
source location

Definition at line 616 of file JAstronomy.hh.

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  }
double sla_eqeqx_(double &ut1)
void sla_dh2e_(double &azimuth, double &elevation, double &observer_latitude, double &hourangle, double &declination)
Location of astrophysical source.
Definition: JAstronomy.hh:287
const double & getZenith() const
Definition: JAstronomy.hh:412
const double & getLatitude() const
Definition: JAstronomy.hh:466
double sla_gmst_(double &ut1)
static const double NUMBER_OF_SECONDS_PER_DAY
Definition: JAstronomy.hh:93
const double & getAzimuth() const
Definition: JAstronomy.hh:413
static const double PI
Mathematical constants.
const double & getLongitude() const
Definition: JAstronomy.hh:467
const double& JASTRONOMY::JGeographicalLocation::getLatitude ( ) const
inlineinherited

Definition at line 466 of file JAstronomy.hh.

466 { return __latitude; }
const double& JASTRONOMY::JGeographicalLocation::getLongitude ( ) const
inlineinherited

Definition at line 467 of file JAstronomy.hh.

467 { return __longitude; }

Member Data Documentation

double JASTRONOMY::JGeographicalLocation::__latitude
protectedinherited

Definition at line 470 of file JAstronomy.hh.

double JASTRONOMY::JGeographicalLocation::__longitude
protectedinherited

Definition at line 471 of file JAstronomy.hh.


The documentation for this class was generated from the following file: