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 SVVis::initialize(int argc, char *argv[]) throw() { CommandOptionWithAnyArg minElevOpt( '\0', "elevation-mask", "The elevation above which an SV is visible. The default is 0 degrees."), rxPosOpt( 'p', "position", "Receiver antenna position in ECEF (x,y,z) coordinates. Format as " "a string: \"X Y Z\"."), ephFileOpt( 'e', "eph", "Where to get the ephemeris data. Can be " + EphReader::formatsUnderstood() + ".", true), mscFileOpt( 'c', "msc", "Station coordinate file."), msidOpt( 'm', "msid", "Station number to use from the msc file."), graphElevOpt( '\0', "graph-elev", "Output data at the specified interval. Interval is in seconds."), timeSpanOpt( 'l', "time-span", "How much data to process, in seconds. Default is 86400."); CommandOptionWithTimeArg startTimeOpt( '\0', "start-time", "%4Y/%03j/%02H:%02M:%05.2f", "When to start computing positions. The default is the start of the " "ephemers data. (%4Y/%03j/%02H:%02M:%05.2f)"), stopTimeOpt( '\0', "stop-time", "%4Y/%03j/%02H:%02M:%05.2f", "When to stop computing positions. The default is one day after " "the start time"); CommandOptionNoArg printElevOpt( '\0', "print-elev", "Print the elevation of the sv at each change in tracking. " "The defaut is to just to output the PRN of the sv."); if (!BasicFramework::initialize(argc,argv)) return false; // get the minimum elevation if (minElevOpt.getCount()) minElev = StringUtils::asDouble((minElevOpt.getValue())[0]); else minElev = 0; // get the ephemeris source(s) ephReader.verboseLevel = verboseLevel; FFIdentifier::debugLevel = debugLevel; for (int i=0; i<ephFileOpt.getCount(); i++) ephReader.read(ephFileOpt.getValue()[i]); if (ephReader.eph == NULL) { cout << "Didn't get any ephemeris data from the eph files. " << "Exiting." << endl; exit(-1); } if (debugLevel) ephReader.eph->dump(cout, debugLevel-1); // get the antenna position bool haveRxPos = false; if (rxPosOpt.getCount()) { 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; haveRxPos = true; } else if (msidOpt.getCount() && mscFileOpt.getCount()) { long msid = StringUtils::asUnsigned(msidOpt.getValue()[0]); string fn = mscFileOpt.getValue()[0]; MSCStream mscs(fn.c_str(), ios::in); MSCData mscd; while (mscs >> mscd) { if (mscd.station == msid) { rxPos = mscd.coordinates; haveRxPos=true; break; } } if (!haveRxPos) cout << "Did not find station " << msid << " in " << fn << "." << endl; }