Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.

Commit

Permalink
Merge branch 'Rinex_Fixes_Tolman' into 'master'
Browse files Browse the repository at this point in the history
RinDump and RinEdit bug fixes, submitted by Brian Tolman.

2-3 important bugs fixed with 1-line fixes.

See merge request !83
  • Loading branch information
Bryan Parsons committed May 20, 2016
2 parents 6f0d72a + eea3c2a commit 82bd2d4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
5 changes: 3 additions & 2 deletions core/apps/Rinextools/RinDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ try {
vector<string> resets; // check for reset of bias on any lc
for(i=0; i<C.Combos.size(); i++) {
C.Combos[i].Compute(sat, Rhead, vrdata); // member value
if(C.Combos[i].removeBias(sat))
if(C.Combos[i].value && C.Combos[i].removeBias(sat))
resets.push_back(C.Combos[i].label);
oss << " " << setw(width) << C.Combos[i].value;
if(C.Combos[i].value != 0.0) ok=true;
Expand Down Expand Up @@ -2302,7 +2302,8 @@ double LinCom::Compute(const RinexSatID sat, Rinex3ObsHeader& Rhead,
data = vrdata[j].data;
if(data == 0.0) {
LOG(DEBUG2) << msg << " obs >" << oi << "< data is zero";
continue; // data is missing
value = 0.0; return value;
//continue; // data is missing
}

obsid = oi;
Expand Down
29 changes: 20 additions & 9 deletions ext/apps/Rinextools/RinEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,18 @@ int processFiles(void) throw(Exception)
LOG(DEBUG) << "Input header for RINEX file " << filename;
Rhead.dump(LOGstrm);
}
// dump the obs types
map<string,vector<RinexObsID> >::const_iterator kt;
for(kt = Rhead.mapObsTypes.begin(); kt != Rhead.mapObsTypes.end(); kt++) {
sat.fromString(kt->first);
oss.str("");
oss << "# Header ObsIDs " << sat.systemString3() //<< " " << kt->first
<< " (" << kt->second.size() << "):";
for(i=0; i<kt->second.size(); i++) oss << " " << kt->second[i].asString();
LOG(INFO) << oss.str();
}

// we have to set the time system of all the timetags using ttag from file !!
// we have to set the time system of all the timetags using ttag from file
vector<EditCmd>::iterator jt;
for(jt=C.vecCmds.begin(); jt != C.vecCmds.end(); ++jt)
jt->ttag.setTimeSystem(Rhead.firstObs.getTimeSystem());
Expand Down Expand Up @@ -651,24 +661,23 @@ int processOneEpoch(Rinex3ObsHeader& Rhead, Rinex3ObsHeader& RHout,
// for cmds with ttag <= now either execute and delete, or move to current
it = C.vecCmds.begin();
while(it != C.vecCmds.end()) {
LOG(DEBUG) << "Process vec cmd " << it->asString();
if(it->ttag <= now || ::fabs(it->ttag - now) < C.timetol) {
LOG(DEBUG) << "Execute vec cmd " << it->asString();
// delete one-time cmds, move others to curr and delete
iret = executeEditCmd(it, RHout, RDout);
if(iret < 0) return iret; // fatal error

// keep this command on the current list
if(iret > 0) toCurr.push_back(*it); // C.currCmds.push_back(*it);

// if this is a '-' cmd to be deleted, find matching '+' and delete it
// if this is a '-' cmd to be deleted, find matching '+' and delete
// note fixEditCmdList() forced every - to have a corresponding +
if(iret == 0 && it->sign == -1) {
for(jt = C.currCmds.begin(); jt != C.currCmds.end(); ++jt)
if(jt->type==it->type && jt->sat==it->sat && jt->obs==it->obs)
break;
if(jt == C.currCmds.end())
GPSTK_THROW(Exception(string(
"Execute failed to find + cmd matching ") + it->asString()));
if(jt == C.currCmds.end()) GPSTK_THROW(Exception(
string("Execute failed to find + cmd matching ")+it->asString()));
C.currCmds.erase(jt);
}

Expand Down Expand Up @@ -883,8 +892,9 @@ int executeEditCmd(const vector<EditCmd>::iterator& it, Rinex3ObsHeader& Rhead,
Rdata.obs[sats[j]][i].lli = it->idata;
break;
// BD bias data -------------------------------------------------------
case EditCmd::bdCT:
Rdata.obs[sats[j]][i].data += it->data;
case EditCmd::bdCT: // do not bias
if(Rdata.obs[sats[j]][i].data != 0.0 || C.messBZ)
Rdata.obs[sats[j]][i].data += it->data;
break;
// BS bias SSI --------------------------------------------------------
case EditCmd::bsCT:
Expand Down Expand Up @@ -1462,9 +1472,10 @@ void fixEditCmdList(void) throw()
if(jt->sign == 1) havePair=true; // its a match
else if(jt->sign == -1) { // this is an error
LOG(ERROR) << it->asString("Error: repeat '-'");
//LOG(ERROR) << jt->asString("Error: ref here ");
it->type = EditCmd::invalidCT;
break;
}
break;
}
if(jt == C.vecCmds.begin()) break;
--jt;
Expand Down

0 comments on commit 82bd2d4

Please sign in to comment.