Class to detect, validate and remove millisecond clock adjusts from pseudorange and phase data and timetags. Caller passes all the data to the object, in time order, and the object detects where (in time and in observables) there are millisecond adjusts. Caller can then pass data to the object again and have it remove the appropriate adjusts from pseudorange, phase and/or timetags. NB. adjusts should be removed from pseudorange and timetags together. NB. most adjusted data has jumps in pseudorange, but not phase (violates RINEX!) although the opposite (found in phase, but not pseudorange) does exist (job3326). NB. some (Ashtech) usually also have jumps in the time tags; Trimble is variable.
Definition at line 66 of file msecHandler.hpp.
#include <msecHandler.hpp>
Public Member Functions | |
void | add (CommonTime ttag, const SatID sat, const std::string obstype, double data) |
int | afterAddbeforeFix () |
void | fix (CommonTime &ttag, const SatID sat, const std::string obstype, double &data) |
std::map< gnsstk::CommonTime, int > | getAdjusts () |
std::vector< std::string > | getEditCommands () |
get find message in the form of editing commands for EditRinex More... | |
std::string | getFindMessage (bool verbose=false) |
get messages generated during detection phase More... | |
std::string | getFixMessage (bool verbose=false) |
get messages generated during fixing phase More... | |
int | getNbadMS () |
get the number of invalid adjusts found More... | |
int | getNMS () |
get number of valid adjusts found More... | |
std::vector< std::string > | getObsTypes () |
Get the obstypes used in the detector. More... | |
msecHandler () | |
void | reset () |
Reset the object. More... | |
void | setDT (double dt_in) |
must set the nominal timestep before any add() or fix() More... | |
void | setObstypes (const std::vector< std::string > &ots, const std::vector< double > &waves) |
Private Member Functions | |
void | compute (const CommonTime ttag) |
Private Attributes | |
std::vector< std::string > | adjMsgs |
adjust summary (i/o) More... | |
std::vector< double > | ave |
average step per obstypes More... | |
std::vector< std::string > | badMsgs |
bad ones More... | |
std::vector< std::map< SatID, double > > | curr |
CommonTime | currttag |
for tracking timetags internally More... | |
bool | doPR |
if adjusts appear in pseudorange, fix time tags also More... | |
double | dt |
nominal time spacing More... | |
std::vector< std::string > | editCmds |
adjust editing cmds More... | |
std::string | findMsg |
std::string | fixMsg |
messages that are passed to caller More... | |
int | ims |
double | intercept |
int | N |
number of obstypes (6) More... | |
std::vector< int > | nms |
number of ms More... | |
std::vector< int > | npt |
number of data per obstypes More... | |
int | ntot |
internal bookkeeping on which adjust, total ms adjust More... | |
std::vector< std::string > | obstypes |
obstypes to monitor (L1 L2 C1 C2 P1 P2) More... | |
std::vector< std::vector< std::string > > | ots |
ots that jump More... | |
std::vector< std::map< SatID, double > > | past |
storing data internally More... | |
CommonTime | prevttag |
bool | rmvClk |
NB currently hardcoded false. More... | |
double | slope |
the piece-wise linear model More... | |
std::vector< CommonTime > | times |
time of adjust More... | |
CommonTime | tref |
reference time for the linear models More... | |
std::map< std::string, int > | typesMap |
[string "P1 C2 !L1 !L2"] = number of adj More... | |
std::vector< double > | wavelengths |
wavelengths of obstypes - 0 for code More... | |
Static Private Attributes | |
static const double | Rfact = 0.001 * C_MPS |
one ms in m,L1cyc,L2cyc More... | |
gnsstk::msecHandler::msecHandler | ( | ) |
empty and only constructor - note that setDT() must be called before processing
Definition at line 63 of file msecHandler.cpp.
void gnsstk::msecHandler::add | ( | CommonTime | ttag, |
const SatID | sat, | ||
const std::string | obstype, | ||
double | data | ||
) |
add data at one epoch. May be repeated at the same epoch, but MUST be done in time order. NB assumes, as in RINEX, that data==0 means it is missing.
ttag | time of the data |
sat | satellite of the data |
obstype | string observation type of the data (L1 L2 C1 C2 P1 P2) |
data | value of obstype for sat at ttag |
Definition at line 124 of file msecHandler.cpp.
int gnsstk::msecHandler::afterAddbeforeFix | ( | ) |
After all add() calls, and before calling fix()
Definition at line 170 of file msecHandler.cpp.
|
private |
compute average differences and detect adjusts. call after all input at one time is done, passing it the next timetag.
ttag | the next time |
Definition at line 356 of file msecHandler.cpp.
void gnsstk::msecHandler::fix | ( | CommonTime & | ttag, |
const SatID | sat, | ||
const std::string | obstype, | ||
double & | data | ||
) |
edit data by removing the millisecond adjusts, and optionally a piece-wise linear model of the adjusts. Must be called in time order, as add() was. NB may call repeatedly with the same ttag, however NB ttag gets fixed every call, so don't keep calling with same variable ttag.
ttag | time of the data |
sat | satellite of the data |
obstype | string observation type of the data (L1 L2 C1 C2 P1 P2) |
data | value of obstype for sat at ttag |
Definition at line 214 of file msecHandler.cpp.
map< CommonTime, int > gnsstk::msecHandler::getAdjusts | ( | ) |
get map<CommonTime,int> of valid adjusts; should parallel getFindMessage()
Definition at line 342 of file msecHandler.cpp.
|
inline |
get find message in the form of editing commands for EditRinex
Definition at line 172 of file msecHandler.hpp.
string gnsstk::msecHandler::getFindMessage | ( | bool | verbose = false | ) |
get messages generated during detection phase
Definition at line 287 of file msecHandler.cpp.
|
inline |
get messages generated during fixing phase
Definition at line 175 of file msecHandler.hpp.
|
inline |
get the number of invalid adjusts found
Definition at line 181 of file msecHandler.hpp.
|
inline |
get number of valid adjusts found
Definition at line 178 of file msecHandler.hpp.
|
inline |
Get the obstypes used in the detector.
Definition at line 135 of file msecHandler.hpp.
void gnsstk::msecHandler::reset | ( | ) |
Reset the object.
Definition at line 84 of file msecHandler.cpp.
|
inline |
must set the nominal timestep before any add() or fix()
Definition at line 142 of file msecHandler.hpp.
void gnsstk::msecHandler::setObstypes | ( | const std::vector< std::string > & | ots, |
const std::vector< double > & | waves | ||
) |
Re-define obstypes and wavelengths with parallel arrays. NB must set wavelength(code) = 0.
ots | vector<string> of obstypes to be passed to add() and fix(). |
waves | vector<double> wavelength of phases in ots or zero for codes. |
Definition at line 108 of file msecHandler.cpp.
|
private |
adjust summary (i/o)
Definition at line 97 of file msecHandler.hpp.
|
private |
average step per obstypes
Definition at line 81 of file msecHandler.hpp.
|
private |
bad ones
Definition at line 99 of file msecHandler.hpp.
|
private |
Definition at line 79 of file msecHandler.hpp.
|
private |
for tracking timetags internally
Definition at line 77 of file msecHandler.hpp.
|
private |
if adjusts appear in pseudorange, fix time tags also
Definition at line 102 of file msecHandler.hpp.
|
private |
nominal time spacing
Definition at line 70 of file msecHandler.hpp.
|
private |
adjust editing cmds
Definition at line 98 of file msecHandler.hpp.
|
private |
Definition at line 91 of file msecHandler.hpp.
|
private |
messages that are passed to caller
Definition at line 91 of file msecHandler.hpp.
|
private |
Definition at line 103 of file msecHandler.hpp.
|
private |
Definition at line 107 of file msecHandler.hpp.
|
private |
number of obstypes (6)
Definition at line 73 of file msecHandler.hpp.
|
private |
number of ms
Definition at line 95 of file msecHandler.hpp.
|
private |
number of data per obstypes
Definition at line 82 of file msecHandler.hpp.
|
private |
internal bookkeeping on which adjust, total ms adjust
Definition at line 103 of file msecHandler.hpp.
|
private |
obstypes to monitor (L1 L2 C1 C2 P1 P2)
Definition at line 75 of file msecHandler.hpp.
|
private |
ots that jump
Definition at line 96 of file msecHandler.hpp.
|
private |
storing data internally
Definition at line 80 of file msecHandler.hpp.
|
private |
Definition at line 77 of file msecHandler.hpp.
one ms in m,L1cyc,L2cyc
Definition at line 111 of file msecHandler.hpp.
|
private |
NB currently hardcoded false.
Definition at line 106 of file msecHandler.hpp.
|
private |
the piece-wise linear model
Definition at line 107 of file msecHandler.hpp.
|
private |
time of adjust
Definition at line 94 of file msecHandler.hpp.
|
private |
reference time for the linear models
Definition at line 108 of file msecHandler.hpp.
|
private |
[string "P1 C2 !L1 !L2"] = number of adj
Definition at line 88 of file msecHandler.hpp.
|
private |
wavelengths of obstypes - 0 for code
Definition at line 76 of file msecHandler.hpp.