Added ecc and incl error check in init code

feature/19
Daniel Warner 2011-03-29 17:07:32 +01:00
parent 32647bc067
commit 7eb83ea9e9
1 changed files with 11 additions and 0 deletions

View File

@ -68,6 +68,17 @@ void SGDP4::SetTle(const Tle& tle) {
bstar_ = tle.GetField(Tle::FLD_BSTAR);
epoch_ = tle.GetEpoch();
/*
* error checks
*/
if (eccentricity_ < 0.0 || eccentricity_ > 1.0 - 1.0e-3) {
throw new SatelliteException("Eccentricity out of range");
}
if (inclination_ < 0.0 || eccentricity_ > Globals::PI()) {
throw new SatelliteException("Inclination out of range");
}
/*
* recover original mean motion (xnodp) and semimajor axis (aodp)
* from input elements