Changeset 11057 in ntrip for trunk/BNC/src/ephemeris.cpp


Ignore:
Timestamp:
Sep 30, 2026, 11:30:26 AM (12 days ago)
Author:
stuerze
Message:

bug fixes resulting from overall tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/ephemeris.cpp

    r10998 r11057  
    648648    }
    649649  }
     650
     651  // CNAV/CNAV-2 records carry no separate t_oe: t_oe = t_oc
     652  // (RINEX 4.02 Tables A9/A11, IS-GPS-200 30.3.4.4, IS-GPS-800 3.5.3.7.1).
     653  // NavIC L1NV (RINEX 4.02 Table A31): single reference epoch t_oec for
     654  // ephemeris and clock (NavIC L1 SPS ICD 6.2.1.6, Appendices A and B).
     655  // ---------------------------------------------------------------------
     656  if (type() == t_eph::CNAV || type() == t_eph::CNV2 || type() == t_eph::L1NV) {
     657    _TOEweek = _TOC.gpsw();
     658    _TOEsec  = _TOC.gpssec();
     659  }
    650660}
    651661
    … …  
    672682
    673683  double n = n0 + _Delta_n;
     684
     685  // CNAV/CNAV-2 (IS-GPS-200 Table 30-II) and NavIC L1NV (NavIC L1 SPS
     686  // ICD Appendix A): semi-major axis and mean motion difference are
     687  // time-variable, A_k = A0 + Adot*tk and
     688  // n_A = n0 + Delta_n0 + 1/2*Delta_n0_dot*tk.
     689  // n0 is computed from A0 for GPS/QZSS but from A_k for NavIC L1NV.
     690  double A    = a0;
     691  double Adot = 0.0;
     692  if (type() == t_eph::CNAV || type() == t_eph::CNV2 || type() == t_eph::L1NV) {
     693    Adot = _ADOT;
     694    A   += _ADOT * tk;
     695    n   += 0.5 * _Delta_n_dot * tk;
     696    if (type() == t_eph::L1NV) {
     697      n += sqrt(gmGRS / (A * A * A)) - n0;
     698    }
     699  }
     700
    674701  double M = _M0 + n * tk;
    675702  double E = M;
    … …  
    688715  double sin2u0 = sin(2 * u0);
    689716  double cos2u0 = cos(2 * u0);
    690   double r = a0 * (1 - _e * cos(E)) + _Crc * cos2u0 + _Crs * sin2u0;
     717  double r = A * (1 - _e * cos(E)) + _Crc * cos2u0 + _Crs * sin2u0;
    691718  double i = _i0 + _IDOT * tk + _Cic * cos2u0 + _Cis * sin2u0;
    692719  double u = u0 + _Cuc * cos2u0 + _Cus * sin2u0;
    … …  
    715742  double dotom = _OMEGADOT - omegaEarth;
    716743  double doti = _IDOT + (-_Cic * sin2u0 + _Cis * cos2u0) * 2 * dotv;
    717   double dotr = a0 * _e * sin(E) * dEdM * n
     744  double dotr = A * _e * sin(E) * dEdM * n + Adot * (1 - _e * cos(E))
    718745      + (-_Crc * sin2u0 + _Crs * cos2u0) * 2 * dotv;
    719746  double dotx = dotr * cos(u) - r * sin(u) * dotu;
    … …  
    740767  }
    741768  else {
    742     xc[3] -= 4.442807633e-10 * _e * sqrt(a0) * sin(E);
     769    xc[3] -= 4.442807633e-10 * _e * sqrt(A) * sin(E);
    743770  }
    744771
    … …  
    10871114      switch (type()) {
    10881115        case  t_eph::LNAV:
    1089         case  t_eph::CNAV:
    10901116        case  t_eph::CNV2:
    10911117          if (_health == 0.0) {
     1118            return 0;
     1119          }
     1120          else {
     1121            return 1;
     1122          }
     1123          break;
     1124        case  t_eph::CNAV:
     1125          // RINEX 4: bits 52(MSB)-54(LSB) of msg 10 = L1, L2, L5 health.
     1126          // An L5-only flag (value 1, common while L5 is not fully
     1127          // operational) does not make orbit/clock unusable; the data set
     1128          // is unhealthy if L1 or L2 is flagged.
     1129          if ((int(_health) & 0x6) == 0) {
    10921130            return 0;
    10931131          }
Note: See TracChangeset for help on using the changeset viewer.