Minor changes
parent
afc5d9eacf
commit
3f2009a46e
|
@ -6,7 +6,7 @@
|
|||
#include "sgdp4h.h"
|
||||
#include <getopt.h>
|
||||
|
||||
#define LIM 80
|
||||
#define LIM 128
|
||||
#define NMAX 256
|
||||
#define D2R M_PI/180.0
|
||||
#define R2D 180.0/M_PI
|
||||
|
|
|
@ -376,7 +376,6 @@ void plot_xyz(void)
|
|||
while (fgetline(fp,line,LIM)>0) {
|
||||
// Get satellite position
|
||||
sscanf(line,"%lf %lf %lf %lf",&mjd,&satpos.x,&satpos.y,&satpos.z);
|
||||
printf("%lf %f %f %f\n",mjd,satpos.x,satpos.y,satpos.z);
|
||||
|
||||
// Get positions
|
||||
sunpos_xyz(m.mjd,&sunpos,&sra,&sde);
|
||||
|
|
25
satutl.c
25
satutl.c
|
@ -47,49 +47,44 @@ int read_twoline(FILE *fp, long search_satno, orbit_t *orb)
|
|||
int found;
|
||||
double bm, bx;
|
||||
|
||||
// Set defaults
|
||||
strcpy(orb->desig,"");
|
||||
|
||||
st1 = line1;
|
||||
st2 = line2;
|
||||
|
||||
do {
|
||||
if(fgets(line1, ST_SIZE-1, fp) == NULL) return -1;
|
||||
if(fgets(line1, ST_SIZE-1, fp) == NULL)
|
||||
return -1;
|
||||
st1 = st_start(line1);
|
||||
} while(st1[0] != '1');
|
||||
|
||||
if(search_satno > 0)
|
||||
{
|
||||
if(search_satno > 0) {
|
||||
found = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
found = 1;
|
||||
search_satno = atol(st1+2);
|
||||
}
|
||||
|
||||
sprintf(search, "1 %05ld", search_satno);
|
||||
|
||||
do {
|
||||
st1 = st_start(line1);
|
||||
if(strncmp(st1, search, 7) == 0)
|
||||
{
|
||||
if(strncmp(st1, search, 7) == 0) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
} while(fgets(line1, ST_SIZE-1, fp) != NULL);
|
||||
|
||||
|
||||
sprintf(search, "2 %05ld", search_satno);
|
||||
|
||||
if(found)
|
||||
{
|
||||
if(found) {
|
||||
fgets(line2, ST_SIZE-1, fp);
|
||||
st2 = st_start(line2);
|
||||
}
|
||||
|
||||
if(!found || strncmp(st2, search, 7) != 0)
|
||||
{
|
||||
if(!found || strncmp(st2, search, 7) != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
orb->ep_year = (int)i_read(st1, 19, 20);
|
||||
|
||||
if(orb->ep_year < 57) orb->ep_year += 2000;
|
||||
|
|
Loading…
Reference in New Issue