OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | List of all members
ossimplugins::GalileanEphemeris Class Reference

This class represents an ephemeris in Galilean coordinates system. More...

#include <GalileanEphemeris.h>

Inheritance diagram for ossimplugins::GalileanEphemeris:
ossimplugins::Ephemeris

Public Member Functions

 GalileanEphemeris ()
 Constructor. More...
 
 ~GalileanEphemeris ()
 Destructor. More...
 
 GalileanEphemeris (JSDDateTime date, double pos[3], double speed[3])
 Constructor with initialisations. More...
 
 GalileanEphemeris (const GalileanEphemeris &rhs)
 Copy constructor. More...
 
 GalileanEphemeris (GeographicEphemeris &rhs)
 
GalileanEphemerisoperator= (const GalileanEphemeris &rhs)
 Affectation operator. More...
 
void ToGeographic (GeographicEphemeris *vGeo)
 This fonction converts the current ephemeris in the Geographic coordinates syst�m. More...
 
void ToGeographic (double greenwich, GeographicEphemeris *vGeo)
 
 operator GeographicEphemeris ()
 
virtual EphemerisClone ()
 This function creates a copy of the current class. More...
 
- Public Member Functions inherited from ossimplugins::Ephemeris
 Ephemeris ()
 Constructor. More...
 
virtual ~Ephemeris ()
 Destructor. More...
 
 Ephemeris (JSDDateTime date, double pos[3], double speed[3])
 Constructor with initialisations. More...
 
 Ephemeris (const Ephemeris &rhs)
 Copy constructor. More...
 
Ephemerisoperator= (const Ephemeris &rhs)
 Affectation operator. More...
 
JSDDateTime get_date () const
 
double * get_position ()
 
const double * get_position () const
 
double * get_speed ()
 
const double * get_speed () const
 
void set_date (JSDDateTime date)
 
void set_position (double position[3])
 
void set_speed (double speed[3])
 
bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save object state to a keyword list. More...
 
bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of the object from a keyword list. More...
 

Protected Member Functions

int p2nutt (int newcmb, double greenwich, double day, double p[], double pd[])
 

Additional Inherited Members

- Protected Attributes inherited from ossimplugins::Ephemeris
JSDDateTime _date
 
double _position [3]
 
double _speed [3]
 

Detailed Description

This class represents an ephemeris in Galilean coordinates system.

Definition at line 27 of file GalileanEphemeris.h.

Constructor & Destructor Documentation

◆ GalileanEphemeris() [1/4]

ossimplugins::GalileanEphemeris::GalileanEphemeris ( )

Constructor.

Definition at line 23 of file GalileanEphemeris.cpp.

24  {
25 
26  }

◆ ~GalileanEphemeris()

ossimplugins::GalileanEphemeris::~GalileanEphemeris ( )

Destructor.

Definition at line 28 of file GalileanEphemeris.cpp.

29  {
30 
31  }

◆ GalileanEphemeris() [2/4]

ossimplugins::GalileanEphemeris::GalileanEphemeris ( JSDDateTime  date,
double  pos[3],
double  speed[3] 
)

Constructor with initialisations.

Definition at line 33 of file GalileanEphemeris.cpp.

33  : Ephemeris(date, pos, speed)
34  {
35 
36  }
Ephemeris()
Constructor.
Definition: Ephemeris.cpp:29

◆ GalileanEphemeris() [3/4]

ossimplugins::GalileanEphemeris::GalileanEphemeris ( const GalileanEphemeris rhs)

Copy constructor.

Definition at line 38 of file GalileanEphemeris.cpp.

38  : Ephemeris(rhs)
39  {
40 
41  }
Ephemeris()
Constructor.
Definition: Ephemeris.cpp:29

◆ GalileanEphemeris() [4/4]

ossimplugins::GalileanEphemeris::GalileanEphemeris ( GeographicEphemeris rhs)

Definition at line 118 of file GalileanEphemeris.cpp.

References ossimplugins::GeographicEphemeris::ToGalilean().

119  {
120  rhs.ToGalilean(this);
121  }

Member Function Documentation

◆ Clone()

virtual Ephemeris* ossimplugins::GalileanEphemeris::Clone ( )
inlinevirtual

This function creates a copy of the current class.

Reimplemented from ossimplugins::Ephemeris.

Definition at line 67 of file GalileanEphemeris.h.

68  {
69  return new GalileanEphemeris(*this);
70  };

◆ operator GeographicEphemeris()

ossimplugins::GalileanEphemeris::operator GeographicEphemeris ( )

Definition at line 111 of file GalileanEphemeris.cpp.

112  {
113  GeographicEphemeris rhs;
114  ToGeographic(&rhs);
115  return rhs;
116  }
void ToGeographic(GeographicEphemeris *vGeo)
This fonction converts the current ephemeris in the Geographic coordinates syst�m.

◆ operator=()

GalileanEphemeris & ossimplugins::GalileanEphemeris::operator= ( const GalileanEphemeris rhs)

Affectation operator.

Definition at line 43 of file GalileanEphemeris.cpp.

References ossimplugins::Ephemeris::Ephemeris().

44  {
45  ((Ephemeris)*this) = ((Ephemeris)rhs);
46  return *this;
47  }
Ephemeris()
Constructor.
Definition: Ephemeris.cpp:29

◆ p2nutt()

int ossimplugins::GalileanEphemeris::p2nutt ( int  newcmb,
double  greenwich,
double  day,
double  p[],
double  pd[] 
)
protected

Definition at line 123 of file GalileanEphemeris.cpp.

References PI, and TWOPI.

Referenced by ToGeographic().

125  {
126  const double PI = 3.14159265358979323846 ;
127  const double TWOPI = 6.28318530717958647693 ;
128  // const double MU = 3.9860047e+14 ;
129  // const double JOURCIVIL_LENGTH = 86400.0 ;
130  // const double JOURSIDERAL = 86164.09054 ;
131  // const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ;
132  // const double CLUM = 2.99792458e+8 ;
133  // const double A_WGS84 = 6378137.0 ;
134  // const double B_WGS84 = 6356752.3141 ;
135 /*
136 
137  GIVES TRANSFORMATION MATRIX P(3,3) FROM QUASI-INERTIAL MEAN SYSTEM
138  OF DATE TO TRUE SYSTEM OF DATE OR EARTH-FIXED ROTATING SYSTEM BY
139  ROTATION (OPTIONAL) AND NUTATION. USES SIMPLIFIED ANALYTICAL
140  MODEL DERIVED FROM THE 1980 IAU WAHR THEORY OF NUTATION (REF:
141  ASTRONOMICAL ALMANAC 1984, PP. S23-S26) BY SKIPPING MOST TERMS BELOW
142  0.03 ARCSEC. ACCURACY = 0.5D-6 RADIANS.
143 
144  DAY = Julian Day
145  newcmb =-1 => TO TRUE SYSTEM OF DATE
146  = 0 => INTERMEDIATE TRANSFORMATION TO EARTH-FIXED ROTATING
147  SYSTEM BUT WITHOUT NEWCOMB'S ANGLE. (NOT TRUE-OF-DATE)
148  = 1 => TO EARTH-FIXED ROTATING SYSTEM
149 
150  P(3,3) = ROTATION MATRIX SUCH THAT
151  THE TRANSFORMATION IS R(TRANSF) = P * R(INERT)
152 
153  COMMON BLOCKS FROM PEPSOC SUBROUTINE 'P2COOT' ARE USED. */
154 
155  double arg[10] ;
156  double t, ff, dd, dpsi, deps;
157  double ecl, cecl, secl, dnu, srang;
158  double sra, cra, snu, cnu, sde, cde;
159  double facsin[10],faccos[10];
160 
161  int i;
162 
163  /* DATA FOR NUTATION MODELLING */
164  facsin[0]=0.e0;
165  facsin[1]=-0.8338601e-04;
166  facsin[2]=-0.6393238e-05;
167  facsin[3]=-0.1102466e-05;
168  facsin[4]=0.9996858e-06;
169  facsin[5]=0.6913443e-06;
170  facsin[6]=0.3451873e-06;
171  facsin[7]=-0.2506487e-06;
172  facsin[8]=-0.1871381e-06;
173  facsin[9]=-0.1459289e-06;
174 
175  faccos[0]=0.e0;
176  faccos[1]=0.4461498e-04;
177  faccos[2]=0.2780891e-05;
178  faccos[3]=0.4736630e-06;
179  faccos[4]=-0.4339082e-06;
180  faccos[5]=0.2617994e-07;
181  faccos[6]=-0.3393696e-08;
182  faccos[7]=0.1085983e-06;
183  faccos[8]=0.9696274e-07;
184  faccos[9]=0.6254096e-07;
185 
186 
187  /* ECL = OBLIQUITY OF ECLIPTIC AT EPOCH J2000.0
188  ECL CHANGES BY -0.01300 DEG/CENTURY.
189  ECL = 23 DEG + 26 ' + 21.4119 " */
190  ecl = PI/180.e0*(23.e0 + (26.e0 + 21.4119e0/6.e1)/6.e1);
191  cecl = cos(ecl);
192  secl = sin(ecl);
193 
194  /*t= Julian day relative to year 2000 at 12:00:00 */
195  t = day-2451540. - 0.5 ;
196 
197  /* L = MEAN ANOMALY OF THE MOON */
198  arg[6] = fmod( 0.2355548394e+01 + t*( 0.2280271437e+00 + t* 0.1137830e-12 ),TWOPI);
199 
200  /*C L-PRIME = MEAN ANOMALY OF THE SUN (EARTH) */
201  arg[5] = fmod( 0.6240035939e+01 + t*( 0.1720197005e-01 - t* 0.2096864e-14 ),TWOPI);
202 
203  /* F = L - OMEGA (SEE ABOVE AND BELOW) */
204  ff = fmod( 0.1627901934e+01 + t*( 0.2308957196e+00 - t* 0.4817699e-13 ),TWOPI);
205 
206  /* D = MEAN ELONGATION OF THE MOON FROM THE SUN */
207  dd = fmod( 0.5198469514e+01 + t*( 0.2127687104e+00 - t* 0.2504244e-13 ),TWOPI);
208 
209  /* OMEGA = LONGITUDE OF MOON'S ASCENDING NODE FROM MEAN EQUINOX OF DATE */
210  arg[0]=0.e0;
211  arg[1] = fmod( 0.2182438624e+01 - t*( 0.9242175478e-03 - t* 0.2709206e-13 ),TWOPI);
212 
213  arg[3] = 2.e0*(ff + arg[1]);
214  arg[2] = arg[3] - 2.e0*dd ;
215  arg[4] = 2.e0*arg[1] ;
216  arg[7] = arg[5] + arg[2] ;
217  arg[8] = 2.e0*ff + arg[1] ;
218  arg[9] = arg[6] + arg[3] ;
219 
220  dpsi = 0.e0;
221  deps = 0.e0;
222  for ( i=1 ; i<=9; i++ )
223  {
224  dpsi = dpsi + facsin[i] * sin(arg[i]);
225  deps = deps + faccos[i] * cos(arg[i]);
226  }
227 
228 
229  /* ROTATION OF -deps AROUND THE X-AXIS */
230  cde=cos(deps);
231  sde=sin(deps);
232 
233  /* ROTATION OF DNU = dpsi*SIN(ECLIPT) AROUND THE Y-AXIS */
234  dnu = dpsi*secl;
235  cnu=cos(dnu);
236  snu=sin(dnu);
237 
238  /* SELECT WHICH ROTATION IS WANTED FOR THE Z-AXIS */
239  srang=0.e0;
240  if (newcmb == -1)
241  {
242  /* ROTATION OF SRANG = -DMU = -dpsi*COS(ECLIPT) AROUND THE Z-AXIS */
243  srang = -dpsi*cecl;
244  }
245  else if ( newcmb == 0)
246  {
247  srang = 0.e0;
248  }
249  else if ( newcmb == 1 )
250  {
251  /* SIDEREAL ANGLE, FROM 'COOT20' WITH NEWCOMB'S FORMULA:*/
252  /*srang = fmod(STD20R+(OMT20R+OMQ20R*day)*day,TWOPI);*/
253  }
254  else if ( newcmb == 2 )
255  {
256  /* SIDEREAL ANGLE, FROM INPUT */
257  srang = fmod(greenwich*PI/180.e0,TWOPI) ;
258  /*printf("srang dans p2nutt %g",greenwich);*/
259  }
260  else
261  {
262  return -1;;
263  }
264 
265 
266  sra=sin(srang);
267  cra=cos(srang);
268 
269  /* ROTATION MATRIX = RZ(SRANG)*RX(-deps)*RY(DNU) */
270  p[0] = 0.e0;
271  p[1] = cra*cnu - sra*sde*snu ;
272  p[2] = -sra*cnu - cra*sde*snu ;
273  p[3] = cde*snu ;
274  p[4] = sra*cde ;
275  p[5] = cra*cde ;
276  p[6] = sde ;
277  p[7] = -cra*snu - sra*sde*cnu ;
278  p[8] = sra*snu - cra*sde*cnu ;
279  p[9] = cde*cnu ;
280 
281  pd[0] = 0.e0;
282  pd[1] = -sra*cnu - cra*sde*snu ;
283  pd[2] = -cra*cnu + sra*sde*snu ;
284  pd[3] = 0. ;
285  pd[4] = cra*cde ;
286  pd[5] = -sra*cde ;
287  pd[6] = 0. ;
288  pd[7] = sra*snu - cra*sde*cnu ;
289  pd[8] = cra*snu + sra*sde*cnu ;
290  pd[9] = 0. ;
291 
292  return 1;
293 
294  }
#define PI
Definition: ossimGeoref.cpp:88

◆ ToGeographic() [1/2]

void ossimplugins::GalileanEphemeris::ToGeographic ( GeographicEphemeris vGeo)

This fonction converts the current ephemeris in the Geographic coordinates syst�m.

Definition at line 49 of file GalileanEphemeris.cpp.

References ossimplugins::Ephemeris::_date, ossimplugins::Ephemeris::_position, ossimplugins::Ephemeris::_speed, ossimplugins::GMSTDateTime::AN1950, ossimplugins::JSDDateTime::AsGMSTDateTime(), ossimplugins::GMSTDateTime::get_tms(), ossimplugins::Ephemeris::set_date(), ossimplugins::GMSTDateTime::set_origine(), ossimplugins::Ephemeris::set_position(), and ossimplugins::Ephemeris::set_speed().

Referenced by ossimplugins::GeographicEphemeris::GeographicEphemeris(), and ossimplugins::ossimRadarSatModel::InitPlatformPosition().

50  {
51  const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ;
52  GMSTDateTime h;
53  h.set_origine(GMSTDateTime::AN1950);
54  double s,c;
55 
56  double pos[3];
57  double speed[3];
58 
59  _date.AsGMSTDateTime(&h) ;
60  c = cos (h.get_tms()) ;
61  s = sin (h.get_tms()) ;
62  vGeo->set_date(_date);
63 
64  pos[0] = _position[0] * c + _position[1] * s ;
65  pos[1] = - _position[0] * s + _position[1] * c ;
66  pos[2] = _position[2] ;
67  speed[0] = _speed[0] * c + _speed[1] * s - OMEGATERRE * (_position[0] * s - _position[1] * c) ;
68  speed[1] = - _speed[0] * s + _speed[1] * c - OMEGATERRE * (_position[0] * c + _position[1] * s) ;
69  speed[2] = _speed[2] ;
70 
71  vGeo->set_position(pos);
72  vGeo->set_speed(speed);
73  }
int AsGMSTDateTime(GMSTDateTime *GMST)
This function converts the current JSDDateTime into GMST Date.

◆ ToGeographic() [2/2]

void ossimplugins::GalileanEphemeris::ToGeographic ( double  greenwich,
GeographicEphemeris vGeo 
)

Definition at line 75 of file GalileanEphemeris.cpp.

References ossimplugins::Ephemeris::_date, ossimplugins::Ephemeris::_position, ossimplugins::Ephemeris::_speed, ossimplugins::JSDDateTime::get_day0hTU(), ossimplugins::JulianDate::get_julianDate(), p2nutt(), ossimplugins::Ephemeris::set_date(), ossimplugins::Ephemeris::set_position(), and ossimplugins::Ephemeris::set_speed().

76  {
77  const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ;
78  // int etat,
79  int ierr ;
80  double p[10],pd[10];
81  double day;
82 
83  // etat = 0 ;
84 
85  vGeo->set_date(this->_date);
86 
87 
88  day= this->_date.get_day0hTU().get_julianDate();
89 
90  ierr = p2nutt( 2, greenwich, day, p, pd ) ;
91 
92  double position[3];
93  double speed[3];
94 
95  position[0] = _position[0]*p[1] + _position[1]*p[4] + _position[2]*p[7] ;
96 
97  position[1] = _position[0]*p[2] + _position[1]*p[5] + _position[2]*p[8] ;
98 
99  position[2] = _position[0]*p[3] + _position[1]*p[6] + _position[2]*p[9] ;
100 
101  speed[0] = _speed[0]*p[1] +_speed[1]*p[4] + _speed[2]*p[7] + OMEGATERRE * (_position[0]*pd[1] + _position[1]*pd[4] + _position[2]*pd[7] );
102 
103  speed[1] = _speed[0]*p[2] + _speed[1]*p[5] + _speed[2] *p[8] + OMEGATERRE * (_position[0]*pd[2] + _position[1]*pd[5] + _position[2]*pd[8] );
104 
105  speed[2] = _speed[0]*p[3] + _speed[1]*p[6] + _speed[2]*p[9] + OMEGATERRE * (_position[0]*pd[3] + _position[1]*pd[6] + _position[2]*pd[9] );
106 
107  vGeo->set_position(position);
108  vGeo->set_speed(speed);
109  }
int p2nutt(int newcmb, double greenwich, double day, double p[], double pd[])
double get_julianDate() const
Definition: JulianDate.h:70
JulianDate get_day0hTU() const
Definition: JSDDateTime.h:71

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