Jpp 19.3.0
the software that should make you happy
Loading...
Searching...
No Matches
JASTRONOMY::J2000 Struct Reference

Conversion of source location. More...

#include <JAstronomy.hh>

Public Types

enum  CONVERSION { FROM = -1 , TO = +1 }
 Conversion options. More...
 

Static Public Member Functions

static angle_type_rad convert (const double t1_s, const angle_type_rad &location, const J2000::CONVERSION option)
 Convert source location according J2000 at given time.
 

Detailed Description

Conversion of source location.

Definition at line 375 of file JAstronomy.hh.

Member Enumeration Documentation

◆ CONVERSION

Conversion options.

Enumerator
FROM 
TO 

Definition at line 379 of file JAstronomy.hh.

379 {
380 FROM = -1,
381 TO = +1
382 };

Member Function Documentation

◆ convert()

static angle_type_rad JASTRONOMY::J2000::convert ( const double t1_s,
const angle_type_rad & location,
const J2000::CONVERSION option )
inlinestatic

Convert source location according J2000 at given time.

Adapted from aanet/astro/Astro.cc

Parameters
t1_stime since MJD [s]
locationsource location
optionoption
Returns
source location

Definition at line 394 of file JAstronomy.hh.

395 {
396 using namespace JPP;
397
398 // --- get the rotation matrix ----
399 // NOTE: (from seatray Astro): Julian epoch of J2000 time definition is 2000,
400 // corresponding by definition to 2451545.0 TT (unmodified) Julian date!
401
402 double mjd = t1_s / NUMBER_OF_SECONDS_PER_DAY; // [days]
403 double epoch = 2000;
404 double R[3][3] {};
405
406 slaPrenut(epoch, mjd, R); // SLALIB function to get the matrix of precession and nutation
407
408 JMatrix3D M = JMatrix3D(R[0][0], R[0][1], R[0][2],
409 R[1][0], R[1][1], R[1][2],
410 R[2][0], R[2][1], R[2][2]);
411
412 M.transpose(); // transpose 'cause of fortan matrix convention
413
414 if (option == J2000::TO) {
415
416 JSVD3D V(M);
417
418 M = V.invert();
419 }
420
421 // convert (declination, right ascension) to polar coordinates (theta, phi)
422
423 JDirection3D v(JAngle3D(PI/2 - location._theta_, location._phi_));
424
425 // apply transformation
426
427 v.transform(M);
428
429 // convert polar coordinates (theta, phi) to (declination, right ascension)
430
431 return angle_type_rad(PI/2 - v.getTheta(), v.getPhi());
432 }
Data structure for angles in three dimensions.
Definition JAngle3D.hh:35
Data structure for direction in three dimensions.
JMatrix3D & transpose()
Transpose.
Singular value decomposition.
Definition JSVD3D.hh:27
static const double NUMBER_OF_SECONDS_PER_DAY
Definition JAstronomy.hh:44
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for pair of angles.

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