sgp4io.cpp   sgp4io.cpp 
skipping to change at line 16 skipping to change at line 16
* not formerly part of the sgp4 mathematical theory, it is * not formerly part of the sgp4 mathematical theory, it is
* required for practical implemenation. * required for practical implemenation.
* *
* companion code for * companion code for
* fundamentals of astrodynamics and applications * fundamentals of astrodynamics and applications
* 2007 * 2007
* by david vallado * by david vallado
* *
* (w) 719-573-2600, email dvallado@agi.com * (w) 719-573-2600, email dvallado@agi.com
* *
* Note: Deleted code related with command line inputs. That implementati
on
* is not a god way to build a library. It's better to aisle logic
and interface.
* J.L. Canales 20/11/2010
*
* current : * current :
* 3 sep 08 david vallado * 3 sep 08 david vallado
* add operationmode for afspc (a) or improved (i) * add operationmode for afspc (a) or improved (i)
* changes : * changes :
* 9 may 07 david vallado * 9 may 07 david vallado
* fix year correction to 57 * fix year correction to 57
* 27 mar 07 david vallado * 27 mar 07 david vallado
* misc fixes to manual inputs * misc fixes to manual inputs
* 14 aug 06 david vallado * 14 aug 06 david vallado
* original baseline * original baseline
skipping to change at line 83 skipping to change at line 87
char typerun, char typeinput, char opsmode, char typerun, char typeinput, char opsmode,
gravconsttype whichconst, gravconsttype whichconst,
double& startmfe, double& stopmfe, double& deltamin, double& startmfe, double& stopmfe, double& deltamin,
elsetrec& satrec elsetrec& satrec
) )
{ {
const double deg2rad = pi / 180.0; // 0.017453292519943 3 const double deg2rad = pi / 180.0; // 0.017453292519943 3
const double xpdotp = 1440.0 / (2.0 *pi); // 229.1831180523293 const double xpdotp = 1440.0 / (2.0 *pi); // 229.1831180523293
double sec, mu, radiusearthkm, tumin, xke, j2, j3, j4, j3oj2; double sec, mu, radiusearthkm, tumin, xke, j2, j3, j4, j3oj2;
double startsec, stopsec, startdayofyr, stopdayofyr, jdstart, jdstop
;
int startyear, stopyear, startmon, stopmon, startday, stopday,
starthr, stophr, startmin, stopmin;
int cardnumb, numb, j; int cardnumb, numb, j;
long revnum = 0, elnum = 0; long revnum = 0, elnum = 0;
char classification, intldesg[11]; char classification, intldesg[11];
int year = 0; int year = 0;
int mon, day, hr, minute, nexp, ibexp; int mon, day, hr, minute, nexp, ibexp;
getgravconst( whichconst, tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2 ); getgravconst( whichconst, tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2 );
satrec.error = 0; satrec.error = 0;
skipping to change at line 193 skipping to change at line 194
// ---------------- temp fix for years from 1957-2056 -------------- ----- // ---------------- temp fix for years from 1957-2056 -------------- -----
// --------- correct fix will occur when year is 4-digit in tle ---- ----- // --------- correct fix will occur when year is 4-digit in tle ---- -----
if (satrec.epochyr < 57) if (satrec.epochyr < 57)
year= satrec.epochyr + 2000; year= satrec.epochyr + 2000;
else else
year= satrec.epochyr + 1900; year= satrec.epochyr + 1900;
days2mdhms ( year,satrec.epochdays, mon,day,hr,minute,sec ); days2mdhms ( year,satrec.epochdays, mon,day,hr,minute,sec );
jday( year,mon,day,hr,minute,sec, satrec.jdsatepoch ); jday( year,mon,day,hr,minute,sec, satrec.jdsatepoch );
// ---- input start stop times manually // ------------ perform complete catalog evaluation, -+ 1 day -----
if ((typerun != 'v') && (typerun != 'c')) ------
{
// ------------- enter start/stop ymd hms values -----------------
---
if (typeinput == 'e')
{
printf("input start prop year mon day hr min sec \n");
// make sure there is no space at the end of the format spec
ifiers in scanf!
scanf( "%i %i %i %i %i %lf",&startyear, &startmon, &startday
, &starthr, &startmin, &startsec);
fflush(stdin);
jday( startyear,startmon,startday,starthr,startmin,startsec,
jdstart );
printf("input stop prop year mon day hr min sec \n");
scanf( "%i %i %i %i %i %lf",&stopyear, &stopmon, &stopday, &
stophr, &stopmin, &stopsec);
fflush(stdin);
jday( stopyear,stopmon,stopday,stophr,stopmin,stopsec, jdsto
p );
startmfe = (jdstart - satrec.jdsatepoch) * 1440.0;
stopmfe = (jdstop - satrec.jdsatepoch) * 1440.0;
printf("input time step in minutes \n");
scanf( "%lf",&deltamin );
}
// -------- enter start/stop year and days of year values ------
-----
if (typeinput == 'd')
{
printf("input start year dayofyr \n");
scanf( "%i %lf",&startyear, &startdayofyr );
printf("input stop year dayofyr \n");
scanf( "%i %lf",&stopyear, &stopdayofyr );
days2mdhms ( startyear,startdayofyr, mon,day,hr,minute,sec )
;
jday( startyear,mon,day,hr,minute,sec, jdstart );
days2mdhms ( stopyear,stopdayofyr, mon,day,hr,minute,sec );
jday( stopyear,mon,day,hr,minute,sec, jdstop );
startmfe = (jdstart - satrec.jdsatepoch) * 1440.0;
stopmfe = (jdstop - satrec.jdsatepoch) * 1440.0;
printf("input time step in minutes \n");
scanf( "%lf",&deltamin );
}
// ------------------ enter start/stop mfe values --------------
-----
if (typeinput == 'm')
{
printf("input start min from epoch \n");
scanf( "%lf",&startmfe );
printf("input stop min from epoch \n");
scanf( "%lf",&stopmfe );
printf("input time step in minutes \n");
scanf( "%lf",&deltamin );
}
}
// ------------ perform complete catalog evaluation, -+ 1 day ------
-----
if (typerun == 'c') if (typerun == 'c')
{ {
startmfe = -1440.0; startmfe = -1440.0;
stopmfe = 1440.0; stopmfe = 1440.0;
deltamin = 10.0; deltamin = 10.0;
} }
// ---------------- initialize the orbit at sgp4epoch -------------- ----- // ---------------- initialize the orbit at sgp4epoch -------------- -----
sgp4init( whichconst, opsmode, satrec.satnum, satrec.jdsatepoch-2433 281.5, satrec.bstar, sgp4init( whichconst, opsmode, satrec.satnum, satrec.jdsatepoch-2433 281.5, satrec.bstar,
satrec.ecco, satrec.argpo, satrec.inclo, satrec.mo, satrec .no, satrec.ecco, satrec.argpo, satrec.inclo, satrec.mo, satrec .no,
 End of changes. 3 change blocks. 
69 lines changed or deleted 8 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/