void RinexClockData::reallyGetRecord(FFStream& ffs) throw(exception, FFStreamError, StringException) { // cast the stream to be an RinexClockStream RinexClockStream& strm = dynamic_cast<RinexClockStream&>(ffs); clear(); string line; strm.formattedGetLine(line,true); // true means 'expect possible EOF' stripTrailing(line); if(line.length() < 59) { FFStreamError e("Short line : " + line); GPSTK_THROW(e); } //cout << "Data Line: /" << line << "/" << endl; datatype = line.substr(0,2); site = line.substr(3,4); if(datatype == string("AS")) { strip(site); int prn(asInt(site.substr(1,2))); if(site[0] == 'G') sat = RinexSatID(prn,RinexSatID::systemGPS); else if(site[0] == 'R') sat = RinexSatID(prn,RinexSatID::systemGlonass); else { FFStreamError e("Invalid sat : /" + site + "/"); GPSTK_THROW(e); } site = string(); } time = CivilTime(asInt(line.substr( 8,4)), asInt(line.substr(12,3)), asInt(line.substr(15,3)), asInt(line.substr(18,3)), asInt(line.substr(21,3)), asDouble(line.substr(24,10)), TimeSystem::Any); int n(asInt(line.substr(34,3))); bias = asDouble(line.substr(40,19)); if(n > 1 && line.length() >= 59) sig_bias = asDouble(line.substr(60,19)); if(n > 2) { strm.formattedGetLine(line,true); stripTrailing(line); if(int(line.length()) < (n-2)*20-1) { FFStreamError e("Short line : " + line); GPSTK_THROW(e); } drift = asDouble(line.substr( 0,19)); if(n > 3) sig_drift = asDouble(line.substr(20,19)); if(n > 4) accel = asDouble(line.substr(40,19)); if(n > 5) sig_accel = asDouble(line.substr(60,19)); } } // end reallyGetRecord()
// This constructor initializes R3NavData with Glonass data. Rinex3NavData::Rinex3NavData(const GloEphemeris& gloe) { // Epoch info satSys = gloe.getSatSys(); PRNID = gloe.getPRNID(); sat = RinexSatID(PRNID,SatID::systemGlonass); time = gloe.getEpochTime(); // GLONASS parameters TauN = gloe.getTauN(); GammaN = gloe.getGammaN(); MFtime = gloe.getMFtime(); health = gloe.getHealth(); freqNum = gloe.getfreqNum(); ageOfInfo = gloe.getAgeOfInfo(); Triple x( gloe.x ); px = x[0]; py = x[1]; pz = x[2]; Triple v( gloe.v ); vx = v[0]; vy = v[1]; vz = v[2]; Triple a( gloe.getAcc() ); ax = a[0]; ay = a[1]; az = a[2]; } // End of 'Rinex3NavData::Rinex3NavData(const GloEphemeris& ge)'
// Private helper routine for constructors from OrbitEph-based Ephemerides void Rinex3NavData::loadFrom(const OrbitEph *oeptr) { time = oeptr->ctToc; sat = RinexSatID(oeptr->satID); satSys = string(1,sat.systemChar()); PRNID = sat.id; //Toc = static_cast<GPSWeekSecond>(oeptr->ctToe).getSOW(); af0 = oeptr->af0; af1 = oeptr->af1; af2 = oeptr->af2; //Toe = static_cast<GPSWeekSecond(oeptr->ctToe).getSOW(); M0 = oeptr->M0; dn = oeptr->dn; ecc = oeptr->ecc; Ahalf = SQRT(oeptr->A); OMEGA0 = oeptr->OMEGA0; i0 = oeptr->i0; w = oeptr->w; OMEGAdot = oeptr->OMEGAdot; idot = oeptr->idot; Cuc = oeptr->Cuc; Cus = oeptr->Cus; Crc = oeptr->Crc; Crs = oeptr->Crs; Cic = oeptr->Cic; Cis = oeptr->Cis; }
void clear(void) throw() { datatype = std::string(); sat = RinexSatID(-1,RinexSatID::systemGPS); time = CommonTime::BEGINNING_OF_TIME; bias = sig_bias = drift = sig_drift = accel = sig_accel = 0.0; }
// Deprecated; used GPSEphemeris. // This routine uses EngEphemeris, so is for GPS data only. // The comments about GPS v. Galileo next to each elements are just notes // from sorting out the ICDs in the RINEX 3 documentation. Please leave // them there until we add a routine for handling GalRecord or similar. Rinex3NavData::Rinex3NavData(const EngEphemeris& ee) // GPS only { // epoch info satSys = ee.getSatSys(); PRNID = ee.getPRNID(); sat = RinexSatID(PRNID,SatID::systemGPS); time = ee.getEpochTime(); Toc = ee.getToc(); HOWtime = long(ee.getHOWTime(1)); weeknum = ee.getFullWeek(); accuracy = ee.getAccuracy(); health = ee.getHealth(); // GPS or Galileo data af0 = ee.getAf0(); // GPS and Galileo only af1 = ee.getAf1(); // GPS and Galileo only af2 = ee.getAf2(); // GPS and Galileo only Crs = ee.getCrs(); // GPS and Galileo only dn = ee.getDn(); // GPS and Galileo only M0 = ee.getM0(); // GPS and Galileo only Cuc = ee.getCuc(); // GPS and Galileo only ecc = ee.getEcc(); // GPS and Galileo only Cus = ee.getCus(); // GPS and Galileo only Ahalf = ee.getAhalf(); // GPS and Galileo only Toe = ee.getToe(); // GPS and Galileo only Cic = ee.getCic(); // GPS and Galileo only OMEGA0 = ee.getOmega0(); // GPS and Galileo only Cis = ee.getCis(); // GPS and Galileo only i0 = ee.getI0(); // GPS and Galileo only Crc = ee.getCrc(); // GPS and Galileo only w = ee.getW(); // GPS and Galileo only OMEGAdot = ee.getOmegaDot(); // GPS and Galileo only idot = ee.getIDot(); // GPS and Galileo only // GPS-only data IODE = ee.getIODE(); // GPS only codeflgs = ee.getCodeFlags(); // GPS only L2Pdata = ee.getL2Pdata(); // GPS only Tgd = ee.getTgd(); // GPS only IODC = ee.getIODC(); // GPS only fitint = ee.getFitInterval(); // GPS only } // End of 'Rinex3NavData::Rinex3NavData(const EngEphemeris& ee)'
// Initializes the nav data with a QZSEphemeris Rinex3NavData::Rinex3NavData(const QZSEphemeris& qzseph) { loadFrom(dynamic_cast<const OrbitEph*>(&qzseph)); Toc = static_cast<QZSWeekSecond>(qzseph.ctToc).getSOW(); Toe = static_cast<QZSWeekSecond>(qzseph.ctToe).getSOW(); HOWtime = qzseph.HOWtime; weeknum = static_cast<QZSWeekSecond>(qzseph.transmitTime).getWeek(); PRNID -= 192; // RINEX stores PRN minus 192 sat = RinexSatID(PRNID,SatID::systemQZSS); IODC = qzseph.IODC; IODE = qzseph.IODE; health = qzseph.health; accuracy = qzseph.accuracy; Tgd = qzseph.Tgd; codeflgs = qzseph.codeflags; L2Pdata = qzseph.L2Pdata; fitint = qzseph.fitint; }
/// clear out the member data void clear(void) { version = 3.0; program = std::string(); runby = std::string(); dataTypes.clear(); leapSeconds = 0; analysisCenter = std::string(); terrRefFrame = std::string(); timeSystem = TimeSystem::Any; pcvsSystem = RinexSatID(-1, RinexSatID::systemGPS); pcvsProgram = std::string(); pcvsSource = std::string(); numSolnStations = 0; stationID.clear(); stationX.clear(); stationY.clear(); stationZ.clear(); numSolnSatellites = 0; satList.clear(); commentList.clear(); valid = 0; }
RinexSatID(const SatID& sat) throw() { *this = RinexSatID(sat.id,sat.system); }
/* A debugging function that outputs in human readable form, * all data stored in this object. * * @param[in] s The stream to receive the output; defaults to cout * @param[in] detail The level of detail to provide * * @warning GLONASS position, velocity and acceleration information are * given in km, km/s and km/(s*s), respectively. */ void GloEphemerisStore::dump( std::ostream& s, short detail ) const { static const string fmt("%04Y/%02m/%02d %02H:%02M:%02S %P"); s << "Dump of GloEphemerisStore:\n"; //if(detail == 0 ) { s << " Span is " << (initialTime == CommonTime::END_OF_TIME ? "End_time" : printTime(initialTime, fmt)) << " to " << (finalTime == CommonTime::BEGINNING_OF_TIME ? "Begin_time" : printTime(finalTime, fmt)) << " with " << pe.size() << " entries; checkHealthFlag is " << (onlyHealthy ? "T":"F") << std::endl; //} //else if(detail > 0) { if(pe.size()) s << "Dump every record:\nweek sow = year/mn/dy hr:mi:sc Sys Sat " << "X Y Z " << "VX VY VZ " << "AX AY AZ " << "TauN GammaN MFtime Hlth fNo AgeInfo\n"; // Iterate through all items in the 'pe' GloEphMap for( GloEphMap::const_iterator it = pe.begin(); it != pe.end(); ++it ) { // Then, iterate through corresponding 'TimeGloMap' for( TimeGloMap::const_iterator tgmIter = (*it).second.begin(); tgmIter != (*it).second.end(); ++tgmIter ) { // First, print year, Day-Of-Year and Seconds of Day s << printTime(tgmIter->first,fmt) << " "; // Second, print SatID information s << RinexSatID((*it).first) << " "; // Third, print satellite ephemeris data GloEphemeris data( (*tgmIter).second ); // Get the satellite's acceleration Triple a( data.getAcc() ); s << scientific << setprecision(12); s << setw(19) << data.x[0] << " " << setw(19) << data.x[1] << " " << setw(19) << data.x[2] << " " << setw(19) << data.v[0] << " " << setw(19) << data.v[1] << " " << setw(19) << data.v[2] << " " << setw(19) << a[0] << " " << setw(19) << a[1] << " " << setw(19) << a[2] << " " << setw(19) << data.getTauN() << " " << setw(19) << data.getGammaN() << " " << setw(6) << data.getMFtime() << " " << setw(3) << data.getHealth() << " " << setw(3) << data.getfreqNum() << " " << setprecision(2) << setw(5) << data.getAgeOfInfo(); // Add end-of-line s << endl; } // End of 'for( TimeGloMap::const_iterator tgmIter = ...' } // End of 'for( GloEphMap::const_iterator it = pe.begin(); ...' } // End of 'else', i.e., detail != 0 s << " End of GloEphemerisStore data." << std::endl; }; // End of method 'GloEphemerisStore::dump()'