COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
convertdef.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
36 #ifndef _CONVERTDEF_H
37 #define _CONVERTDEF_H 1
38 
39 #include "support/configCosmos.h"
40 
41 #include "math/mathlib.h"
42 
46 
47 // TODO: move these constants to physics/constants.h
49 #define CLIGHT 299792458.
50 #define SIGMA 5.67e-8
52 //#define GC 6.672e-11
54 #define SOL (86400.*2.99792458e8)
55 #define RSUNM static_cast<double>(6.955e8)
57 #define RMOONM static_cast<double>(1738000.)
59 #define REARTHM static_cast<double>(6378137.)
61 #define REARTHKM static_cast<double>(6378.137)
63 #define FLATTENING (1./298.257223563)
65 #define FRATIO (1.-FLATTENING)
66 #define FRATIO2 (FRATIO*FRATIO)
67 #define AU static_cast<double>(1.49597870691e11)
69 #define MSUN 1.9891e30
71 #define MEARTH 5.9742e24
73 #define MMOON 7.3477e22
75 #define MJUPITER 1.8966e27
77 //#define GM static_cast<double>((3.98600441789e14))
79 #define GM static_cast<double>((3.986004415e14))
80 #define GMOON static_cast<double>((4.9028029535968e+12))
82 #define GSUN static_cast<double>((1.327122e20))
84 #define GJUPITER static_cast<double>((1.266865349218008e17))
86 #define LAT_HIGP RADOF(21.297440)
88 #define LON_HIGP RADOF(157.81630)
90 #define ALT_HIGP 33.
92 #define GEOC_HONOLULU {{-5588871.,-2278876.,2353191.}}
94 
95 // TODO: create SGP4 module
96 // SGP4 constants
97 #define SGP4_CK2 5.413080E-4
98 #define SGP4_CK4 0.62098875E-6
99 #define SGP4_E6A 1E-6
100 #define SGP4_QOMS2T 1.88027916E-9
101 #define SGP4_S 1.01222928
102 #define SGP4_TOTHRD 2./3.
103 #define SGP4_XJ3 -0.253881E-5
104 #define SGP4_XKE 0.743669161E-1
105 #define SGP4_XKMPER 6378.135
106 #define SGP4_XMNPDA 1440.0
107 #define SGP4_AE 1.
108 
109 // JPL Planetary Ephemeris stuff
110 #define JPL_MERCURY 1
111 #define JPL_VENUS 2
112 #define JPL_EARTH 3
113 #define JPL_MARS 4
114 #define JPL_JUPITER 5
115 #define JPL_SATURN 6
116 #define JPL_URANUS 7
117 #define JPL_NEPTUNE 8
118 #define JPL_PLUTO 9
119 #define JPL_MOON 10
120 #define JPL_SUN 11
121 #define JPL_SUN_BARY 12
122 #define JPL_EARTH_BARY 13
123 #define JPL_NUTATIONS 14
124 
125 // Two Line Element
126 #define MAXTLE 5000
127 
129 
133 
134 // COSMOS Planetary Bodies
135 #define COSMOS_MERCURY JPL_MERCURY
136 #define COSMOS_VENUS JPL_VENUS
137 #define COSMOS_EARTH JPL_EARTH
138 #define COSMOS_MARS JPL_MARS
139 #define COSMOS_JUPITER JPL_JUPITER
140 #define COSMOS_SATURN JPL_SATURN
141 #define COSMOS_URANUS JPL_URANUS
142 #define COSMOS_NEPTUNE JPL_NEPTUNE
143 #define COSMOS_PLUTO JPL_PLUTO
144 #define COSMOS_MOON JPL_MOON
145 #define COSMOS_SUN JPL_SUN
146 
148 
152 
154 
158 struct cartpos
159 {
161  double utc = 0.;
168  // TODO: get rid of this kind of stuff?
170  uint32_t pass = 0.;
171 
173 
177  return json11::Json::object {
178  { "utc" , utc },
179  { "s", s },
180  { "v", v },
181  { "a", a },
182  { "pass", static_cast<int>(pass) }
183  };
184  }
185 
187 
192  void from_json(const string& js) {
193  string error;
194  json11::Json parsed = json11::Json::parse(js,error);
195  if(error.empty()) {
196  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
197  if(!parsed["s"].is_null()) s.from_json(parsed["s"].dump());
198  if(!parsed["v"].is_null()) v.from_json(parsed["v"].dump());
199  if(!parsed["a"].is_null()) a.from_json(parsed["a"].dump());
200  if(!parsed["pass"].is_null()) pass = parsed["pass"].int_value();
201  } else {
202  cerr<<"ERROR = "<<error<<endl;
203  }
204  return;
205  }
206 };
207 
208 std::ostream& operator << (std::ostream& out, const cartpos& a);
209 std::istream& operator >> (std::istream& in, cartpos& a);
210 
212 
215 struct cposstruc
216 {
218  double utc = 0.;
221 
223 
227  return json11::Json::object {
228  { "utc", utc },
229  { "pos", pos }
230  };
231  }
232 
234 
239  void from_json(const string& js) {
240  string error;
241  json11::Json parsed = json11::Json::parse(js,error);
242  if(error.empty()) {
243  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
244  if(!parsed["pos"].is_null()) pos.from_json(parsed["pos"].dump());
245  } else {
246  cerr << "ERROR = "<<error<<endl;
247  }
248  return;
249  }
250 };
251 
252 std::ostream& operator << (std::ostream& out, const cposstruc& a);
253 std::istream& operator >> (std::istream& in, cposstruc& a);
254 
256 
259 struct geoidpos
260 {
261  double utc = 0.;
269  uint32_t pass = 0;
270 
272 
276  return json11::Json::object {
277  { "utc" , utc },
278  { "s", s },
279  { "v", v },
280  { "a", a },
281  { "pass", static_cast<int>(pass) }
282  };
283  }
284 
286 
291  void from_json(const string& js) {
292  string error;
293  json11::Json parsed = json11::Json::parse(js,error);
294  if(error.empty()) {
295  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
296  if(!parsed["s"].is_null()) s.from_json(parsed["s"].dump());
297  if(!parsed["v"].is_null()) v.from_json(parsed["v"].dump());
298  if(!parsed["a"].is_null()) a.from_json(parsed["a"].dump());
299  if(!parsed["pass"].is_null()) pass = parsed["pass"].int_value();
300  } else {
301  cerr<<"ERROR = "<<error<<endl;
302  }
303  return;
304  }
305 };
306 
307 std::ostream& operator << (std::ostream& out, const geoidpos& a);
308 std::istream& operator >> (std::istream& in, geoidpos& a);
309 
311 
314 struct spherpos
315 {
316  double utc = 0.;
324  uint32_t pass = 0;
325 
327 
331  return json11::Json::object {
332  { "utc" , utc },
333  { "s", s },
334  { "v", v },
335  { "a", a },
336  { "pass", static_cast<int>(pass) }
337  };
338  }
339 
341 
346  void from_json(const string& js) {
347  string error;
348  json11::Json parsed = json11::Json::parse(js,error);
349  if(error.empty()) {
350  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
351  if(!parsed["s"].is_null()) s.from_json(parsed["s"].dump());
352  if(!parsed["v"].is_null()) v.from_json(parsed["v"].dump());
353  if(!parsed["a"].is_null()) a.from_json(parsed["a"].dump());
354  if(!parsed["pass"].is_null()) pass = parsed["pass"].int_value();
355  } else {
356  cerr<<"ERROR = "<<error<<endl;
357  }
358  return;
359  }
360 };
361 
362 std::ostream& operator << (std::ostream& out, const spherpos& a);
363 std::istream& operator >> (std::istream& in, spherpos& a);
364 
365 struct aattstruc
366 {
367  double utc = 0.;
371 
373 
377  return json11::Json::object {
378  { "utc" , utc },
379  { "s" , s },
380  { "v" , v },
381  { "a" , a }
382  };
383  }
385 
390  void from_json(const string& js) {
391  string error;
392  json11::Json parsed = json11::Json::parse(js,error);
393  if(error.empty()) {
394  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
395  if(!parsed["s"].is_null()) s.from_json(parsed["s"].dump());
396  if(!parsed["v"].is_null()) v.from_json(parsed["v"].dump());
397  if(!parsed["a"].is_null()) a.from_json(parsed["a"].dump());
398  } else {
399  cerr<<"ERROR = "<<error<<endl;
400  }
401  return;
402  }
403 };
404 
405 std::ostream& operator << (std::ostream& out, const aattstruc& a);
406 std::istream& operator >> (std::istream& in, aattstruc& a);
407 
408 struct quatatt
409 {
410  double utc;
414 };
415 
416 std::ostream& operator << (std::ostream& out, const quatatt& a);
417 std::istream& operator >> (std::istream& in, quatatt& a);
418 
420 
423 struct dcmatt
424 {
425  double utc = 0.;
432 
434 
438  return json11::Json::object {
439  { "utc" , utc },
440  //{ "s", s },
441  { "v", v },
442  { "a", a }
443  };
444  }
445 
447 
452  void from_json(const string& js) {
453  string error;
454  json11::Json parsed = json11::Json::parse(js,error);
455  if(error.empty()) {
456  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
457  //if(!parsed["s"].is_null()) s.from_json(parsed["s"].dump());
458  if(!parsed["v"].is_null()) v.from_json(parsed["v"].dump());
459  if(!parsed["a"].is_null()) a.from_json(parsed["a"].dump());
460  } else {
461  cerr<<"ERROR = "<<error<<endl;
462  }
463  return;
464  }
465 };
466 
467 std::ostream& operator << (std::ostream& out, const dcmatt& a);
468 std::istream& operator >> (std::istream& in, dcmatt& a);
469 
471 
475 struct qatt
476 {
477  double utc = 0.;
481  rvector v; //dq
483  rvector a; //ddq
485  uint32_t pass = 0;
486 
488 
492  return json11::Json::object {
493  { "utc" , utc },
494  { "s" , s },
495  { "v" , v },
496  { "a" , a },
497  { "pass" , static_cast<int>(pass) }
498  };
499  }
500 
502 
507  void from_json(const string& js) {
508  string error;
509  json11::Json parsed = json11::Json::parse(js,error);
510  if(error.empty()) {
511  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
512  if(!parsed["s"].is_null()) s.from_json(parsed["s"].dump());
513  if(!parsed["v"].is_null()) v.from_json(parsed["v"].dump());
514  if(!parsed["a"].is_null()) a.from_json(parsed["a"].dump());
515  if(!parsed["pass"].is_null()) pass = parsed["pass"].int_value();
516  } else {
517  cerr<<"ERROR = "<<error<<endl;
518  }
519  return;
520  }
521 };
522 
523 std::ostream& operator << (std::ostream& out, const qatt& a);
524 std::istream& operator >> (std::istream& in, qatt& a);
525 
527 
529 struct kepstruc
530 {
532  double utc;
534  uint32_t orbit;
536  double period;
538  double a;
540  double e;
544  double beta;
545  double eta;
547  double i;
549  double raan;
551  double ap;
553  double alat;
555  double ma;
557  double ta;
559  double ea;
561  double mm;
562  double fa;
563 };
564 
565 std::ostream& operator << (std::ostream& out, const kepstruc& a);
566 std::istream& operator >> (std::istream& in, kepstruc& a);
567 
568 struct bodypos
569 {
570  double sepangle;
571  double size;
572  double radiance;
573 };
574 
575 std::ostream& operator << (std::ostream& out, const bodypos& a);
576 std::istream& operator << (std::istream& in, bodypos& a);
577 
579 struct extrapos
580 {
582  double utc = 0.;
584  double tt = 0.;
586  double ut = 0.;
588  double tdb = 0.;
607  uint16_t closest = 0;
608 
610 
614  return json11::Json::object {
615  { "utc" , utc },
616  { "tt" , tt },
617  { "ut" , ut },
618  { "tdb" , tdb },
619 
620  { "j2e" , j2e },
621  { "dj2e" , dj2e },
622  { "ddj2e" , ddj2e },
623 
624  { "e2j" , e2j },
625  { "de2j" , de2j },
626  { "dde2j" , dde2j },
627 
628  { "j2t" , j2t },
629  { "j2s" , j2s },
630  { "t2j" , t2j },
631  { "s2j" , s2j },
632  { "s2t" , s2t },
633  { "ds2t" , ds2t },
634  { "t2s" , t2s },
635  { "dt2s" , dt2s },
636 
637  { "sun2earth" , sun2earth },
638  { "sun2moon" , sun2moon },
639  { "closest" , closest }
640  };
641  }
642 
644 
649  void from_json(const string& s) {
650  string error;
652  if(error.empty()) {
653  if(!p["utc"].is_null()) utc = p["utc"].number_value();
654  if(!p["tt"].is_null()) tt = p["tt"].number_value();
655  if(!p["ut"].is_null()) ut = p["ut"].number_value();
656  if(!p["tdb"].is_null()) tdb = p["tdb"].number_value();
657 
658  if(!p["j2e"].is_null()) j2e.from_json(p["j2e"].dump());
659  if(!p["dj2e"].is_null()) dj2e.from_json(p["dj2e"].dump());
660  if(!p["ddj2e"].is_null()) ddj2e.from_json(p["ddj2e"].dump());
661 
662  if(!p["e2j"].is_null()) e2j.from_json(p["e2j"].dump());
663  if(!p["de2j"].is_null()) de2j.from_json(p["de2j"].dump());
664  if(!p["dde2j"].is_null()) dde2j.from_json(p["dde2j"].dump());
665 
666  if(!p["j2t"].is_null()) j2t.from_json(p["j2t"].dump());
667  if(!p["j2s"].is_null()) j2s.from_json(p["j2s"].dump());
668  if(!p["t2j"].is_null()) t2j.from_json(p["t2j"].dump());
669  if(!p["s2j"].is_null()) s2j.from_json(p["s2j"].dump());
670  if(!p["s2t"].is_null()) s2t.from_json(p["s2t"].dump());
671  if(!p["ds2t"].is_null()) ds2t.from_json(p["ds2t"].dump());
672  if(!p["t2s"].is_null()) t2s.from_json(p["t2s"].dump());
673  if(!p["dt2s"].is_null()) dt2s.from_json(p["dt2s"].dump());
674 
675  if(!p["sun2earth"].is_null()) sun2earth.from_json(p["sun2earth"].dump());
676  if(!p["sun2moon"].is_null()) sun2moon.from_json(p["sun2moon"].dump());
677  if(!p["closest"].is_null()) closest = p["closest"].int_value();
678  } else {
679  cerr<<"ERROR: <"<<error<<">"<<endl;
680  }
681  return;
682  }
683 };
684 
685 std::ostream& operator << (std::ostream& out, const extrapos& a);
686 std::istream& operator >> (std::istream& in, extrapos& a);
687 
689 struct extraatt
690 {
692  double utc = 0.;
697 
699 
703  return json11::Json::object {
704  { "utc" , utc },
705  { "j2b" , j2b },
706  { "b2j" , b2j }
707  };
708  }
709 
711 
716  void from_json(const string& js) {
717  string error;
718  json11::Json parsed = json11::Json::parse(js,error);
719  if(error.empty()) {
720  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
721  if(!parsed["j2b"].is_null()) j2b.from_json(parsed["j2b"].dump());
722  if(!parsed["b2j"].is_null()) b2j.from_json(parsed["b2j"].dump());
723  } else {
724  cerr<<"ERROR = "<<error<<endl;
725  }
726  return;
727  }
728 };
729 
730 std::ostream& operator << (std::ostream& out, const extraatt& a);
731 std::istream& operator >> (std::istream& in, extraatt& a);
732 
733 struct posstruc
734 {
735  double utc = 0.;
746  float earthsep = 0.f;
748  float moonsep = 0.f;
750  float sunsize = 0.f;
752  float sunradiance = 0.f;
756  double orbit = 0.;
757 
759 
763  return json11::Json::object {
764  { "utc" , utc },
765  { "icrf" , icrf },
766  { "eci" , eci },
767  { "sci" , sci },
768  { "geoc" , geoc },
769  { "selc" , selc },
770  { "geod" , geod },
771  { "selg" , selg },
772  { "geos" , geos },
773  { "extra", extra },
774 
775  { "earthsep" , earthsep },
776  { "moonsep" , moonsep },
777  { "sunsize" , sunsize },
778  { "sunradiance" , sunradiance },
779  { "bearth" , bearth },
780  { "orbit" , orbit }
781  };
782  }
783 
785 
790  void from_json(const string& js) {
791  string error;
792  json11::Json parsed = json11::Json::parse(js,error);
793  if(error.empty()) {
794  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
795  if(!parsed["icrf"].is_null()) icrf.from_json(parsed["icrf"].dump());
796  if(!parsed["eci"].is_null()) eci.from_json(parsed["eci"].dump());
797  if(!parsed["sci"].is_null()) sci.from_json(parsed["sci"].dump());
798  if(!parsed["geoc"].is_null()) geoc.from_json(parsed["geoc"].dump());
799  if(!parsed["selc"].is_null()) selc.from_json(parsed["selc"].dump());
800  if(!parsed["geod"].is_null()) geod.from_json(parsed["geod"].dump());
801  if(!parsed["selg"].is_null()) selg.from_json(parsed["selg"].dump());
802  if(!parsed["geos"].is_null()) geos.from_json(parsed["geos"].dump());
803  if(!parsed["extra"].is_null()) extra.from_json(parsed["extra"].dump());
804 
805  if(!parsed["earthsep"].is_null()) earthsep = parsed["earthsep"].number_value();
806  if(!parsed["moonsep"].is_null()) moonsep = parsed["moonsep"].number_value();
807  if(!parsed["sunsize"].is_null()) sunsize = parsed["sunsize"].number_value();
808  if(!parsed["sunradiance"].is_null()) sunradiance = parsed["sunradiance"].number_value();
809 
810  if(!parsed["bearth"].is_null()) bearth.from_json(parsed["bearth"].dump());
811  if(!parsed["orbit"].is_null()) orbit = parsed["orbit"].number_value();
812 
813  } else {
814  cerr<<"ERROR = "<<error<<endl;
815  }
816  return;
817  }
818 };
819 
820 std::ostream& operator << (std::ostream& out, const posstruc& a);
821 std::istream& operator >> (std::istream& in, posstruc& a);
822 
823 struct attstruc
824 {
825  double utc = 0.;
832 
834 
838  return json11::Json::object {
839  { "utc" , utc },
840  { "topo" , topo },
841  { "lvlh" , lvlh },
842  { "geoc" , geoc },
843  { "selc" , selc },
844  { "icrf" , icrf },
845  { "extra" , extra }
846  };
847  }
848 
850 
855  void from_json(const string& js) {
856  string error;
857  json11::Json parsed = json11::Json::parse(js,error);
858  if(error.empty()) {
859  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
860  if(!parsed["topo"].is_null()) topo.from_json(parsed["utc"].dump());
861  if(!parsed["lvlh"].is_null()) lvlh.from_json(parsed["lvlh"].dump());
862  if(!parsed["geoc"].is_null()) geoc.from_json(parsed["geoc"].dump());
863  if(!parsed["selc"].is_null()) selc.from_json(parsed["selc"].dump());
864  if(!parsed["icrf"].is_null()) icrf.from_json(parsed["icrf"].dump());
865  if(!parsed["extra"].is_null()) extra.from_json(parsed["extra"].dump());
866  } else {
867  cerr<<"ERROR = "<<error<<endl;
868  }
869  return;
870  }
871 };
872 
873 std::ostream& operator << (std::ostream& out, const attstruc& a);
874 std::istream& operator >> (std::istream& in, attstruc& a);
875 
876 struct locstruc
877 {
879  double utc = 0.;
884 
886 
890  return json11::Json::object {
891  { "utc" , utc },
892  { "pos" , pos },
893  { "att" , att }
894  };
895  }
896 
898 
903  void from_json(const string& js) {
904  string error;
905  json11::Json parsed = json11::Json::parse(js,error);
906  if(error.empty()) {
907  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
908  if(!parsed["pos"].is_null()) pos.from_json(parsed["pos"].dump());
909  if(!parsed["att"].is_null()) att.from_json(parsed["att"].dump());
910  } else {
911  cerr<<"ERROR = "<<error<<endl;
912  }
913  return;
914  }
915 };
916 
917 std::ostream& operator << (std::ostream& out, const locstruc& a);
918 std::istream& operator >> (std::istream& in, locstruc& a);
919 
921 struct tlestruc
922 {
923  double utc = 0.;
924  // JIMNOTE: remove magic number
925  char name[25] = "";
926  uint16_t snumber = 0;
927  // JIMNOTE: remove magic number
928  char id[9] = "";
930  double bstar = 0.;
932  double i = 0.;
934  double raan = 0.;
936  double e = 0.;
938  double ap = 0.;
940  double ma = 0.;
942  double mm = 0.;
943  uint32_t orbit = 0;
944 
946 
950  return json11::Json::object {
951  { "utc" , utc },
952  { "name" , name },
953  { "snumber" , snumber },
954  { "id" , id },
955  { "bstar" , bstar },
956  { "i" , i },
957  { "raan" , raan },
958  { "e" , e },
959  { "ap" , ap },
960  { "ma" , ma },
961  { "mm" , mm },
962  { "orbit" , static_cast<int>(orbit) }
963  };
964  }
965 
967 
972  void from_json(const string& js) {
973  string error;
974  json11::Json parsed = json11::Json::parse(js,error);
975  if(error.empty()) {
976  if(!parsed["utc"].is_null()) utc = parsed["utc"].number_value();
977  if(!parsed["name"].is_null()) strcpy(name, parsed["name"].string_value().c_str());
978  if(!parsed["snumber"].is_null()) snumber = parsed["snumber"].int_value();
979  if(!parsed["id"].is_null()) strcpy(id, parsed["id"].string_value().c_str());
980  if(!parsed["bstar"].is_null()) bstar = parsed["bstar"].number_value();
981  if(!parsed["i"].is_null()) i = parsed["i"].number_value();
982  if(!parsed["raan"].is_null()) raan = parsed["raan"].number_value();
983  if(!parsed["e"].is_null()) e = parsed["e"].number_value();
984  if(!parsed["ap"].is_null()) ap = parsed["ap"].number_value();
985  if(!parsed["ma"].is_null()) ma = parsed["ma"].number_value();
986  if(!parsed["mm"].is_null()) mm = parsed["mm"].number_value();
987  if(!parsed["orbit"].is_null()) orbit = parsed["orbit"].int_value();
988  } else {
989  cerr<<"ERROR = "<<error<<endl;
990  }
991  return;
992  }
993 };
994 
996 
999 struct stkstruc
1000 {
1002  size_t count;
1004  double dt;
1007 };
1008 
1010 
1011 // Name clashes with literature... these are published units (in TLE file), not for use in the SGP4 propogator itself.
1013 {
1014  // Inclination (deg)
1015  double i;
1016  // Eccentricity
1017  double e;
1018  // Right-ascension of the Ascending Node (deg)
1019  double raan;
1020  // Argument of Perigee (deg)
1021  double ap;
1022  //B-Star drag term
1023  double bstar;
1024  // Mean Motion (rev/day)
1025  double mm;
1026  // Mean Anomaly (deg)
1027  double ma;
1028  // Epoch (year.day)
1029  double ep;
1030 };
1031 
1032 #endif
rvector bearth
Earth magnetic vector in ITRS for this time and location.
Definition: convertdef.h:754
void from_json(const string &s)
Set class contents from JSON string.
Definition: convertdef.h:649
rvector a
2nd derivative
Definition: convertdef.h:431
svector s
Position vector.
Definition: convertdef.h:318
Definition: convertdef.h:408
std::map< std::string, Json > object
Definition: json11.hpp:88
double ta
True Anomoly.
Definition: convertdef.h:557
double radiance
Definition: convertdef.h:572
Definition: eci2kep_test.cpp:33
qatt geoc
Definition: convertdef.h:828
Definition: json11.hpp:79
Additional parameters relating to position that need only be calculated once.
Definition: convertdef.h:689
Definition: eci2kep_test.cpp:33
double mm
Mean Motion.
Definition: convertdef.h:561
cartpos sun2earth
Definition: convertdef.h:605
rvector v
Definition: convertdef.h:412
In units for the SGP4 propogator (not NORAD TLE itself).
Definition: convertdef.h:921
rmatrix j2s
Definition: convertdef.h:598
cposstruc * pos
Array of positions.
Definition: convertdef.h:1006
Definition: eci2kep_test.cpp:33
Quaternion Attitude.
Definition: convertdef.h:475
double utc
UTC time of state vector in MJD.
Definition: convertdef.h:532
3 element generic row vector
Definition: vector.h:53
spherpos geos
Definition: convertdef.h:743
rvector a
Acceleration.
Definition: convertdef.h:167
double utc
UTC of Position.
Definition: convertdef.h:161
avector a
Definition: convertdef.h:370
int i
Definition: rw_test.cpp:37
double size
Definition: convertdef.h:571
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:972
double e
Eccentricity.
Definition: convertdef.h:540
double bstar
Definition: convertdef.h:1023
cartpos selc
Definition: convertdef.h:740
rvector a
2nd derivative: Alpha - acceleration
Definition: convertdef.h:483
Direction Cosine Matrix Attitude.
Definition: convertdef.h:423
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:330
Geodetic position structure.
Definition: convertdef.h:259
uint32_t pass
pass indicator: allows synchronization with other attitude and position values.
Definition: convertdef.h:170
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:239
Cartesian full position structure.
Definition: convertdef.h:158
quaternion s
Definition: convertdef.h:411
double ma
Mean Anomoly.
Definition: convertdef.h:555
rmatrix dt2s
Definition: convertdef.h:604
Quaternion, scalar last, using x, y, z.
Definition: vector.h:402
double utc
Definition: convertdef.h:410
avector v
Definition: convertdef.h:369
Additional parameters relating to position that need only be calculated once.
Definition: convertdef.h:579
rmatrix ddj2e
Definition: convertdef.h:592
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:390
rmatrix ds2t
Definition: convertdef.h:602
double sepangle
Definition: convertdef.h:570
cartpos geoc
Definition: convertdef.h:739
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:949
Definition: convertdef.h:365
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:903
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:311
rvector h
Angular Momentum vector.
Definition: convertdef.h:542
double eta
Definition: convertdef.h:545
cartpos sun2moon
Definition: convertdef.h:606
Definition: convertdef.h:1012
std::istream & operator>>(std::istream &in, cartpos &a)
Definition: convertlib.cpp:3908
qatt lvlh
Definition: convertdef.h:827
rmatrix t2s
Definition: convertdef.h:603
rvector v
1st derivative: Omega - angular velocity
Definition: convertdef.h:481
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:837
Definition: convertdef.h:733
std::ostream & operator<<(std::ostream &out, const cartpos &a)
Definition: convertlib.cpp:3902
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:226
uint32_t orbit
Orbit number.
Definition: convertdef.h:534
rmatrix s2j
Definition: convertdef.h:600
static double * p
Definition: gauss_jackson_test.cpp:42
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:192
geoidpos selg
Definition: convertdef.h:742
STK positions structure.
Definition: convertdef.h:999
void dump(std::string &out) const
rvector s
Location.
Definition: convertdef.h:163
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:346
double period
Orbital Period in seconds.
Definition: convertdef.h:536
rmatrix de2j
Definition: convertdef.h:595
double fa
Definition: convertdef.h:562
attstruc att
attstruc for this time.
Definition: convertdef.h:883
double e
Definition: convertdef.h:1017
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
3 element attitude vector.
Definition: vector.h:277
Definition: convertdef.h:568
gvector a
Acceleration vector.
Definition: convertdef.h:267
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:291
3 element spherical vector
Definition: vector.h:167
qatt selc
Definition: convertdef.h:829
3x3 element generic matrix
Definition: matrix.h:41
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:507
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:613
rvector v
1st derivative
Definition: convertdef.h:429
Headers and definitions common to all COSMOS.
qatt icrf
Definition: convertdef.h:830
string name
Definition: cubesat2obj.cpp:6
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:437
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:431
rmatrix dde2j
Definition: convertdef.h:596
void from_json(const string &s)
Set class contents from JSON string.
Definition: matrix.h:69
double dt
Time step in Modified Julian Days.
Definition: convertdef.h:1004
extrapos extra
Definition: convertdef.h:744
double ap
Definition: convertdef.h:1021
double raan
Right Ascension of the Ascending Node in radians.
Definition: convertdef.h:549
rmatrix t2j
Definition: convertdef.h:599
Classical elements structure.
Definition: convertdef.h:529
cartpos pos
Cartesian structure with all elements of position.
Definition: convertdef.h:220
Spherical position structure.
Definition: convertdef.h:314
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:790
avector s
Definition: convertdef.h:368
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:201
double ep
Definition: convertdef.h:1029
cartpos sci
Definition: convertdef.h:738
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:491
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:855
mathlib include file
posstruc pos
posstruc for this time.
Definition: convertdef.h:881
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:376
gvector s
Position vector.
Definition: convertdef.h:263
double ma
Definition: convertdef.h:1027
rmatrix j2b
Transform from ICRF to Body frame.
Definition: convertdef.h:694
Cartesian position with time.
Definition: convertdef.h:215
Definition: eci2kep_test.cpp:33
double mm
Definition: convertdef.h:1025
qatt topo
Definition: convertdef.h:826
double ap
Argument of Perigee.
Definition: convertdef.h:551
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:702
quaternion s
0th derivative: Quaternion
Definition: convertdef.h:479
double i
Definition: convertdef.h:1015
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:716
double i
Orbital Inclination in radians.
Definition: convertdef.h:547
svector v
Velocity vector.
Definition: convertdef.h:320
extraatt extra
Definition: convertdef.h:831
cartpos eci
Definition: convertdef.h:737
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:889
rmatrix b2j
Transform from Body frame to ICRF.
Definition: convertdef.h:696
rmatrix dj2e
Definition: convertdef.h:591
double beta
Solar Beta Angle in radians.
Definition: convertdef.h:544
double a
Semi-Major Axis in meters.
Definition: convertdef.h:538
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:80
geoidpos geod
Definition: convertdef.h:741
rvector a
Definition: convertdef.h:413
rmatrix e2j
Transform from Geocentric to ICRF.
Definition: convertdef.h:594
svector a
Acceleration vector.
Definition: convertdef.h:322
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:762
cartpos icrf
Definition: convertdef.h:736
Definition: convertdef.h:823
double ea
Eccentric Anomoly.
Definition: convertdef.h:559
rmatrix s2t
Definition: convertdef.h:601
3 element geodetic vector
Definition: vector.h:222
size_t count
Number of positions.
Definition: convertdef.h:1002
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:256
rmatrix j2t
Definition: convertdef.h:597
gvector v
Velocity vector.
Definition: convertdef.h:265
double raan
Definition: convertdef.h:1019
Definition: convertdef.h:876
rmatrix j2e
Transform from ICRF to Geocentric.
Definition: convertdef.h:590
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:176
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:452
rvector v
Velocity.
Definition: convertdef.h:165
Definition: eci2kep_test.cpp:33
json11::Json to_json() const
Convert class contents to JSON object.
Definition: convertdef.h:275
rmatrix s
0th derivative
Definition: convertdef.h:427
double alat
Argument of Latitude.
Definition: convertdef.h:553