-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust satutl to deal with alpha5 format
Signed-off-by: Cees Bassa <[email protected]>
- Loading branch information
Showing
6 changed files
with
93 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
int alpha5_to_number(const char *s); | ||
void number_to_alpha5(int number, char *result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
0 ENVISAT | ||
1 27386U 02009A 24356.40818734 .00000308 00000-0 11384-3 0 9993 | ||
2 27386 98.3105 311.2628 0001150 82.9407 85.1046 14.38791406195499 | ||
0 ISS (ZARYA) | ||
1 B5544U 98067A 24356.58519896 .00014389 00000-0 25222-3 0 9992 | ||
2 B5544 51.6403 106.8969 0007877 6.1421 113.2479 15.50801739487615 | ||
0 VANGUARD 1 | ||
1 00005U 58002B 24355.85605070 .00000390 00000-0 46945-3 0 9993 | ||
2 00005 34.2473 191.3006 1842495 208.7893 139.7481 10.85819141384219 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <math.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include "rftles.h" | ||
|
||
#define LIM 80 | ||
|
||
// Read a line of maximum length int lim from file FILE into string s | ||
int fgetline(FILE *file,char *s,int lim) | ||
{ | ||
int c,i=0; | ||
|
||
while (--lim > 0 && (c=fgetc(file)) != EOF && c != '\n') | ||
s[i++] = c; | ||
// if (c == '\n') | ||
// s[i++] = c; | ||
s[i] = '\0'; | ||
return i; | ||
} | ||
|
||
int main(int argc,char *argv[]) | ||
{ | ||
tle_t *tle; | ||
char tlefile[]="alpha5_test.txt"; | ||
|
||
// Load TLEs | ||
tle_array_t *tle_array = load_tles(tlefile); | ||
|
||
if (tle_array->number_of_elements == 0) { | ||
fprintf(stderr,"TLE file %s not found or empty\n", tlefile); | ||
return 0; | ||
} | ||
|
||
// Loop over all TLEs | ||
for (long elem = 0; elem < tle_array->number_of_elements; elem++) { | ||
// Get TLE | ||
tle = get_tle_by_index(tle_array, elem); | ||
|
||
print_orb(&tle->orbit); | ||
printf("\n"); | ||
} | ||
|
||
// Find specific TLE | ||
tle = get_tle_by_catalog_id(tle_array, 5); | ||
print_orb(&tle->orbit); | ||
printf("\n"); | ||
|
||
// Find specific TLE | ||
tle = get_tle_by_catalog_id(tle_array, 115544); | ||
print_orb(&tle->orbit); | ||
printf("\n"); | ||
|
||
|
||
return 0; | ||
} |