Changeset 11218 in ntrip for trunk/BNC/src/combination/bnccomb.cpp
- Timestamp:
- Nov 23, 2026, 9:48:49 PM (8 hours ago)
- File:
-
- 1 edited
-
trunk/BNC/src/combination/bnccomb.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/combination/bnccomb.cpp
r11212 r11218 43 43 44 44 const double sigObs = 0.05; 45 46 // level of the combined clocks (regularization condition, see createAmat) 47 const double CLK_LEVEL_TAU = 3600.0; // [s] relaxation of the sum to zero 48 const double CLK_LEVEL_MAXGAP = 60.0; // [s] longer gap: sum set to zero again 45 49 46 50 using namespace std; … … 1177 1181 // -------------------------------------- 1178 1182 if (irc == success) { 1183 if (_method == filter) { 1184 _prevClk[sys].clear(); 1185 _prevClkTime[sys] = epoTime; 1186 } 1179 1187 for (int iPar = 1; iPar <= _params[sys].size(); iPar++) { 1180 1188 cmbParam* pp = _params[sys][iPar-1]; … … 1184 1192 // set clock result 1185 1193 masterCorr[pp->prn]->_dClkResult = pp->xx / t_CST::c; 1194 if (_method == filter && masterCorr[pp->prn]->_eph) { 1195 t_prevClk& prev = _prevClk[sys][pp->prn]; 1196 prev.clk = pp->xx; 1197 prev.iod = masterCorr[pp->prn]->_eph->IOD(); 1198 } 1186 1199 // Add Code Biases from SINEX File 1187 1200 if (_bsx) { … … 2170 2183 } 2171 2184 2172 // Regularization 2173 // -------------- 2185 // Regularization: level of the combined clocks 2186 // --------------------------------------------- 2187 // The sum of the combined clocks over the satellites of the epoch is not 2188 // fixed to zero in each epoch: a satellite missing in one epoch (e.g. its 2189 // correction of the master AC refers to an ephemeris not yet received, at 2190 // the BDS ephemeris change every hour) shifted all other clocks of the 2191 // system by its clock divided by the number of satellites (BDS: up to 1 m). 2192 // Instead, the sum over the satellites also combined in the previous epoch 2193 // keeps its value (continuity), relaxing to zero with CLK_LEVEL_TAU, so 2194 // that the clocks stay referred to the broadcast clocks in the long run 2195 // and a permanent change of the satellites shifts them only slowly. A 2196 // previous clock of another ephemeris is converted to the current one 2197 // (as in switchToLastEph). Without a previous epoch (start, gap longer 2198 // than CLK_LEVEL_MAXGAP) the sum is zero. 2199 QSet<int> presetRows; // conditions with their value set here 2174 2200 if (_method == filter) { 2175 2201 const double Ph = 1.e6; 2176 2202 PP(nObs+1) = Ph; 2203 const bncTime epoTime = corrs(sys)[0]->_time; 2204 const double dtPrev = _prevClkTime[sys].valid() ? epoTime - _prevClkTime[sys] : -1.0; 2205 const bool cont = dtPrev > 0.0 && dtPrev <= CLK_LEVEL_MAXGAP; 2206 double target = 0.0; 2207 int nCommon = 0; 2208 QList<int> allClk; 2177 2209 for (int iPar = 1; iPar <= _params[sys].size(); iPar++) { 2178 2210 cmbParam* pp = _params[sys][iPar-1]; 2179 2211 if ( AA.Column(iPar).maximum_absolute_value() > 0.0 && 2180 2212 pp->type == cmbParam::clkSat ) { 2213 allClk << iPar; 2214 if (!cont || !_prevClk[sys].contains(pp->prn) || !masterCorr.contains(pp->prn)) { 2215 continue; 2216 } 2217 const t_prevClk& prev = _prevClk[sys][pp->prn]; 2218 const t_eph* eph = masterCorr[pp->prn]->_eph; 2219 double prevClk = prev.clk; 2220 if (eph->IOD() != prev.iod) { 2221 const t_eph* ephOld = 0; 2222 for (const t_eph* ee : {(const t_eph*)_ephUser.ephLast(pp->prn), (const t_eph*)_ephUser.ephPrev(pp->prn)}) { 2223 if (ee && ee != eph && ee->IOD() == prev.iod) { 2224 ephOld = ee; 2225 } 2226 } 2227 ColumnVector xcNew(6), xcOld(6), vv(3); 2228 if (!ephOld || 2229 eph->getCrd(epoTime, xcNew, vv, false) != success || 2230 ephOld->getCrd(epoTime, xcOld, vv, false) != success) { 2231 continue; 2232 } 2233 prevClk -= (xcNew(4) - xcOld(4)) * t_CST::c; 2234 } 2235 AA(nObs+1, iPar) = 1.0; 2236 target += prevClk; 2237 ++nCommon; 2238 } 2239 } 2240 if (nCommon > 0) { 2241 ll(nObs+1) = (1.0 - min(1.0, dtPrev / CLK_LEVEL_TAU)) * target - DotProduct(AA.Row(nObs+1), x0); 2242 presetRows.insert(1); 2243 } 2244 else { 2245 for (int iPar : allClk) { 2181 2246 AA(nObs+1, iPar) = 1.0; 2182 2247 } … … 2290 2355 // filter. Exception: incomplete nominal datum of a satellite (see above). 2291 2356 for (int iCon = 1; iCon <= nCon; iCon++) { 2292 if (!incrementRows.contains(iCon)) { 2357 if (!incrementRows.contains(iCon) && !presetRows.contains(iCon)) { 2293 2358 ll(nObs+iCon) = -DotProduct(AA.Row(nObs+iCon), x0); 2294 2359 }
Note:
See TracChangeset
for help on using the changeset viewer.
