summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--TLE/argos.txt24
-rwxr-xr-xa.outbin14528 -> 19072 bytes
-rw-r--r--main.cpp264
-rw-r--r--readme.md41
4 files changed, 311 insertions, 18 deletions
diff --git a/TLE/argos.txt b/TLE/argos.txt
index 83d674a..eea5e92 100644
--- a/TLE/argos.txt
+++ b/TLE/argos.txt
@@ -1,18 +1,18 @@
 NOAA 15                 

-1 25338U 98030A   17044.56421669  .00000003  00000-0  20061-4 0  9992

-2 25338  98.7849  55.2106 0010209 200.4007 159.6766 14.25777141975394

+1 25338U 98030A   17045.68704760  .00000002  00000-0  19875-4 0  9992

+2 25338  98.7850  56.3357 0010267 197.0431 163.0405 14.25777246975555

 NOAA 18                 

-1 28654U 05018A   17044.57358822 -.00000020  00000-0  14465-4 0  9992

-2 28654  99.1915  63.7113 0015093  60.7091 299.5586 14.12324894604814

+1 28654U 05018A   17045.63625172 -.00000003  00000-0  23962-4 0  9998

+2 28654  99.1915  64.8007 0015072  57.8557 302.4073 14.12325019604960

 METOP-A                 

-1 29499U 06044A   17044.89277778 -.00000002  00000-0  19061-4 0  9992

-2 29499  98.6959 106.4783 0001654 138.5926 232.1176 14.21497328535624

+1 29499U 06044A   17046.23208722 -.00000003  00000-0  18450-4 0  9997

+2 29499  98.6957 107.7978 0001702 136.7529 243.8583 14.21497494535811

 NOAA 19                 

-1 33591U 09005A   17044.49021674  .00000072  00000-0  64444-4 0  9999

-2 33591  99.0766   9.6680 0012998 259.9099 100.0605 14.12152611413195

+1 33591U 09005A   17045.69471935  .00000102  00000-0  80316-4 0  9991

+2 33591  99.0768  10.8872 0012998 256.2747 103.6977 14.12152920413367

 METOP-B                 

-1 38771U 12049A   17044.89449147 -.00000005  00000-0  17777-4 0  9993

-2 38771  98.6963 107.0258 0000859 159.3671  25.7255 14.21490308228758

+1 38771U 12049A   17046.21010693 -.00000003  00000-0  18536-4 0  9993

+2 38771  98.6960 108.3219 0000922 158.0090 275.7686 14.21490430228940

 SARAL                   

-1 39086U 13009A   17044.84728924 -.00000027  00000-0  60588-5 0  9991

-2 39086  98.5388 234.3739 0000375 165.0013 195.1182 14.31993469207455

+1 39086U 13009A   17046.17487116 -.00000030  00000-0  51117-5 0  9996

+2 39086  98.5389 235.6807 0000451 164.6022 195.5176 14.31993515207646

diff --git a/a.out b/a.out
index 6bd7ae9..dce010b 100755
--- a/a.out
+++ b/a.out
Binary files differdiff --git a/main.cpp b/main.cpp
index b895b20..29214bd 100644
--- a/main.cpp
+++ b/main.cpp
@@ -3,23 +3,275 @@
 #include <fstream>
 #include <string>
 
-int main(){
-  // system("ls -l");
-  // system("python3 download_data.py");
+std::string category = "argos";
+
+class TLE{
+  private:
+    int value, category, satNr;
+
+  public:
+    void get_data(int, int, int);
+    void download();
+};
 
+void TLE::get_data(int value, int category, int satNr){
   std::string line;
+
+  // open file
   std::ifstream file ("TLE/argos.txt");
 
+  // run if file is open
   if(file.is_open()){
-    while(getline(file, line)){
-      std::cout << line << '\n';
+
+    // cycle to specific TLE
+    for(int i = 1; i <= ((3 * satNr)-3); i++){
+        std::getline(file, line);
+    }
+
+    if(value == 1){
+      std::getline(file, line);
+      for(int i = 0; i < 24; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 2){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 0; i < 1; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 3){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 7; i < 8; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 4){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 9; i < 11; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 5){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 11; i < 14; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 6){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 14; i < 17; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 7){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 18; i < 20; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 8){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 20; i < 32; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 9){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 20; i < 23; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 10){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 24; i < 32; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 11){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 33; i < 43; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 12){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 44; i < 52; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 13){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 53; i < 61; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 14){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 62; i < 63; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 15){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 64; i < 68; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 16){
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 68; i < 69; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 17){
+      std::getline(file, line);
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 0; i < 1; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 18){
+      std::getline(file, line);
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 2; i < 7; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 19){
+      std::getline(file, line);
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 8; i < 16; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 20){
+      std::getline(file, line);
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 17; i < 25; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 21){
+      std::getline(file, line);
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 26; i < 33; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 22){
+      std::getline(file, line);
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 34; i < 42; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 23){
+      std::getline(file, line);
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 42; i < 51; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 24){
+      std::getline(file, line);
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 52; i < 63; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 25){
+      std::getline(file, line);
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 63; i < 68; i++){
+        std::cout << line[i];
+      }
+    }
+
+    else if(value == 26){
+      std::getline(file, line);
+      std::getline(file, line);
+      std::getline(file, line);
+      for(int i = 68; i < 69; i++){
+        std::cout << line[i];
+      }
     }
+
+    // std::getline(file, line);
+    // std::cout << line << std::endl;
+    // std::getline(file, line);
+    // std::cout << line << std::endl;
+
     file.close();
   }
-
   else{
     std::cout << "Unable to open file";
   }
 
+  // std::cout << linecount << std::endl;
+}
+
+void TLE::download(){
+  std::cout << category;
+}
+
+
+int main(){
+  // system("ls -l");
+  // system("python3 download_data.py");
+
+  TLE sat;
+  // sat.download();
+  sat.get_data(19, 1, 2);
+  std::cout << std::endl;
+
   return 0;
 }
diff --git a/readme.md b/readme.md
index af2b242..ebf0deb 100644
--- a/readme.md
+++ b/readme.md
@@ -27,3 +27,44 @@ Compile using:
 Run using:
 
     $ ./a.out
+
+---
+
+# Variables
+
+## Values
+
+1. name
+2. line number 1
+3. classification
+4. launch year
+5. launch number
+6. launch piece
+7. epoch year
+8. epoch day fraction
+9. epoch day
+10. epoch time
+11. first time derivative
+12. second time derivative
+13. BSTAR Drag Term
+14. Num0
+15. Element Set Number
+16. Checksum 1
+17. Line number 2 ################### LINE 2 ###########
+18. Number 2
+19. Inclination
+20. RAAN
+21. Eccentricity
+22. Argument of Perigee
+23. Mean Anomaly
+24. Mean Motion
+25. Revolution
+26. Checksum 2
+
+## categorys
+
+1.
+
+## satNr
+
+  should be clear (1 -> n).