本文整理汇总了C++中EngEphemeris类的典型用法代码示例。如果您正苦于以下问题:C++ EngEphemeris类的具体用法?C++ EngEphemeris怎么用?C++ EngEphemeris使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EngEphemeris类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: throw
/* Method to really get the weight of a given satellite.
*
* @param sat Satellite
* @param time Epoch
* @param bcEph Broadcast EphemerisStore object to be used
*/
double ComputeIURAWeights::getWeight( const SatID& sat,
const DayTime& time,
const GPSEphemerisStore* bcEph )
throw(InvalidWeights)
{
// Set by default a very big value
int iura(1000000);
double sigma(1000000.0);
EngEphemeris engEph;
try
{
// Look if this satellite is present in ephemeris
engEph = bcEph->findEphemeris(sat, time);
// If so, get the IURA
iura = engEph.getAccFlag();
}
catch(...)
{
InvalidWeights eWeight("Satellite not found.");
GPSTK_THROW(eWeight);
}
// Compute and return the weight
sigma = gpstk::ura2nominalAccuracy(iura);
return ( 1.0 / (sigma*sigma) );
} // End of method 'ComputeIURAWeights::getWeight()'
示例2: operator
bool operator() (const EngEphemeris& l, const EngEphemeris& r) const
{
if ( (l.getPRNID() == r.getPRNID()) &&
(l.getIODC() == r.getIODC()) )
return true;
return false;
}
示例3: main
int main(int argc, char* argv[])
{
// Set time to Day 153, 2011 (6/2/2011) at noon
CivilTime g( 2011, 6, 2, 12, 14, 44.0, TimeSystem::GPS );
CommonTime dt = g.convertToCommonTime();
short weeknum = 1638; // By rules of Kepler Orbit, this must be week of Toe
// Test data from 06/02/2011
long subframe1[10] = { 0x22C2663D, 0x1F0E29B8, 0x2664002B, 0x09FCC1B6, 0x0F60EB8A,
0x1299CE93, 0x29CD3DB6, 0x0597BB0F, 0x00000B68, 0x17B28E5C };
long subframe2[10] = { 0x22C2663D, 0x1F0E4A28, 0x05809675, 0x0EBD8AF1, 0x00089344,
0x008081F8, 0x1330CC2C, 0x0461E855, 0x034F8045, 0x17BB1E68 };
long subframe3[10] = { 0x22C2663D, 0x1F0E6BA0, 0x3FE129CD, 0x26E31837, 0x0006C96A,
0x35A74DFC, 0x065C8B0F, 0x1E4F400A, 0x3FE8966D, 0x05860C44 };
//The dump from ee.dump() and ee_copy.dump() should be the same
// an EngEphemeris object is created, then used to create a Rinex3NavData
EngEphemeris ee;
ee.addSubframe(subframe1, weeknum, 3, 1);
ee.addSubframe(subframe2, weeknum, 3, 1);
ee.addSubframe(subframe3, weeknum, 3, 1);
ee.dump();
Rinex3NavData rnd = Rinex3NavData(ee); //constructor
EngEphemeris ee_copy;
ee_copy = EngEphemeris(rnd); //cast
ee_copy.dump();
}
示例4: makeEngEphemeris
// Try to convert the given pages into an EngEphemeris object. Returns true
// upon success.
bool makeEngEphemeris(EngEphemeris& eph, const EphemerisPages& pages)
{
EphemerisPages::const_iterator sf[4];
sf[1] = pages.find(1);
if (sf[1] == pages.end())
return false;
sf[2] = pages.find(2);
if (sf[2] == pages.end())
return false;
sf[3] = pages.find(3);
if (sf[3] == pages.end())
return false;
long t1 = sf[1]->second.getHOWTime();
long t2 = sf[2]->second.getHOWTime();
long t3 = sf[3]->second.getHOWTime();
if (t2 != t1+6 || t3 != t1+12)
return false;
int prn = sf[1]->second.prn;
int week = sf[1]->second.time.GPSfullweek();
long sfa[10];
long long_sfa[10];
for (int i=1; i<=3; i++)
{
sf[i]->second.fillArray(sfa);
for( int j = 0; j < 10; j++ )
long_sfa[j] = static_cast<long>( sfa[j] );
if (!eph.addSubframe(long_sfa, week, prn, 0))
return false;
}
if (eph.isData(1) && eph.isData(2) && eph.isData(3))
return true;
return false;
}
示例5: processSubframes1to3
void processSubframes1to3(MDPNavSubframe& nav)
{
// For now, just look at L1 C/A navigation message
if (nav.range != rcCA || nav.carrier != ccL1)
return;
NavIndex ni(RangeCarrierPair(nav.range, nav.carrier), nav.prn);
ephData[ni] = nav;
long sfa[10];
nav.fillArray(sfa);
uint32_t uint_sfa[10];
for( int j = 0; j < 10; j++ )
uint_sfa[j] = static_cast<uint32_t>( sfa[j] );
numSubframesCollected++;
if (gpstk::EngNav::checkParity(uint_sfa))
{
paritySuccessCount++;
ephPageStore[ni][nav.getSFID()] = nav;
EngEphemeris engEph;
if (makeEngEphemeris(engEph, ephPageStore[ni]))
{
currentPRN = engEph.getPRNID(); // debug
if (firstNavSF)
{
earliestTime = engEph.getTransmitTime();
firstNavSF = false;
}
latestTime = engEph.getTransmitTime();
processEphemeris( engEph, ephPageStore[ni] );
}
}
else parityFailCount++;
} // end of process(MDPNavSubframe)
示例6: EngEphemeris
RinexNavData::operator EngEphemeris() const throw()
{
EngEphemeris ee;
// there's no TLM word in RinexNavData, so it's set to 0.
// likewise, there's no AS alert or tracker.
// Also, in Rinex, the accuracy is in meters, and setSF1 expects
// the accuracy flag. We'll give it zero and pass the accuracy
// separately via the setAccuracy() method.
ee.setSF1(0, HOWtime, 0, weeknum, codeflgs, 0, health,
short(IODC), L2Pdata, Tgd, Toc, af2, af1, af0, 0, PRNID);
ee.setSF2(0, HOWtime, 0, short(IODE), Crs, dn, M0, Cuc, ecc, Cus, Ahalf,
Toe, (fitint > 4) ? 1 : 0);
ee.setSF3(0, HOWtime, 0, Cic, OMEGA0, Cis, i0, Crc, w, OMEGAdot,
idot);
ee.setFIC(false);
ee.setAccuracy(accuracy);
return ee;
}
示例7: g
void xBrcClockCorrectiongpsNavMsg::firstTest(void)
{
// Set time to Day 153, 2011 (6/2/2011) at noon
CivilTime g( 2011, 6, 2, 12, 14, 44.0, TimeSystem::GPS );
CommonTime dt = g.convertToCommonTime();
// Test data (copied from navdmp output for .....)
// Generally, we'd load these data from the file
std::string SysID = "G";
ObsID obsID( ObsID::otUndefined, ObsID::cbL1, ObsID::tcCA );
short PRNID = 3;
double Toc = 388800.0;
double Top = 345600.0;
short weeknum = 1638; // By rules of Clock Correction, this must be week of Toc
short URAoc = 5;
short URAoc1 = 7;
short URAoc2 = 7;
bool healthy = true;
double af0 = 7.23189674E-04;
double af1 = 5.11590770E-12;
double af2 = 0.00000000E+00;
CommonTime TocCT = GPSWeekSecond(weeknum, Toc, TimeSystem::GPS);
CommonTime TopCT = GPSWeekSecond(weeknum, Top, TimeSystem::GPS);
// Test Data copied from RINEX file
double rToc = 388800.0;
double rTop = 345600.0;
short rweeknum = 1638; // By rules of Clock Corection, this must be week of Toc
short rURAoc = 5;
short rURAoc1 = 7;
short rURAoc2 = 7;
bool rhealthy = true;
double raf0 = 7.23189674318E-04;
double raf1 = 5.11590769747E-12;
double raf2 = 0.00000000000E+00;
CommonTime rTocCT = GPSWeekSecond(rweeknum, rToc, TimeSystem::GPS);
CommonTime rTopCT = GPSWeekSecond(rweeknum, rTop, TimeSystem::GPS);
long subframe1[10] = { 0x22C2663D, 0x1F0E29B8, 0x2664002B, 0x09FCC1B6, 0x0F60EB8A,
0x1299CE93, 0x29CD3DB6, 0x0597BB0F, 0x00000B68, 0x17B28E5C };
long subframe2[10] = { 0x22C2663D, 0x1F0E4A28, 0x05809675, 0x0EBD8AF1, 0x00089344,
0x008081F8, 0x1330CC2C, 0x0461E855, 0x034F8045, 0x17BB1E68 };
long subframe3[10] = { 0x22C2663D, 0x1F0E6BA0, 0x3FE129CD, 0x26E31837, 0x0006C96A,
0x35A74DFC, 0x065C8B0F, 0x1E4F400A, 0x3FE8966D, 0x05860C44 };
ofstream outf("Logs/BrcClkCorr_Output", ios::out);
// First test case. Create an empty CC object, then load the data.
outf << "Test Case 1: Creating an empty CC object and loading the data." << endl;
BrcClockCorrection co1;
co1.loadData( SysID, obsID, PRNID, TocCT, TopCT, URAoc, URAoc1, URAoc2, healthy,
af0, af1, af2 );
double ClkCorr1 = co1.svClockBias( dt );
outf.precision(11);
outf << "Clock Correction co1: " << ClkCorr1 << endl << endl;
// Second test case. Create an CC object with data available at time of construction.
outf << "Test Case 2: Creating CC object with data." << endl;
BrcClockCorrection co2( SysID, obsID, PRNID, TocCT, TopCT, URAoc, URAoc1, URAoc2, healthy,
af0, af1, af2 );
double ClkCorr2 = co2.svClockBias( dt );
outf << "ClockCorrection co2: " << ClkCorr2 << endl << endl;
// Third test case. Create a CC object using raw legacy navigation message data
outf << "Test Case 3: Creating CC object with raw legacy nav message data." << endl;
BrcClockCorrection co3(obsID, PRNID, weeknum, subframe1 );
double ClkCorr3 = co3.svClockBias( dt );
outf << "Clock Correction co3: " << ClkCorr3 << endl << endl;
// Fourth test case. Create a CC object using raw legacy navigation message data
outf << "Test Case 4: Creating CC object with raw legacy nav message data." << endl;
BrcClockCorrection co4;
co4.loadData(obsID, PRNID, weeknum, subframe1 );
double ClkCorr4 = co4.svClockBias( dt );
outf << "Clock Correction co4: " << ClkCorr4 << endl << endl;
// Fifth test case. Create an CC object with data available from RINEX file.
outf << "Test Case 5: Creating CC object with data from RINEX file." << endl;
BrcClockCorrection co5( SysID, obsID, PRNID, rTocCT, TopCT, URAoc, URAoc1, URAoc2, rhealthy,
raf0, raf1, raf2 );
double ClkCorr5 = co5.svClockBias( dt );
outf << "Clock Correction co5: " << ClkCorr5 << endl << endl;
// Sixth test case. Compare against "classic" EngEphemeris
outf << "Test Case 6: Calculated clock correction using 'classic' EngEphemeris." << endl;
outf<< "Time= "<< g << endl;
EngEphemeris EE;
EE.addSubframe(subframe1, weeknum, 3, 1);
EE.addSubframe(subframe2, weeknum, 3, 1);
EE.addSubframe(subframe3, weeknum, 3, 1);
Xvt xvt = EE.svXvt(dt);
outf << "Clock Bias EE: " << xvt.clkbias << endl;
outf << "Clock Drift EE: " << xvt.clkdrift << endl;
//.........这里部分代码省略.........
示例8: EphDiffFinder
EphDiffFinder(const EngEphemeris& e)
: PRN(e.getPRNID()), IODC(e.getIODC())
{}
示例9: g
//.........这里部分代码省略.........
// Set time to Day 156, 2011 (6/5/2011) at midnight
CivilTime ct3( 2011, 6, 5, 0, 0, 0.0, TimeSystem::GPS );
CommonTime dt3 = ct2.convertToCommonTime();
// Test data (copied from navdmp output for PRN 9 Day 155, 2011 at 22:00:00 Transmit Time)
// Generally, we'd load these data from the file
short PRNID3 = 9;
double Toc3 = 0.0;
short TOWWeek3 = 1638; // By rules of Clock Corection, this must be week of Toc
double accuracy3 = 10.61;
long TOWMsg_3 = 597600;
long Top3 = 594000;
double af0_3 = 8.43554735E-05;
double af1_3 = 2.38742359E-12;
double af2_3 = 0.0;
short health3 = 0;
long TOW3 = 597600;
short URAoc_3 = 1;
short URAoc1_3 = 2;
short URAoc2_3 = 3;
long subframe1[10] = { 0x22C2663D, 0x1F0E29B8, 0x2664002B, 0x09FCC1B6, 0x0F60EB8A,
0x1299CE93, 0x29CD3DB6, 0x0597BB0F, 0x00000B68, 0x17B28E5C };
long subframe2[10] = { 0x22C2663D, 0x1F0E4A28, 0x05809675, 0x0EBD8AF1, 0x00089344,
0x008081F8, 0x1330CC2C, 0x0461E855, 0x034F8045, 0x17BB1E68 };
long subframe3[10] = { 0x22C2663D, 0x1F0E6BA0, 0x3FE129CD, 0x26E31837, 0x0006C96A,
0x35A74DFC, 0x065C8B0F, 0x1E4F400A, 0x3FE8966D, 0x05860C44 };
ofstream outf("Logs/CNAVClock_Output", ios::out);
outf.precision(11);
// First test case. Create an CC object with data available from RINEX file.
outf << endl << "Test Case 1: Creating CC object with data from RINEX file." << endl;
outf << "Time = " << g << endl;
CNAVClock cc1;
cc1.loadData( SysID, obsID, PRNID, AlertMsg, TOWMsg_1, rTOWWeek, Top,
rToc, raccuracy, URAoc_1, URAoc1_1, URAoc2_1, raf0, raf1, raf2 );
double ClkCorr1 = cc1.svClockBias( dt );
double ClkDrift1 = cc1.svClockDrift( dt );
outf << "Clock Bias cc1: " << ClkCorr1 << endl;
outf << "Clock Drift cc1: " << ClkDrift1 << endl;
outf << "Time of Prediction cc1: " << GPSWeekSecond(cc1.getTimeOfPrediction()).printf("%F, %g") << endl;
outf << "CNAV Accuracy Test: " << SV_CNAV_ACCURACY_GPS_MAX_INDEX[URAoc_1+15] << endl;
outf << "legacy Accuracy Test: " << SV_ACCURACY_GPS_MAX_INDEX[URAoc_1] << endl;
// Second test case. Create an CC object with data available from navdump.
outf << endl << "Test Case 2: Creating CC object with data from navdump." << endl;
outf << "Time = " << ct2 << endl;
CNAVClock cc2;
cc2.loadData( SysID, obsID2, PRNID2, AlertMsg2, TOWMsg_2, TOWWeek2, Top2,
Toc2, accuracy2, URAoc_2, URAoc1_2, URAoc2_2, af0_2, af1_2, af2_2 );
double ClkCorr2 = cc2.svClockBias( dt2 );
double ClkDrift2 = cc2.svClockDrift( dt2 );
outf << "Clock Bias cc2: " << ClkCorr2 << endl;
outf << "Clock Drift cc2: " << ClkDrift2 << endl;
outf << "Time of Prediction cc2: " << GPSWeekSecond(cc2.getTimeOfPrediction()).printf("%F, %g") << endl;
// Third test case. Create an CC object with data available from navdump.
outf << endl << "Test Case 3: Creating CC object with data from navdump." << endl;
outf << "Time = " << ct3 << endl;
CNAVClock cc3;
cc3.loadData( SysID, obsID, PRNID3, AlertMsg, TOWMsg_3, TOWWeek3, Top3,
Toc3, accuracy3, URAoc_3, URAoc1_3, URAoc2_3, af0_3, af1_3, af2_3 );
double ClkCorr3 = cc3.svClockBias( dt3 );
double ClkDrift3 = cc3.svClockDrift( dt3 );
outf << "Clock Bias cc3: " << ClkCorr3 << endl;
outf << "Clock Drift cc3: " << ClkDrift3 << endl;
outf << "Time of Prediction cc3: " << GPSWeekSecond(cc3.getTimeOfPrediction()).printf("%F, %g") << endl;
// Fourth test case. Compare against "classic" EngEphemeris
outf << endl << "Test Case 4: Calculated position using 'classic' EngEphemeris." << endl;
outf<< "Time= "<< g << endl;
EngEphemeris EE;
EE.addSubframe(subframe1, TOWWeek, 3, 1);
EE.addSubframe(subframe2, TOWWeek, 3, 1);
EE.addSubframe(subframe3, TOWWeek, 3, 1);
Xvt xvt = EE.svXvt(dt);
outf<< "Clock Bias EE: " << xvt.clkbias << endl;
outf<< "Clocl Drift EE: " << xvt.clkdrift << endl;
outf << endl;
outf << "CC1 Object Dump:" << endl;
outf << cc1 << endl;
outf << endl;
outf << "CC2 Object Dump:" << endl;
outf << cc2 << endl;
outf << endl;
outf << "CC3 Object Dump:" << endl;
outf << cc3 << endl;
CPPUNIT_ASSERT(fileEqualTest((char*)"Logs/CNAVClock_Truth",(char*)"Logs/CNAVClock_Output"));
}
示例10: ConvertEEtoAO
AlmOrbit ConvertEEtoAO(EngEphemeris& ee)
{
AlmOrbit ao(
ee.getPRNID() , ee.getEcc() , ee.getI0()-0.3*PI, ee.getOmegaDot() ,
ee.getAhalf() , ee.getOmega0(), ee.getW() , ee.getM0() ,
ee.getAf0() , ee.getAf1() , long(ee.getToe()), long(ee.getHOWTime(1)),
ee.getFullWeek(), ee.getHealth()
);
return ao;
}
示例11: input
void MinSfTest::process()
{
if (debugLevel)
cout << "Setting up input file: "
<< inputOption.getValue().front() << endl;
FileFilterFrame<FICStream, FICData>
input(inputOption.getValue().front());
printf(" input.getDataCount() after init: %d\n", input.getDataCount());
if(debugLevel)
cout << "Setting up output file: "
<< outputOption.getValue().front() << endl;
fp.open( outputOption.getValue().front().c_str() );
if ( !fp.is_open() )
{
printf(" Failed to open output file.\n");
exit(1);
}
// filter the FIC data for the requested vlock(s)
std::list<long> blockList;
blockList.push_back(109);
input.filter(FICDataFilterBlock(blockList));
input.sort(FICDataOperatorLessThanBlock109());
input.unique(FICDataUniqueBlock109());
//some hand waving for the data conversion
if(debugLevel)
cout << "Reading the input data." << endl;
list<FICData>& ficList = input.getData();
list<FICData>::iterator itr = ficList.begin();
DayTime earliest( DayTime::END_OF_TIME );
DayTime latest( DayTime::BEGINNING_OF_TIME );
int count = 0;
int numMismatches = 0;
int numMismatchEph = 0;
while (itr != ficList.end())
{
EngEphemeris ee(*itr);
bc109.addEphemeris( ee );
DayTime ct = ee.getEpochTime();
if (ct>latest) latest = ct;
if (ct<earliest) earliest = ct;
// Following code simulates a situation where only words 3-10
// and the estimated time of receipt are available.
DayTime timeOfReceipt = ee.getTransmitTime();
FICData& fic = *itr;
long sf1min[8];
long sf2min[8];
long sf3min[8];
int wrdCnt = 8;
int i;
for (i=0; i<wrdCnt; ++i) sf1min[i] = fic.i[4+i];
for (i=0; i<wrdCnt; ++i) sf2min[i] = fic.i[14+i];
for (i=0; i<wrdCnt; ++i) sf3min[i] = fic.i[24+i];
EngEphemeris eeMin;
short PRNID = (short) fic.i[1];
eeMin.addIncompleteSF1Thru3( sf1min, sf2min, sf3min,
(long) timeOfReceipt.GPSsecond(), timeOfReceipt.GPSfullweek(),
PRNID, 0 );
minRaw.addEphemeris( eeMin );
// Compare non-orbit portions of the two objects
bool mismatch = false;
for (int i=1; i<=3; ++i)
{
if (!ee.isData(i) || !eeMin.isData(i))
{
mismatch = true;
fp << "ERROR: not all subframes are claimed available.";
}
}
if (ee.getIODC()!=eeMin.getIODC())
{
mismatch = true;
fp << "ERROR: IODCs do not match.";
}
if (ee.getIODE()!=eeMin.getIODE())
{
mismatch = true;
fp << "ERROR: IODCs do not match.";
}
if (ee.getFitInterval() != eeMin.getFitInterval() )
{
mismatch = true;
fp << "ERROR: fit intervals do not match.";
}
if (ee.getCodeFlags()!=eeMin.getCodeFlags() )
{
mismatch = true;
fp << "ERROR: code flags do not match.";
}
if (ee.getL2Pdata()!=eeMin.getL2Pdata() )
//.........这里部分代码省略.........
示例12: g
//.........这里部分代码省略.........
ofstream outf("Logs/CNAVEphemeris_Output", ios::out);
outf.precision(11);
// First test case. Create an CE object with data available from RINEX file.
outf << endl << "Test Case 1: Creating CE object with data from RINEX file." << endl;
outf << "Time = " << g << endl;
CNAVEphemeris ce1;
ce1.loadData(SysID, obsID, PRNID, AlertMsg10, TOWMsg10_1, AlertMsg11,
TOWMsg11_1, rTOWWeek, Top, URAoe, L1Health, L2Health,
L5Health, rToe, raccuracy, rCuc, rCus, rCrc, rCrs, rCic,
rCis, rM0, rdn, rdnDot, recc, deltaA, rAdot, rOMEGA0,
ri0, rw, deltaOMEGAdot1, ridot );
Xv xv1 = ce1.svXv( dt );
outf << "Position ce1: " << xv1.x << endl;
outf << "Velocity ce1: " << xv1.v << endl;
outf << "RelCorr ce1: " << ce1.svRelativity(dt) << endl;
outf << "Time of Prediction ce1: " << GPSWeekSecond(ce1.getTimeOfPrediction()).printf("%F, %g") << endl;
outf << "CNAV Accuracy Test: " << SV_CNAV_ACCURACY_GPS_MAX_INDEX[URAoe+15] << endl;
outf << "legacy Accuracy Test: " << SV_ACCURACY_GPS_MAX_INDEX[URAoe] << endl;
// Second test case. Create an CE object with data available from navdump.
outf << endl << "Test Case 2: Creating CE object with data from navdump." << endl;
outf << "Time = " << ct2 << endl;
CNAVEphemeris ce2;
ce2.loadData( SysID, obsID2, PRNID2, AlertMsg10, TOWMsg10_2, AlertMsg11,
TOWMsg11_2, TOWWeek2, Top2, URAoe2, L1Health, L2Health,
L5Health, Toe2, accuracy2, Cuc2, Cus2, Crc2, Crs2, Cic2,
Cis2, M02, dn2, dnDot2, ecc2, deltaA2, Adot2, OMEGA02,
i02, w2, deltaOMEGAdot2, idot2 );
Xv xv2 = ce2.svXv( dt2 );
outf << "Position ce2: " << xv2.x << endl;
outf << "Velocity ce2: " << xv2.v << endl;
outf << "RelCorr ce2: " << ce2.svRelativity(dt2) << endl;
outf << "Time of Prediction ce2: " << GPSWeekSecond(ce2.getTimeOfPrediction()).printf("%F, %g") << endl;
// Third test case. Create an CE object with data available from navdump.
outf << endl << "Test Case 3: Creating CE object with data from navdump." << endl;
outf << "Time = " << ct3 << endl;
CNAVEphemeris ce3;
ce3.loadData( SysID, obsID, PRNID3, AlertMsg10, TOWMsg10_3, AlertMsg11,
TOWMsg11_3, TOWWeek3, Top3, URAoe3, L1Health, L2Health,
L5Health, Toe3, accuracy3, Cuc3, Cus3, Crc3, Crs3, Cic3,
Cis3, M03, dn3, dnDot3, ecc3, deltaA3, Adot3, OMEGA03,
i03, w3, deltaOMEGAdot3, idot3 );
Xv xv3 = ce3.svXv( dt3 );
outf << "Position ce3: " << xv3.x << endl;
outf << "Velocity ce3: " << xv3.v << endl;
outf << "RelCorr ce3: " << ce3.svRelativity(dt3) << endl;
outf << "Time of Prediction ce3: " << GPSWeekSecond(ce3.getTimeOfPrediction()).printf("%F, %g") << endl;
// Fourth test case. Compare against "classic" EngEphemeris
outf << endl << "Test Case 4: Calculated position using 'classic' EngEphemeris." << endl;
outf<< "Time= "<< g << endl;
EngEphemeris EE;
EE.addSubframe(subframe1, TOWWeek, 3, 1);
EE.addSubframe(subframe2, TOWWeek, 3, 1);
EE.addSubframe(subframe3, TOWWeek, 3, 1);
Xvt xvt = EE.svXvt(dt);
outf<< "Position EE: " << xvt.x << endl;
outf<< "Velocity EE: " << xvt.v << endl;
outf<< "RelCorr EE: " << EE.svRelativity(dt) << endl;
outf << endl;
outf << "CE Object Dump:" << endl;
outf << ce1 << endl;
if ( ce1.getOrbit().isHealthy()) outf << "CE.orbit is healthy." << endl;
else outf << "CE.orbit is NOT healthy." << endl;
outf << endl;
outf << "CE2 Object Dump:" << endl;
outf << ce2 << endl;
if ( ce2.getOrbit().isHealthy()) outf << "CE2.orbit is healthy." << endl;
else outf << "CE2.orbit is NOT healthy." << endl;
outf << endl;
outf << "CE3 Object Dump:" << endl;
outf << ce3 << endl;
if ( ce3.getOrbit().isHealthy()) outf << "CE3.orbit is healthy." << endl;
else outf << "CE3.orbit is NOT healthy." << endl;
outf << endl;
outf << "Fit Interval Tests" << endl;
outf << "BeginFit ce1: " << GPSWeekSecond(ce1.getOrbit().getBeginningOfFitInterval()).printf("%F, %g") << endl;
outf << "BeginFit EE: " << GPSWeekSecond(EE.getOrbit().getBeginningOfFitInterval()).printf("%F, %g") << endl;
outf << endl;
outf << "EndFit ce1: " << GPSWeekSecond(ce1.getOrbit().getEndOfFitInterval()).printf("%F, %g") << endl;
outf << "EndFit EE : " << GPSWeekSecond(EE.getOrbit().getEndOfFitInterval()).printf("%F, %g") << endl;
outf << endl;
outf << "Within Fit Interval: " << ce1.getOrbit().withinFitInterval(dt) << endl;
outf << "Within Fit Interval: " << EE.getOrbit().withinFitInterval(dt) << endl;
CPPUNIT_ASSERT(fileEqualTest((char*)"Logs/CNAVEphemeris_Truth",(char*)"Logs/CNAVEphemeris_Output"));
}
示例13: EngEphemeris
// Deprecated; use GPSEphemeris.
// Converts this Rinex3NavData to an EngEphemeris object.
Rinex3NavData::operator EngEphemeris() const throw()
{
EngEphemeris ee;
// There's no TLM word in Rinex3NavData, so it's set to 0.
// Likewise, there's no AS alert or tracker.
// Also, in RINEX, the accuracy is in meters, and setSF1 expects
// the accuracy flag. We'll give it zero and pass the accuracy
// separately via the setAccuracy() method.
ee.tlm_message[0] = 0;
ee.tlm_message[1] = 0;
ee.tlm_message[2] = 0;
ee.HOWtime[0] = HOWtime; // RINEX does not actually specify
ee.HOWtime[1] = HOWtime; // how the transmit time is derived. Therefore,
ee.HOWtime[2] = HOWtime; // These values may be misleading.
ee.ASalert[0] = 1; //AS and alert flags set to 1 (default)
ee.ASalert[1] = 1;
ee.ASalert[2] = 1;
ee.weeknum = weeknum;
ee.codeflags = codeflgs;
ee.health = health;
ee.IODC = short(IODC);
ee.L2Pdata = L2Pdata;
ee.Tgd = Tgd;
ee.tracker = 0;
ee.PRNID = PRNID;
ee.satSys = satSys;
bool healthy = false;
if (health == 0) healthy = true;
short accFlag = 0; //will be set later.
//BrcClockCorrection takes a flag, while EngEphemeris takes a double.
double toc = Toc;
double timeDiff =toc - ee.HOWtime[0];
short epochWeek = ee.weeknum;
if (timeDiff < -HALFWEEK) epochWeek++;
else if (timeDiff > HALFWEEK) epochWeek--;
CommonTime tocCT = GPSWeekSecond(epochWeek, Toc, TimeSystem::GPS);
// The observation ID has a type of navigation, but the
// carrier and code types are undefined. They could be
// L1/L2 C/A, P, Y,.....
ObsID obsID(ObsID::otNavMsg, ObsID::cbUndefined, ObsID::tcUndefined);
ee.bcClock.loadData( satSys, obsID, PRNID, tocCT,
accFlag, healthy, af0, af1, af2);
ee.IODE = short(IODE);
ee.fitint = (fitint > 4) ? 1 : 0;
//double toe = Toe; //?????
//Needed for modernized nav quatities
double A = Ahalf * Ahalf;
double dndot = 0.0;
double Adot = 0.0;
short fitHours = getLegacyFitInterval(ee.IODC, ee.fitint);
long beginFitSOW = Toe - (fitHours/2)*3600.0;
long endFitSOW = Toe + (fitHours/2)*3600.0;
short beginFitWk = ee.weeknum;
short endFitWk = ee.weeknum;
if (beginFitSOW < 0)
{
beginFitSOW += FULLWEEK;
beginFitWk--;
}
CommonTime beginFit = GPSWeekSecond(beginFitWk, beginFitSOW, TimeSystem::GPS);
if (endFitSOW >= FULLWEEK)
{
endFitSOW += FULLWEEK;
endFitWk++;
}
CommonTime endFit = GPSWeekSecond(endFitWk, endFitSOW, TimeSystem::GPS);
CommonTime toeCT = GPSWeekSecond(epochWeek, Toe, TimeSystem::GPS);
ee.orbit.loadData( satSys, obsID, PRNID, beginFit, endFit, toeCT,
accFlag, healthy, Cuc, Cus, Crc, Crs, Cic, Cis,
M0, dn, dndot, ecc, A, Ahalf, Adot, OMEGA0, i0,
w, OMEGAdot, idot);
ee.haveSubframe[0] = true; // need to be true to perform certain EngEphemeris functions
ee.haveSubframe[1] = true; // examples: ee.dump(), ee.setAccuracy()
ee.haveSubframe[2] = true;
ee.setAccuracy(accuracy);
return ee;
} // End of 'Rinex3NavData::operator EngEphemeris()'
示例14: RinexSatID
// 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)'