Jpp  17.3.0-rc.2
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 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 277 of file JAstronomy.hh.

Constructor & Destructor Documentation

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

Constructor.

Parameters
locationlocation of detector

Definition at line 287 of file JAstronomy.hh.

287  :
288  JGeographicalLocation(location)
289  {}
JGeographicalLocation()
Default constructor.
Definition: JAstronomy.hh:224

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

301  {
302  double mjd = t1 / NUMBER_OF_SECONDS_PER_DAY; // [days]
303 
304  double longitude = getLongitude();
305  double latitude = getLatitude();
306 
307  // Convert current mjd (UTC) to local sidereal time,
308  // taking into account the Equation of the Equinoxes:
309  // Note: LST = GMST + local longitude, where l.l. is +/- if east/west of prime meridian
310 
311  double gmst = sla_gmst_ (mjd); // gmst = Greenwich mean sidereal time
312  double eqeqx = sla_eqeqx_(mjd); // Note: Equation of the Equinoxes < 1.15 secs
313  double lst = gmst + longitude + eqeqx;
314 
315  // Transform time-independent equatorial coordinates to time-dependent equatorial coordinates (i.e.\ ra->ha):
316 
317  double dec = pos.getDeclination();
318  double ra = pos.getRightAscension();
319  double ha = lst - ra;
320 
321  // Convert time-dependent equatorial coordinates to local horizontal coordinates:
322  // Note: azimuth: [0,2pi] and elevation: [-pi,pi]
323 
324  double azimuth;
325  double elevation;
326 
327  sla_de2h_(ha, dec, latitude, azimuth, elevation);
328 
329  double theta = -elevation + JMATH::PI/2.0;
330  double phi = -azimuth + JMATH::PI/2.0;
331 
332  // invert direction
333 
334  theta = JMATH::PI - theta;
335  phi = phi + JMATH::PI;
336 
337  if (phi > JMATH::PI)
338  phi -= 2.0*JMATH::PI;
339 
340  return JNeutrinoDirection(theta,phi);
341  }
Direction of incident neutrino.
Definition: JAstronomy.hh:182
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:260
const double & getDeclination() const
Definition: JAstronomy.hh:170
double sla_gmst_(double &ut1)
static const double NUMBER_OF_SECONDS_PER_DAY
Definition: JAstronomy.hh:84
static const double PI
Mathematical constants.
const double & getLongitude() const
Definition: JAstronomy.hh:261
const double & getRightAscension() const
Definition: JAstronomy.hh:171
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 351 of file JAstronomy.hh.

353  {
354  double longitude = getLongitude();
355  double latitude = getLatitude();
356 
357  // invert direction
358 
359  double theta = JMATH::PI - dir.getZenith();
360  double phi = dir.getAzimuth() - JMATH::PI;
361 
362  if (phi < 0.0) {
363  phi += 2.0*JMATH::PI;
364  }
365 
366  double elevation = -theta + JMATH::PI/2.0;
367  double azimuth = -phi + JMATH::PI/2.0;
368 
369  // Convert time-dependent equatorial coordinates to local horizontal coordinates:
370  // Note: azimuth: [0,2pi] and elevation: [-pi,pi]
371 
372  double ha;
373  double dec;
374 
375  sla_dh2e_(azimuth, elevation, latitude, ha, dec);
376 
377  // Get current mjd (UTC):
378 
379  double mjd = t1 / NUMBER_OF_SECONDS_PER_DAY; // [days]
380 
381  // Convert current mjd (UTC) to local sidereal time,
382  // taking into account the Equation of the Equinoxes:
383  // Note: LST = GMST + local longitude, where l.l. is +/- if east/west of prime meridian
384 
385  double gmst = sla_gmst_ (mjd); // gmst = Greenwich mean sidereal time
386  double eqeqx = sla_eqeqx_(mjd); // Note: Equation of the Equinoxes < 1.15 secs
387  double lst = gmst + longitude + eqeqx;
388 
389  // Transform time-independent equatorial coordinates to time-dependent equatorial coordinates (i.e.\ ra->ha):
390 
391  double ra = lst - ha;
392 
393  if (ra > JMATH::PI) {
394  ra -= 2.0*JMATH::PI;
395  }
396 
397  return JSourceLocation(dec, ra);
398  }
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:146
const double & getZenith() const
Definition: JAstronomy.hh:206
const double & getLatitude() const
Definition: JAstronomy.hh:260
double sla_gmst_(double &ut1)
static const double NUMBER_OF_SECONDS_PER_DAY
Definition: JAstronomy.hh:84
const double & getAzimuth() const
Definition: JAstronomy.hh:207
static const double PI
Mathematical constants.
const double & getLongitude() const
Definition: JAstronomy.hh:261
const double& JASTRONOMY::JGeographicalLocation::getLatitude ( ) const
inlineinherited

Definition at line 260 of file JAstronomy.hh.

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

Definition at line 261 of file JAstronomy.hh.

261 { return __longitude; }

Member Data Documentation

double JASTRONOMY::JGeographicalLocation::__latitude
protectedinherited

Definition at line 264 of file JAstronomy.hh.

double JASTRONOMY::JGeographicalLocation::__longitude
protectedinherited

Definition at line 265 of file JAstronomy.hh.


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