Changeset 6425 in ntrip


Ignore:
Timestamp:
Dec 24, 2014, 5:00:48 PM (9 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/orbComp/sp3Comp.cpp

    r6366 r6425  
    133133    ++ret;
    134134  }
    135   throw "satellite not found " + prn.toString();
     135  return -1;
    136136}
    137137
     
    165165    Matrix       AA(dc.size(), nPar); AA = 0.0;
    166166    ColumnVector ll(dc.size());       ll = 0.0;
    167     map<t_prn, double>::const_iterator it; int ii;
    168     for (it = dc.begin(), ii = 0; it != dc.end(); it++, ii++) {
     167    map<t_prn, double>::const_iterator it;
     168    int ii = -1;
     169    for (it = dc.begin(); it != dc.end(); it++) {
    169170      const t_prn& prn = it->first;
    170       int index = epochs.size() + satIndex(clkSats, prn);
    171       AA[ii][ie]    = 1.0; // epoch-specfic offset (common for all satellites)
    172       AA[ii][index] = 1.0; // satellite-specific offset (common for all epochs)
    173       ll[ii]        = it->second;
     171      if (satIndex(clkSats, prn) != -1) {
     172        ++ii;
     173        int index = epochs.size() + satIndex(clkSats, prn);
     174        AA[ii][ie]    = 1.0; // epoch-specfic offset (common for all satellites)
     175        AA[ii][index] = 1.0; // satellite-specific offset (common for all epochs)
     176        ll[ii]        = it->second;
     177      }
    174178    }
    175179    SymmetricMatrix dN; dN << AA.t() * AA;
     
    196200    for (map<t_prn, double>::iterator it = dc.begin(); it != dc.end(); it++) {
    197201      const t_prn& prn = it->first;
    198       int  index = epochs.size() + satIndex(clkSats, prn);
    199       dc[prn]                      = it->second - xx[ie] - xx[index];
    200       stat[prn.toString()]._offset = xx[index];
     202      if (satIndex(clkSats, prn) != -1) {
     203        int  index = epochs.size() + satIndex(clkSats, prn);
     204        dc[prn]                      = it->second - xx[ie] - xx[index];
     205        stat[prn.toString()]._offset = xx[index];
     206      }
    201207    }
    202208  }
     
    256262  }
    257263
    258   set<t_prn> clkSats;
     264  set<t_prn> clkSatsAll;
    259265
    260266  for (unsigned ie = 0; ie < epochs.size(); ie++) {
     
    280286        XYZ_to_RSW(x1, vel, dx, dr[prn]);
    281287        if (epoch->_dc.find(prn) != epoch->_dc.end()) {
    282           clkSats.insert(prn);
     288          clkSatsAll.insert(prn);
    283289        }
    284290      }
     
    295301  // Estimate Clock Offsets
    296302  // ----------------------
    297   processClocks(clkSats, epochs, stat);
     303  string systems = "GR";
     304  for (unsigned iSys = 0; iSys < systems.size(); iSys++) {
     305    char system = systems[iSys];
     306    set<t_prn> clkSats;
     307    set<t_prn>::const_iterator it;
     308    for (it = clkSatsAll.begin(); it != clkSatsAll.end(); it++) {
     309      if (it->system() == system) {
     310        clkSats.insert(*it);
     311      }
     312    }
     313    processClocks(clkSats, epochs, stat);
     314  }
    298315
    299316  // Print Residuals
Note: See TracChangeset for help on using the changeset viewer.