Skip to content

Commit

Permalink
'dropouts' is a (very) little more careful about checking that TLEs a…
Browse files Browse the repository at this point in the history
…re properly formatted. It also counts how many TLEs are read and displays it (that total will be used in subsequent commits).
  • Loading branch information
Bill-Gray committed Aug 31, 2024
1 parent dd6f0c2 commit 0f3f468
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions dropouts.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,24 @@ int main( const int argc, const char **argv)
FILE *ifile = fopen( argc == 1 ? "all_tle.txt" : argv[1], "rb");
char buff[100];
size_t i;
int trouble_found = 0;
int trouble_found = 0, n_found = 0;

assert( ifile);
while( fgets( buff, sizeof( buff), ifile))
if( *buff == '1' && buff[1] == ' ')
for( i = 0; sats[i]; i++)
if( sats[i][0] == buff[9] && !memcmp( sats[i], buff + 9, 7))
sats[i] = "";
if( *buff == '1' && buff[1] == ' ' && buff[7] == 'U')
{
size_t len = strlen( buff);

while( len && buff[len - 1] < ' ')
len--;
if( 69 == len)
{
n_found++;
for( i = 0; sats[i]; i++)
if( sats[i][0] == buff[9] && !memcmp( sats[i], buff + 9, 7))
sats[i] = "";
}
}
fclose( ifile);
printf( "This will list high-flying artsats for which TLEs are not provided :\n");
for( i = 0; sats[i]; i++)
Expand All @@ -101,5 +111,6 @@ int main( const int argc, const char **argv)
if( !trouble_found)
printf( "Any missing objects are covered by other sources. Nothing\n"
"to worry about here.\n");
printf( "%d found\n", (int)n_found);
return( 0);
}

0 comments on commit 0f3f468

Please sign in to comment.