22 double latitude,
double longitude,
23 double elevation,
double azimuth,
24 const std::array<double, 4>& alpha,
const std::array<double, 4>& beta)
31 double psi = 0.0137 / (E + 0.11) - 0.022;
32 LOG_DATA(
"psi {} [semi-circles] (Earth's central angle between the user position and the earth projection of ionospheric intersection point)", psi);
36 double phi_I = std::clamp(phi_u + psi * std::cos(azimuth), -0.416, 0.416);
37 LOG_DATA(
"phi_I {} [semi-circles] (Sub-ionospheric latitude)", phi_I);
41 double lambda_I = lambda_u + (psi * std::sin(azimuth)) / std::cos(
semicircles2rad(phi_I));
42 LOG_DATA(
"lambda_I {} [semi-circles] (Sub-ionospheric longitude)", lambda_I);
45 double phi_m = phi_I + 0.064 * std::cos(
semicircles2rad(lambda_I - 1.617));
46 LOG_DATA(
"phi_m {} [semi-circles] (Geomagnetic latitude)", phi_m);
54 LOG_DATA(
"t {} [s] (Local time)", t);
57 double F = 1.0 + 16.0 * std::pow(0.53 - E, 3);
58 LOG_DATA(
"F {} [-] (Slant factor / obliquity factor)", F);
62 for (
size_t n = 0; n < beta.size(); ++n)
64 PER += beta.at(n) * std::pow(phi_m, n);
66 PER = std::max(PER, 72000.0);
67 LOG_DATA(
"PER {} [s] (Period of the model)", PER);
71 for (
size_t n = 0; n < beta.size(); ++n)
73 AMP += alpha.at(n) * std::pow(phi_m, n);
75 AMP = std::max(AMP, 0.0);
76 LOG_DATA(
"AMP {} [s] (Amplitude of the vertical delay)", AMP);
79 double x = (2 * M_PI * (t - 50400.0)) / PER;
83 double T_iono = std::abs(x) < 1.57 ? F * (5e-9 + AMP * (1.0 - std::pow(x, 2) / 2.0 + std::pow(x, 4) / 24.0))
85 LOG_DATA(
"T_iono_L1 {} [s] (Ionospheric delay)", T_iono);
89 LOG_DATA(
"T_iono {} [s] (Ionospheric delay for requested frequency)", T_iono);
double ratioFreqSquared(Frequency f1, Frequency f2, int8_t num1, int8_t num2)
Calculates the ration of the frequencies squared γ
double calcIonosphericTimeDelay_Klobuchar(double tow, Frequency freq, int8_t freqNum, double latitude, double longitude, double elevation, double azimuth, const std::array< double, 4 > &alpha, const std::array< double, 4 > &beta)
Calculates the ionospheric time delay with the Klobuchar model.