29 double mjd1 = mjd - 51544.5;
31 double cosfy = cos(mjd1 / 365.25 * 2.0 * M_PI);
32 double coshy = cos(mjd1 / 365.25 * 4.0 * M_PI);
33 double sinfy = sin(mjd1 / 365.25 * 2.0 * M_PI);
34 double sinhy = sin(mjd1 / 365.25 * 4.0 * M_PI);
36 double dlat = lla_pos(0);
37 double dlon = lla_pos(1);
38 double hell = lla_pos(2);
41 double plon = dlon < 0.0 ? (dlon + 2.0 * M_PI) * 180.0 / M_PI : dlon * 180.0 / M_PI;
44 double ppod = (-dlat + M_PI / 2.0) * 180.0 / M_PI;
47 auto ipod =
static_cast<int>(floor(ppod + 1.0));
48 auto ilon =
static_cast<int>(floor(plon + 1.0));
51 double diffpod = ppod - (ipod - 0.5);
52 double difflon = plon - (ilon - 0.5);
55 if (ipod == 181) { ipod = 180; }
57 if (ilon == 361) { ilon = 1; }
58 if (ilon == 0) { ilon = 360; }
60 constexpr size_t N = 4;
61 std::array<size_t, N> indx{};
63 indx[0] =
static_cast<size_t>((ipod - 1) * 360 + ilon) - 1;
67 if (ppod <= 0.5 || ppod >= 179.5)
71 gpt2outputs.
undu = GPT2_grid.at(ix).undulation;
72 double hgt = hell - gpt2outputs.
undu;
75 double T0 = GPT2_grid.at(ix).T_A0 + GPT2_grid.at(ix).T_A1 * cosfy + GPT2_grid.at(ix).T_B1 * sinfy + GPT2_grid.at(ix).T_A2 * coshy + GPT2_grid.at(ix).T_B2 * sinhy;
76 double p0 = GPT2_grid.at(ix).p_A0 + GPT2_grid.at(ix).p_A1 * cosfy + GPT2_grid.at(ix).p_B1 * sinfy + GPT2_grid.at(ix).p_A2 * coshy + GPT2_grid.at(ix).p_B2 * sinhy;
79 double Q = (GPT2_grid.at(ix).Q_A0 + GPT2_grid.at(ix).Q_A1 * cosfy + GPT2_grid.at(ix).Q_B1 * sinfy + GPT2_grid.at(ix).Q_A2 * coshy + GPT2_grid.at(ix).Q_B2 * sinhy)
83 gpt2outputs.
dT = (GPT2_grid.at(ix).dT_A0 + GPT2_grid.at(ix).dT_A1 * cosfy + GPT2_grid.at(ix).dT_B1 * sinfy + GPT2_grid.at(ix).dT_A2 * coshy + GPT2_grid.at(ix).dT_B2 * sinhy)
87 double redh = hgt - GPT2_grid.at(ix).Hs;
90 gpt2outputs.
T = T0 + gpt2outputs.
dT * redh - 273.150;
93 gpt2outputs.
dT = gpt2outputs.
dT * 1e3;
96 double Tv = T0 * (1 + 0.6077 * Q);
101 gpt2outputs.
p = (p0 * exp(-c * redh)) / 100.0;
104 gpt2outputs.
ah = (GPT2_grid.at(ix).h_A0 + GPT2_grid.at(ix).h_A1 * cosfy + GPT2_grid.at(ix).h_B1 * sinfy + GPT2_grid.at(ix).h_A2 * coshy + GPT2_grid.at(ix).h_B2 * sinhy)
108 gpt2outputs.
aw = (GPT2_grid.at(ix).w_A0 + GPT2_grid.at(ix).w_A1 * cosfy + GPT2_grid.at(ix).w_B1 * sinfy + GPT2_grid.at(ix).w_A2 * coshy + GPT2_grid.at(ix).w_B2 * sinhy)
112 gpt2outputs.
la = GPT2_grid.at(ix).la_A0 + GPT2_grid.at(ix).la_A1 * cosfy + GPT2_grid.at(ix).la_B1 * sinfy + GPT2_grid.at(ix).la_A2 * coshy + GPT2_grid.at(ix).la_B2 * sinhy;
115 gpt2outputs.
Tm = GPT2_grid.at(ix).Tm_A0 + GPT2_grid.at(ix).Tm_A1 * cosfy + GPT2_grid.at(ix).Tm_B1 * sinfy + GPT2_grid.at(ix).Tm_A2 * coshy + GPT2_grid.at(ix).Tm_B2 * sinhy;
118 double e0 = Q * p0 / (0.622 + 0.378 * Q) / 100.0;
120 gpt2outputs.
e = e0 * pow((100.0 * gpt2outputs.
p / p0), (gpt2outputs.
la + 1));
124 double ipod1 = ipod + int(
math::sign(1.0, diffpod));
125 double ilon1 = ilon + int(
math::sign(1.0, difflon));
128 if (ilon1 == 361) { ilon1 = 1; }
129 if (ilon1 == 0) { ilon1 = 360; }
131 indx[1] =
static_cast<size_t>((ipod1 - 1) * 360 + ilon) - 1;
132 indx[2] =
static_cast<size_t>((ipod - 1) * 360 + ilon1) - 1;
133 indx[3] =
static_cast<size_t>((ipod1 - 1) * 360 + ilon1) - 1;
135 std::array<double, N> undul{};
136 std::array<double, N> Ql{};
137 std::array<double, N> dTl{};
138 std::array<double, N> Tl{};
139 std::array<double, N> pl{};
140 std::array<double, N> ahl{};
141 std::array<double, N> awl{};
142 std::array<double, N> lal{};
143 std::array<double, N> Tml{};
144 std::array<double, N> el{};
146 for (
size_t l = 0; l < N; l++)
150 auto ix = indx.at(l);
152 undul.at(l) = GPT2_grid.at(ix).undulation;
153 double hgt = hell - undul.at(l);
156 double T0 = GPT2_grid.at(ix).T_A0 + GPT2_grid.at(ix).T_A1 * cosfy + GPT2_grid.at(ix).T_B1 * sinfy + GPT2_grid.at(ix).T_A2 * coshy + GPT2_grid.at(ix).T_B2 * sinhy;
157 double p0 = GPT2_grid.at(ix).p_A0 + GPT2_grid.at(ix).p_A1 * cosfy + GPT2_grid.at(ix).p_B1 * sinfy + GPT2_grid.at(ix).p_A2 * coshy + GPT2_grid.at(ix).p_B2 * sinhy;
160 Ql.at(l) = (GPT2_grid.at(ix).Q_A0 + GPT2_grid.at(ix).Q_A1 * cosfy + GPT2_grid.at(ix).Q_B1 * sinfy + GPT2_grid.at(ix).Q_A2 * coshy + GPT2_grid.at(ix).Q_B2 * sinhy)
164 double redh = hgt - GPT2_grid.at(ix).Hs;
167 dTl.at(l) = (GPT2_grid.at(ix).dT_A0 + GPT2_grid.at(ix).dT_A1 * cosfy + GPT2_grid.at(ix).dT_B1 * sinfy + GPT2_grid.at(ix).dT_A2 * coshy + GPT2_grid.at(ix).dT_B2 * sinhy)
171 Tl.at(l) = T0 + dTl.at(l) * redh - 273.150;
174 double Tv = T0 * (1 + 0.6077 * Ql.at(l));
178 pl.at(l) = (p0 * exp(-c * redh)) / 100.0;
181 ahl.at(l) = (GPT2_grid.at(ix).h_A0 + GPT2_grid.at(ix).h_A1 * cosfy + GPT2_grid.at(ix).h_B1 * sinfy + GPT2_grid.at(ix).h_A2 * coshy + GPT2_grid.at(ix).h_B2 * sinhy)
185 awl.at(l) = (GPT2_grid.at(ix).w_A0 + GPT2_grid.at(ix).w_A1 * cosfy + GPT2_grid.at(ix).w_B1 * sinfy + GPT2_grid.at(ix).w_A2 * coshy + GPT2_grid.at(ix).w_B2 * sinhy)
189 lal.at(l) = GPT2_grid.at(ix).la_A0 + GPT2_grid.at(ix).la_A1 * cosfy + GPT2_grid.at(ix).la_B1 * sinfy + GPT2_grid.at(ix).la_A2 * coshy + GPT2_grid.at(ix).la_B2 * sinhy;
192 Tml.at(l) = GPT2_grid.at(ix).Tm_A0 + GPT2_grid.at(ix).Tm_A1 * cosfy + GPT2_grid.at(ix).Tm_B1 * sinfy + GPT2_grid.at(ix).Tm_A2 * coshy + GPT2_grid.at(ix).Tm_B2 * sinhy;
195 double e0 = Ql.at(l) * p0 / (0.622 + 0.378 * Ql.at(l)) / 100.0;
197 el.at(l) = e0 * pow((100.0 * pl.at(l) / p0), (lal.at(l) + 1.0));
200 double dnpod1 = fabs(diffpod);
201 double dnpod2 = 1.0 - dnpod1;
202 double dnlon1 = fabs(difflon);
203 double dnlon2 = 1.0 - dnlon1;
206 double R1 = dnpod2 * pl[0] + dnpod1 * pl[1];
207 double R2 = dnpod2 * pl[2] + dnpod1 * pl[3];
208 gpt2outputs.
p = dnlon2 * R1 + dnlon1 * R2;
211 R1 = dnpod2 * Tl[0] + dnpod1 * Tl[1];
212 R2 = dnpod2 * Tl[2] + dnpod1 * Tl[3];
213 gpt2outputs.
T = dnlon2 * R1 + dnlon1 * R2;
216 R1 = dnpod2 * dTl[0] + dnpod1 * dTl[1];
217 R2 = dnpod2 * dTl[2] + dnpod1 * dTl[3];
218 gpt2outputs.
dT = (dnlon2 * R1 + dnlon1 * R2) * 1e3;
221 R1 = dnpod2 * el[0] + dnpod1 * el[1];
222 R2 = dnpod2 * el[2] + dnpod1 * el[3];
223 gpt2outputs.
e = dnlon2 * R1 + dnlon1 * R2;
226 R1 = dnpod2 * ahl[0] + dnpod1 * ahl[1];
227 R2 = dnpod2 * ahl[2] + dnpod1 * ahl[3];
228 gpt2outputs.
ah = dnlon2 * R1 + dnlon1 * R2;
231 R1 = dnpod2 * awl[0] + dnpod1 * awl[1];
232 R2 = dnpod2 * awl[2] + dnpod1 * awl[3];
233 gpt2outputs.
aw = dnlon2 * R1 + dnlon1 * R2;
236 R1 = dnpod2 * undul[0] + dnpod1 * undul[1];
237 R2 = dnpod2 * undul[2] + dnpod1 * undul[3];
238 gpt2outputs.
undu = dnlon2 * R1 + dnlon1 * R2;
241 R1 = dnpod2 * lal[0] + dnpod1 * lal[1];
242 R2 = dnpod2 * lal[2] + dnpod1 * lal[3];
243 gpt2outputs.
la = dnlon2 * R1 + dnlon1 * R2;
246 R1 = dnpod2 * Tml[0] + dnpod1 * Tml[1];
247 R2 = dnpod2 * Tml[2] + dnpod1 * Tml[3];
248 gpt2outputs.
Tm = dnlon2 * R1 + dnlon1 * R2;
263 double cosfy = cos(doy / 365.25 * 2.0 * M_PI);
264 double coshy = cos(doy / 365.25 * 4.0 * M_PI);
265 double sinfy = sin(doy / 365.25 * 2.0 * M_PI);
266 double sinhy = sin(doy / 365.25 * 4.0 * M_PI);
268 double dlat = lla_pos(0);
269 double dlon = lla_pos(1);
270 double hell = lla_pos(2);
273 double plon = dlon < 0.0 ? (dlon + 2.0 * M_PI) * 180.0 / M_PI : dlon * 180.0 / M_PI;
276 double ppod = (-dlat + M_PI / 2.0) * 180.0 / M_PI;
279 auto ipod =
static_cast<int>(floor(ppod + 1.0));
280 auto ilon =
static_cast<int>(floor(plon + 1.0));
283 double diffpod = ppod - (ipod - 0.5);
284 double difflon = plon - (ilon - 0.5);
287 if (ipod == 181) { ipod = 180; }
289 if (ilon == 361) { ilon = 1; }
290 if (ilon == 0) { ilon = 360; }
292 constexpr size_t N = 4;
293 std::array<size_t, N> indx{};
295 indx[0] =
static_cast<size_t>((ipod - 1) * 360 + ilon) - 1;
299 if (ppod <= 0.5 || ppod >= 179.5)
303 gpt3outputs.
undu = GPT3_grid.at(ix).undulation;
304 double hgt = hell - gpt3outputs.
undu;
307 double T0 = GPT3_grid.at(ix).T_A0 + GPT3_grid.at(ix).T_A1 * cosfy + GPT3_grid.at(ix).T_B1 * sinfy + GPT3_grid.at(ix).T_A2 * coshy + GPT3_grid.at(ix).T_B2 * sinhy;
308 double p0 = GPT3_grid.at(ix).p_A0 + GPT3_grid.at(ix).p_A1 * cosfy + GPT3_grid.at(ix).p_B1 * sinfy + GPT3_grid.at(ix).p_A2 * coshy + GPT3_grid.at(ix).p_B2 * sinhy;
311 double Q = (GPT3_grid.at(ix).Q_A0 + GPT3_grid.at(ix).Q_A1 * cosfy + GPT3_grid.at(ix).Q_B1 * sinfy + GPT3_grid.at(ix).Q_A2 * coshy + GPT3_grid.at(ix).Q_B2 * sinhy)
315 gpt3outputs.
dT = (GPT3_grid.at(ix).dT_A0 + GPT3_grid.at(ix).dT_A1 * cosfy + GPT3_grid.at(ix).dT_B1 * sinfy + GPT3_grid.at(ix).dT_A2 * coshy + GPT3_grid.at(ix).dT_B2 * sinhy)
319 double redh = hgt - GPT3_grid.at(ix).Hs;
322 gpt3outputs.
T = T0 + gpt3outputs.
dT * redh - 273.150;
325 gpt3outputs.
dT = gpt3outputs.
dT * 1e3;
328 double Tv = T0 * (1 + 0.6077 * Q);
333 gpt3outputs.
p = (p0 * exp(-c * redh)) / 100.0;
336 gpt3outputs.
ah = (GPT3_grid.at(ix).h_A0 + GPT3_grid.at(ix).h_A1 * cosfy + GPT3_grid.at(ix).h_B1 * sinfy + GPT3_grid.at(ix).h_A2 * coshy + GPT3_grid.at(ix).h_B2 * sinhy)
340 gpt3outputs.
aw = (GPT3_grid.at(ix).w_A0 + GPT3_grid.at(ix).w_A1 * cosfy + GPT3_grid.at(ix).w_B1 * sinfy + GPT3_grid.at(ix).w_A2 * coshy + GPT3_grid.at(ix).w_B2 * sinhy)
344 gpt3outputs.
la = GPT3_grid.at(ix).la_A0 + GPT3_grid.at(ix).la_A1 * cosfy + GPT3_grid.at(ix).la_B1 * sinfy + GPT3_grid.at(ix).la_A2 * coshy + GPT3_grid.at(ix).la_B2 * sinhy;
347 gpt3outputs.
Tm = GPT3_grid.at(ix).Tm_A0 + GPT3_grid.at(ix).Tm_A1 * cosfy + GPT3_grid.at(ix).Tm_B1 * sinfy + GPT3_grid.at(ix).Tm_A2 * coshy + GPT3_grid.at(ix).Tm_B2 * sinhy;
350 double e0 = Q * p0 / (0.622 + 0.378 * Q) / 100.0;
352 gpt3outputs.
e = e0 * pow((100.0 * gpt3outputs.
p / p0), (gpt3outputs.
la + 1));
355 gpt3outputs.
Gn_h = (GPT3_grid.at(ix).Gnh_A0 + GPT3_grid.at(ix).Gnh_A1 * cosfy + GPT3_grid.at(ix).Gnh_B1 * sinfy + GPT3_grid.at(ix).Gnh_A2 * coshy + GPT3_grid.at(ix).Gnh_B2 * sinhy)
357 gpt3outputs.
Ge_h = (GPT3_grid.at(ix).Geh_A0 + GPT3_grid.at(ix).Geh_A1 * cosfy + GPT3_grid.at(ix).Geh_B1 * sinfy + GPT3_grid.at(ix).Geh_A2 * coshy + GPT3_grid.at(ix).Geh_B2 * sinhy)
359 gpt3outputs.
Gn_w = (GPT3_grid.at(ix).Gnw_A0 + GPT3_grid.at(ix).Gnw_A1 * cosfy + GPT3_grid.at(ix).Gnw_B1 * sinfy + GPT3_grid.at(ix).Gnw_A2 * coshy + GPT3_grid.at(ix).Gnw_B2 * sinhy)
361 gpt3outputs.
Ge_w = (GPT3_grid.at(ix).Gew_A0 + GPT3_grid.at(ix).Gew_A1 * cosfy + GPT3_grid.at(ix).Gew_B1 * sinfy + GPT3_grid.at(ix).Gew_A2 * coshy + GPT3_grid.at(ix).Gew_B2 * sinhy)
366 double ipod1 = ipod + int(
math::sign(1.0, diffpod));
367 double ilon1 = ilon + int(
math::sign(1.0, difflon));
370 if (ilon1 == 361) { ilon1 = 1; }
371 if (ilon1 == 0) { ilon1 = 360; }
373 indx[1] =
static_cast<size_t>((ipod1 - 1) * 360 + ilon) - 1;
374 indx[2] =
static_cast<size_t>((ipod - 1) * 360 + ilon1) - 1;
375 indx[3] =
static_cast<size_t>((ipod1 - 1) * 360 + ilon1) - 1;
377 std::array<double, N> undul{};
378 std::array<double, N> Ql{};
379 std::array<double, N> dTl{};
380 std::array<double, N> Tl{};
381 std::array<double, N> pl{};
382 std::array<double, N> ahl{};
383 std::array<double, N> awl{};
384 std::array<double, N> lal{};
385 std::array<double, N> Tml{};
386 std::array<double, N> el{};
387 std::array<double, N> Gn_hl{};
388 std::array<double, N> Ge_hl{};
389 std::array<double, N> Gn_wl{};
390 std::array<double, N> Ge_wl{};
392 for (
size_t l = 0; l < N; l++)
396 auto ix = indx.at(l);
398 undul.at(l) = GPT3_grid.at(ix).undulation;
399 double hgt = hell - undul.at(l);
402 double T0 = GPT3_grid.at(ix).T_A0 + GPT3_grid.at(ix).T_A1 * cosfy + GPT3_grid.at(ix).T_B1 * sinfy + GPT3_grid.at(ix).T_A2 * coshy + GPT3_grid.at(ix).T_B2 * sinhy;
403 double p0 = GPT3_grid.at(ix).p_A0 + GPT3_grid.at(ix).p_A1 * cosfy + GPT3_grid.at(ix).p_B1 * sinfy + GPT3_grid.at(ix).p_A2 * coshy + GPT3_grid.at(ix).p_B2 * sinhy;
406 Ql.at(l) = (GPT3_grid.at(ix).Q_A0 + GPT3_grid.at(ix).Q_A1 * cosfy + GPT3_grid.at(ix).Q_B1 * sinfy + GPT3_grid.at(ix).Q_A2 * coshy + GPT3_grid.at(ix).Q_B2 * sinhy)
410 double redh = hgt - GPT3_grid.at(ix).Hs;
413 dTl.at(l) = (GPT3_grid.at(ix).dT_A0 + GPT3_grid.at(ix).dT_A1 * cosfy + GPT3_grid.at(ix).dT_B1 * sinfy + GPT3_grid.at(ix).dT_A2 * coshy + GPT3_grid.at(ix).dT_B2 * sinhy)
417 Tl.at(l) = T0 + dTl.at(l) * redh - 273.150;
420 double Tv = T0 * (1 + 0.6077 * Ql.at(l));
424 pl.at(l) = (p0 * exp(-c * redh)) / 100.0;
427 ahl.at(l) = (GPT3_grid.at(ix).h_A0 + GPT3_grid.at(ix).h_A1 * cosfy + GPT3_grid.at(ix).h_B1 * sinfy + GPT3_grid.at(ix).h_A2 * coshy + GPT3_grid.at(ix).h_B2 * sinhy)
431 awl.at(l) = (GPT3_grid.at(ix).w_A0 + GPT3_grid.at(ix).w_A1 * cosfy + GPT3_grid.at(ix).w_B1 * sinfy + GPT3_grid.at(ix).w_A2 * coshy + GPT3_grid.at(ix).w_B2 * sinhy)
435 lal.at(l) = GPT3_grid.at(ix).la_A0 + GPT3_grid.at(ix).la_A1 * cosfy + GPT3_grid.at(ix).la_B1 * sinfy + GPT3_grid.at(ix).la_A2 * coshy + GPT3_grid.at(ix).la_B2 * sinhy;
438 Tml.at(l) = GPT3_grid.at(ix).Tm_A0 + GPT3_grid.at(ix).Tm_A1 * cosfy + GPT3_grid.at(ix).Tm_B1 * sinfy + GPT3_grid.at(ix).Tm_A2 * coshy + GPT3_grid.at(ix).Tm_B2 * sinhy;
441 double e0 = Ql.at(l) * p0 / (0.622 + 0.378 * Ql.at(l)) / 100.0;
443 el.at(l) = e0 * pow((100.0 * pl.at(l) / p0), (lal.at(l) + 1.0));
446 Gn_hl.at(l) = (GPT3_grid.at(ix).Gnh_A0 + GPT3_grid.at(ix).Gnh_A1 * cosfy + GPT3_grid.at(ix).Gnh_B1 * sinfy + GPT3_grid.at(ix).Gnh_A2 * coshy + GPT3_grid.at(ix).Gnh_B2 * sinhy)
448 Ge_hl.at(l) = (GPT3_grid.at(ix).Geh_A0 + GPT3_grid.at(ix).Geh_A1 * cosfy + GPT3_grid.at(ix).Geh_B1 * sinfy + GPT3_grid.at(ix).Geh_A2 * coshy + GPT3_grid.at(ix).Geh_B2 * sinhy)
450 Gn_wl.at(l) = (GPT3_grid.at(ix).Gnw_A0 + GPT3_grid.at(ix).Gnw_A1 * cosfy + GPT3_grid.at(ix).Gnw_B1 * sinfy + GPT3_grid.at(ix).Gnw_A2 * coshy + GPT3_grid.at(ix).Gnw_B2 * sinhy)
452 Ge_wl.at(l) = (GPT3_grid.at(ix).Gew_A0 + GPT3_grid.at(ix).Gew_A1 * cosfy + GPT3_grid.at(ix).Gew_B1 * sinfy + GPT3_grid.at(ix).Gew_A2 * coshy + GPT3_grid.at(ix).Gew_B2 * sinhy)
456 double dnpod1 = fabs(diffpod);
457 double dnpod2 = 1.0 - dnpod1;
458 double dnlon1 = fabs(difflon);
459 double dnlon2 = 1.0 - dnlon1;
462 double R1 = dnpod2 * pl[0] + dnpod1 * pl[1];
463 double R2 = dnpod2 * pl[2] + dnpod1 * pl[3];
464 gpt3outputs.
p = dnlon2 * R1 + dnlon1 * R2;
467 R1 = dnpod2 * Tl[0] + dnpod1 * Tl[1];
468 R2 = dnpod2 * Tl[2] + dnpod1 * Tl[3];
469 gpt3outputs.
T = dnlon2 * R1 + dnlon1 * R2;
472 R1 = dnpod2 * dTl[0] + dnpod1 * dTl[1];
473 R2 = dnpod2 * dTl[2] + dnpod1 * dTl[3];
474 gpt3outputs.
dT = (dnlon2 * R1 + dnlon1 * R2) * 1e3;
477 R1 = dnpod2 * el[0] + dnpod1 * el[1];
478 R2 = dnpod2 * el[2] + dnpod1 * el[3];
479 gpt3outputs.
e = dnlon2 * R1 + dnlon1 * R2;
482 R1 = dnpod2 * ahl[0] + dnpod1 * ahl[1];
483 R2 = dnpod2 * ahl[2] + dnpod1 * ahl[3];
484 gpt3outputs.
ah = dnlon2 * R1 + dnlon1 * R2;
487 R1 = dnpod2 * awl[0] + dnpod1 * awl[1];
488 R2 = dnpod2 * awl[2] + dnpod1 * awl[3];
489 gpt3outputs.
aw = dnlon2 * R1 + dnlon1 * R2;
492 R1 = dnpod2 * undul[0] + dnpod1 * undul[1];
493 R2 = dnpod2 * undul[2] + dnpod1 * undul[3];
494 gpt3outputs.
undu = dnlon2 * R1 + dnlon1 * R2;
497 R1 = dnpod2 * lal[0] + dnpod1 * lal[1];
498 R2 = dnpod2 * lal[2] + dnpod1 * lal[3];
499 gpt3outputs.
la = dnlon2 * R1 + dnlon1 * R2;
502 R1 = dnpod2 * Tml[0] + dnpod1 * Tml[1];
503 R2 = dnpod2 * Tml[2] + dnpod1 * Tml[3];
504 gpt3outputs.
Tm = dnlon2 * R1 + dnlon1 * R2;
507 R1 = dnpod2 * Gn_hl[0] + dnpod1 * Gn_hl[1];
508 R2 = dnpod2 * Gn_hl[2] + dnpod1 * Gn_hl[3];
509 gpt3outputs.
Gn_h = dnlon2 * R1 + dnlon1 * R2;
511 R1 = dnpod2 * Ge_hl[0] + dnpod1 * Ge_hl[1];
512 R2 = dnpod2 * Ge_hl[2] + dnpod1 * Ge_hl[3];
513 gpt3outputs.
Ge_h = dnlon2 * R1 + dnlon1 * R2;
515 R1 = dnpod2 * Gn_wl[0] + dnpod1 * Gn_wl[1];
516 R2 = dnpod2 * Gn_wl[2] + dnpod1 * Gn_wl[3];
517 gpt3outputs.
Gn_w = dnlon2 * R1 + dnlon1 * R2;
519 R1 = dnpod2 * Ge_wl[0] + dnpod1 * Ge_wl[1];
520 R2 = dnpod2 * Ge_wl[2] + dnpod1 * Ge_wl[3];
521 gpt3outputs.
Ge_w = dnlon2 * R1 + dnlon1 * R2;
530 double hour = floor((mjd - floor(mjd)) * 24);
531 double minu = floor((((mjd - floor(mjd)) * 24) - hour) * 60);
532 double sec = (((((mjd - floor(mjd)) * 24) - hour) * 60) - minu) * 60;
535 if (sec == 60.0) { minu = minu + 1; }
536 if (minu == 60.0) { hour = hour + 1; }
539 double jd = mjd + 2400000.5;
542 if (hour == 24.0) { jd = jd + 1; }
545 double jd_int = floor(jd + 0.5);
547 double aa = jd_int + 32044;
548 double bb = floor((4 * aa + 3) / 146097);
549 double cc = aa - floor((bb * 146097) / 4);
550 double dd = floor((4 * cc + 3) / 1461);
551 double ee = cc - floor((1461 * dd) / 4);
552 double mm = floor((5 * ee + 2) / 153);
554 auto day =
static_cast<int>(ee - floor((153 * mm + 2) / 5) + 1);
555 auto month =
static_cast<int>(mm + 3 - 12 * floor(mm / 10));
556 auto year =
static_cast<int>(bb * 100 + dd - 4800 + floor(mm / 10));
559 double leapYear = 0.0;
560 if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
568 auto days = [inits = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }] {
return std::vector<int>{ std::begin(inits), std::end(inits) }; }();
570 for (
size_t i = 0; i < static_cast<size_t>(month) - 1; i++)
574 double doy = sum + day;
576 if (leapYear == 1 && month > 2)
582 doy = doy + mjd - floor(mjd);