Jpp  master_rocky-43-ge265d140c
the software that should make you happy
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 485 of file JAstronomy.hh.

Constructor & Destructor Documentation

◆ JAstronomy()

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

Constructor.

Parameters
locationlocation of detector

Definition at line 495 of file JAstronomy.hh.

495  :
496  JGeographicalLocation(location)
497  {}
JGeographicalLocation()
Default constructor.
Definition: JAstronomy.hh:432

Member Function Documentation

◆ getDirectionOfNeutrino()

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 507 of file JAstronomy.hh.

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  }
const double & getLongitude() const
Definition: JAstronomy.hh:469
const double & getLatitude() const
Definition: JAstronomy.hh:468
Direction of incident neutrino.
Definition: JAstronomy.hh:390
const double & getDeclination() const
Definition: JAstronomy.hh:313
const double & getRightAscension() const
Definition: JAstronomy.hh:314
double sla_gmst_(double &ut1)
static const double NUMBER_OF_SECONDS_PER_DAY
Definition: JAstronomy.hh:95
double sla_eqeqx_(double &ut1)
void sla_de2h_(double &hourangle, double &declination, double &observer_latitude, double &azimuth, double &elevation)
static const double PI
Mathematical constants.

◆ getLocationOfSourceFromZenithAzimuth()

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 559 of file JAstronomy.hh.

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  }
Location of astrophysical source.
Definition: JAstronomy.hh:289
double getTheta() const
Get theta angle.
Definition: JAngle3D.hh:86
double getPhi() const
Get phi angle.
Definition: JAngle3D.hh:97
double wrap(double angle)
Definition: JAstronomy.hh:104
void sla_dh2e_(double &azimuth, double &elevation, double &observer_latitude, double &hourangle, double &declination)
double compute_meridian_convergence_angle(double longitude, double latitude)
Definition: JAstronomy.hh:140

◆ getGalacticCoordinatesOfSource()

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 598 of file JAstronomy.hh.

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  }
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
Location of astrophysical source in Galactic coordinates.
Definition: JAstronomy.hh:356
double getDeclinationJ2000(const double t1) const
Get declination in J2000.
Definition: JAstronomy.hh:321
double getRightAscensionJ2000(const double t1) const
Get Right Ascension in J2000.
Definition: JAstronomy.hh:337
void sla_eqgal_(double &rightascension, double &declination, double &galactic_longitude, double &galactic_latitude)

◆ getLocationOfSource()

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 618 of file JAstronomy.hh.

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  }
const double & getAzimuth() const
Definition: JAstronomy.hh:415
const double & getZenith() const
Definition: JAstronomy.hh:414

◆ getLatitude()

const double& JASTRONOMY::JGeographicalLocation::getLatitude ( ) const
inlineinherited

Definition at line 468 of file JAstronomy.hh.

468 { return __latitude; }

◆ getLongitude()

const double& JASTRONOMY::JGeographicalLocation::getLongitude ( ) const
inlineinherited

Definition at line 469 of file JAstronomy.hh.

469 { return __longitude; }

Member Data Documentation

◆ __latitude

double JASTRONOMY::JGeographicalLocation::__latitude
protectedinherited

Definition at line 472 of file JAstronomy.hh.

◆ __longitude

double JASTRONOMY::JGeographicalLocation::__longitude
protectedinherited

Definition at line 473 of file JAstronomy.hh.


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