General Purpose Geodetic Library
SgOceanLoad.cpp
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2010-2020 Sergei Bolotin.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 
24 #include <math.h>
25 
26 
27 #include <SgLogger.h>
28 #include <SgOceanLoad.h>
29 #include <SgTaskConfig.h>
30 #include <SgVlbiStationInfo.h>
31 
32 
33 /*=======================================================================================================
34 *
35 * METHODS:
36 *
37 *======================================================================================================*/
38 //
39 // static first:
40 const QString SgOceanLoad::className()
41 {
42  return "SgOceanLoad";
43 };
44 
45 
46 
47 //
49 {
50  cfg_ = cfg;
51  for (int i=0; i<11; i++)
52  angle[i] = 0.0;
53 };
54 
55 
56 
57 // A destructor:
59 {
60 };
61 
62 
63 
64 //
66 {
67  //
68  // FRACTIONAL PART OF DAY IN SECONDS
69  //
70  double fDay = t.getTime()*86400.0;
71  //
72  double capt = (27392.500528 + 1.000000035*floor((t - _1975)))/36525.0;
73  //
74  // MEAN LONGITUDE OF SUN AT BEGINNING OF DAY
75  //
76  double h0 = (279.69668 + (36000.768930485 + 3.03e-4*capt)*capt)*DEG2RAD;
77  //
78  // MEAN LONGITUDE OF MOON AT BEGINNING OF DAY
79  //
80  double s0 = (((1.9e-6*capt - 0.001133)*capt + 481267.88314137)*capt + 270.434358)*DEG2RAD;
81  //
82  // MEAN LONGITUDE OF LUNAR PERIGEE AT BEGINNING OF DAY
83  //
84  double p0 = (((-1.2e-5*capt - 0.010325)*capt + 4069.0340329577)*capt + 334.329653)*DEG2RAD;
85 
86  for (int k=0; k<11; k++)
87  {
88  angle[k] = speed[k]*fDay + angfac[0][k]*h0 + angfac[1][k]*s0
89  + angfac[2][k]*p0 + angfac[3][k]*2.0*M_PI;
90  angle[k] = fmod(angle[k], 2.0*M_PI);
91  if (angle[k]<0.0)
92  angle[k] = angle[k] + 2.0*M_PI;
93  };
94 };
95 
96 
97 
98 //
100 {
101  clear();
102  if (!stnInfo)
103  {
105  ": calcDisplacement(): stnInfo is NULL");
106  return *this;
107  };
108 
109  /*
110  IERS Technical Note 21,
111  IERS Conventions (1996)
112  page 53 says:
113  " A shorter form of (2) is obtained if the summation considers only the tidal
114  species of Table 7.1 and corrections for the modulating effect of the lunar node.
115  Then,
116 
117  \Delta c = \Sum ( f_j*A_cj*cos(omega_j*t + hi_j + u_j - Phi_cj) ), (4)
118 
119  where f_j and u_j depend on longitude of lunar node according to Table 26 of
120  Doodson (1928)."
121  */
122  double fS1N, fC1N, fS2N, fC2N, fS3N, fC3N;
123  double f[11], u[11], fTmp=0.0;
124  double dt = (t - tEphem)/36525.0;
125  double dt2 = dt*dt;
126  double dt3 = dt2*dt;
127  double dt4 = dt2*dt2;
128  fTmp = 125.04455501*3600.0 - 6962890.5431*dt + 7.4722*dt2 + 0.007702*dt3 - 0.00005939*dt4;
129  fTmp = fmod(fTmp*SEC2RAD, 2.0*M_PI);
130 
131  for (int i=0; i<11; i++)
132  {
133  f[i] = 1.0;
134  u[i] = 0.0;
135  };
136 
137  sincos ( fTmp, &fS1N, &fC1N);
138  sincos (2.0*fTmp, &fS2N, &fC2N);
139  sincos (3.0*fTmp, &fS3N, &fC3N);
140 
141  f[ 0] = 1.0004 - 0.0373*fC1N + 0.0002*fC2N ;
142  f[ 3] = 1.0241 + 0.2863*fC1N + 0.0083*fC2N - 0.0015*fC3N;
143  f[ 4] = 1.0060 + 0.1150*fC1N - 0.0088*fC2N + 0.0006*fC3N;
144  f[ 5] = 1.0089 + 0.1871*fC1N - 0.0147*fC2N + 0.0014*fC3N;
145  f[ 8] = 1.0429 + 0.4135*fC1N - 0.0040*fC2N ;
146  f[ 9] = 1.0000 - 0.1300*fC1N + 0.0013*fC2N ;
147 
148  u[ 0] = ( - 2.14 *fS1N )*DEG2RAD;
149  u[ 3] = ( -17.74 *fS1N + 0.68 *fS2N - 0.04 *fS3N)*DEG2RAD;
150  u[ 4] = ( - 8.86 *fS1N + 0.68 *fS2N - 0.07 *fS3N)*DEG2RAD;
151  u[ 5] = ( 10.80 *fS1N - 1.34 *fS2N + 0.19 *fS3N)*DEG2RAD;
152  u[ 8] = ( -23.74 *fS1N + 2.68 *fS2N - 0.38 *fS3N)*DEG2RAD;
153 
154  /*
155  "The astronomical arguments needed in (4) can be computed with subroutune ARG below."
156  */
157  arg_IERS(t);
158 
159  // summation:
160  for (int i=0; i<3; i++)
161  for (int j=0; j<11; j++)
162  vec[i] += f[j]*stnInfo->getOLoadAmplitude(j,i)*cos(angle[j] + u[j] - stnInfo->getOLoadPhase(j,i));
163 
164  //make it in VEN:
165  vec[1] *= -1.0;
166  vec[2] *= -1.0;
167 
168  return *this;
169 };
170 
171 
172 
173 /*=======================================================================================================
174 *
175 * FRIENDS:
176 *
177 *======================================================================================================*/
178 //
179 
180 
181 
182 /*=====================================================================================================*/
183 //
184 // aux functions:
185 //
186 
187 
188 // i/o:
189 
190 
191 /*=====================================================================================================*/
192 //
193 // constants:
194 //
195 /*=====================================================================================================*/
196 const double SgOceanLoad::speed[11]=
197 {
198  1.40519e-04, 1.45444e-04, 1.37880e-04, 1.45842e-04, 0.72921e-04,
199  0.67598e-04, 0.72523e-04, 0.64959e-04, 0.53234e-05, 0.26392e-05, 0.03982e-05
200 };
201 
202 const double SgOceanLoad::angfac[4][11]=
203 {
204  { 2.0, 0.0, 2.0, 2.0, 1.0 , 1.0 ,-1.0 , 1.0 , 0.0, 0.0, 2.0},
205  { -2.0, 0.0,-3.0, 0.0, 0.0 ,-2.0 , 0.0 ,-3.0 , 2.0, 1.0, 0.0},
206  { 0.0, 0.0, 1.0, 0.0, 0.0 , 0.0 , 0.0 , 1.0 , 0.0,-1.0, 0.0},
207  { 0.0, 0.0, 0.0, 0.0, 0.25,-0.25,-0.25,-0.25, 0.0, 0.0, 0.0}
208 };
209 
210 const SgMJD SgOceanLoad::_1975(1975, 1, 0);
211 
212 
213 
214 
215 
216 
217 
218 
219 /*=====================================================================================================*/
SgLogger * logger
Definition: SgLogger.cpp:231
const SgMJD tEphem(51544.5)
#define SEC2RAD
radians to arc seconds:
Definition: SgMathSupport.h:48
#define DEG2RAD
hours to radians:
Definition: SgMathSupport.h:40
double vec[3]
An array of 3 elements, stores elements of a vector.
Definition: Sg3dVector.h:51
void clear()
Definition: Sg3dVector.h:120
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ DISPLACEMENT
Definition: SgLogger.h:86
Definition: SgMJD.h:59
double getTime() const
Definition: SgMJD.h:457
static const double speed[11]
Definition: SgOceanLoad.h:85
const SgTaskConfig * cfg_
Definition: SgOceanLoad.h:91
static const SgMJD _1975
Definition: SgOceanLoad.h:87
double angle[11]
Definition: SgOceanLoad.h:88
static const double angfac[4][11]
Definition: SgOceanLoad.h:86
static const QString className()
Definition: SgOceanLoad.cpp:40
const Sg3dVector & calcDisplacement(const SgVlbiStationInfo *, const SgMJD &)
Definition: SgOceanLoad.cpp:99
void arg_IERS(const SgMJD &)
Definition: SgOceanLoad.cpp:65
SgOceanLoad(const SgTaskConfig *)
Definition: SgOceanLoad.cpp:48
double getOLoadPhase(int iWave, int iCoord) const
double getOLoadAmplitude(int iWave, int iCoord) const