void MPSim::process() { IonoModel spsIonoCorr; // Read nav file and store unique list of ephemeredes if (navOption.getCount()>0) { EphReader ephs; for (size_t i=0; i<navOption.getCount(); i++) { ephs.read(navOption.getValue()[i].c_str()); } logStream << "Read these input files for ephemeris or almanac: " << endl; for (size_t i=0; i<ephs.filesRead.size(); i++) logStream << " " << ephs.filesRead[i] << endl; } if (rateOption.getCount()>0) { outputRate = StringUtils::asFloat(rateOption.getValue().front()); } logStream << "Observation interval set to " << outputRate << " s" << endl; }
bool DOPCalc::initialize(int argc, char *argv[]) throw() { if (!BasicFramework::initialize(argc,argv)) return false; // if specified, get the elevation mask if (minElevOpt.getCount()) minElev = StringUtils::asDouble((minElevOpt.getValue())[0]); // set verbose level ephReader.verboseLevel = verboseLevel; // set debug level FFIdentifier::debugLevel = debugLevel; // read in ephemeris data for (int i=0; i<ephFileOpt.getCount(); i++) ephReader.read(ephFileOpt.getValue()[i]); // grab the station number (needed to process smooth data) if (msidOpt.getCount()) msid = StringUtils::asUnsigned(msidOpt.getValue()[0]); // read in observation data readObsFile(obsFileOpt, obsEpochMap); // get the antenna position (if RINEX was given, this will overwrite pos.) if (rxPosOpt.getCount()) { // get the position from the command line option double x,y,z; sscanf(rxPosOpt.getValue().front().c_str(),"%lf %lf %lf", &x, &y, &z); rxPos[0] = x; rxPos[1] = y; rxPos[2] = z; } else if (msidOpt.getCount() && mscFileOpt.getCount()) { // get the position from the MSC file string fn = mscFileOpt.getValue()[0]; MSCStream mscs(fn.c_str(), ios::in); MSCData mscd; while (mscs >> mscd) { if (mscd.station == msid) { rxPos = mscd.coordinates; if (debugLevel || verboseLevel) cout << "Read position from MSC file: " << fn << endl; break; } } }
bool MPSim::initialize(int argc, char *argv[]) throw() { if(!BasicFramework::initialize(argc, argv)) return false; if (logfileOption.getCount()>0) { logFileName = StringUtils::asString(logfileOption.getValue().front()); } logStream.open( logFileName.c_str() ); logStream << "mpsim log file" << endl; logStream << "Execution started at: " << startTime.printf(epochFormat) << endl; return true; }
bool EphDiff::initialize(int argc, char* argv[]) throw() { if(!BasicFramework::initialize(argc, argv)) { return false; } // check the command options for 2 input files int ficCount = ficFileOption.getCount(); int rinexCount = rinexFileOption.getCount(); if ( ((ficCount == 2) && (rinexCount != 0)) || ((ficCount == 1) && (rinexCount != 1)) || ((ficCount == 0) && (rinexCount != 2)) ) { cout << "Exactly two input files must be specified on the command line" << endl << " ephdiff is ending..." << endl << endl; return false; } // open the files // in the case of 1 FIC and 1 rinex file, make sure the first file // is chosen correctly... if ( (ficCount == 1) && (rinexCount == 1) ) { string ficname = ficFileOption.getValue()[0]; string rinexname = rinexFileOption.getValue()[0]; FileFilterFrame<FICStream, FICData> ficdata(ficname); FileFilterFrame<RinexNavStream, RinexNavData> rinexdata(rinexname); if (ficFileOption.getOrder() < rinexFileOption.getOrder()) { file1 = ficname; file2 = rinexname; fillFIC(ficdata, file1list); fillRINEX(rinexdata, file2list); } else { file1 = rinexname; file2 = ficname; fillRINEX(rinexdata, file1list); fillFIC(ficdata, file2list); } } else if (ficCount == 2) { file1 = ficFileOption.getValue()[0]; FileFilterFrame<FICStream, FICData> fic1(file1); file2 = ficFileOption.getValue()[1]; FileFilterFrame<FICStream, FICData> fic2(file2); fillFIC(fic1, file1list); fillFIC(fic2, file2list); } else // if (rinexCount == 2) { file1 = rinexFileOption.getValue()[0]; FileFilterFrame<RinexNavStream, RinexNavData> rn1(file1); file2 = rinexFileOption.getValue()[1]; FileFilterFrame<RinexNavStream, RinexNavData> rn2(file2); fillRINEX(rn1, file1list); fillRINEX(rn2, file2list); } return true; }
void TimCvt::process() { CommonTime ct; CommandOption *whichOpt = mutexOption.whichOne(); if (whichOpt) { CommandOptionWithCommonTimeArg *cta = dynamic_cast<CommandOptionWithCommonTimeArg *>(whichOpt); if (cta) { ct = cta->getTime().front(); } else // whichOpt == &inputFormatAndTimeOption { mixedScanTime( ct, inputTimeOption.getValue().front(), inputFormatOption.getValue().front() ); } } else { ct = SystemTime(); } int i; int addOptions = addOption.getCount(); int subOptions = subOption.getCount(); for (i = 0; i < addOptions; i++) ct += StringUtils::asDouble(addOption.getValue()[i]); for (i = 0; i < subOptions; i++) ct -= StringUtils::asDouble(subOption.getValue()[i]); if (formatOption.getCount()) { cout << printTime(ct, formatOption.getValue()[0]) << endl; } else { using StringUtils::leftJustify; string eight(8, ' '); // eight spaces GPSWeekZcount wz(ct); CivilTime civ(ct); cout << endl << eight << leftJustify("Month/Day/Year H:M:S", 32) << CivilTime(ct) << endl << eight << leftJustify("Modified Julian Date", 32) << setprecision(15) << MJD(ct) << endl << eight << leftJustify("GPSweek DayOfWeek SecOfWeek", 32) << GPSWeekSecond(ct).printf("%G %w % 13.6g") << endl << eight << leftJustify("FullGPSweek Zcount", 32) << wz.printf("%F % 6z") << endl << eight << leftJustify("Year DayOfYear SecondOfDay", 32) << YDSTime(ct).printf("%Y %03j % 12.6s") << endl << eight << leftJustify("Unix: Second Microsecond", 32) << UnixTime(ct).printf("%U % 6u") << endl << eight << leftJustify("Zcount: 29-bit (32-bit)", 32) << wz.printf("%c (%C)") << endl << endl << endl; } return; }