37 #define _CONVERTDEF_H 1 49 #define CLIGHT 299792458. 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 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) 92 #define GEOC_HONOLULU {{-5588871.,-2278876.,2353191.}} 97 #define SGP4_CK2 5.413080E-4 98 #define SGP4_CK4 0.62098875E-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 110 #define JPL_MERCURY 1 114 #define JPL_JUPITER 5 117 #define JPL_NEPTUNE 8 121 #define JPL_SUN_BARY 12 122 #define JPL_EARTH_BARY 13 123 #define JPL_NUTATIONS 14 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 182 {
"pass",
static_cast<int>(
pass) }
196 if(!parsed[
"utc"].is_null()) utc = parsed[
"utc"].number_value();
200 if(!parsed[
"pass"].is_null()) pass = parsed[
"pass"].int_value();
202 cerr<<
"ERROR = "<<error<<endl;
243 if(!parsed[
"utc"].is_null()) utc = parsed[
"utc"].number_value();
244 if(!parsed[
"pos"].is_null()) pos.
from_json(parsed[
"pos"].
dump());
246 cerr <<
"ERROR = "<<error<<endl;
281 {
"pass",
static_cast<int>(
pass) }
295 if(!parsed[
"utc"].is_null()) utc = parsed[
"utc"].number_value();
299 if(!parsed[
"pass"].is_null()) pass = parsed[
"pass"].int_value();
301 cerr<<
"ERROR = "<<error<<endl;
336 {
"pass",
static_cast<int>(
pass) }
350 if(!parsed[
"utc"].is_null()) utc = parsed[
"utc"].number_value();
354 if(!parsed[
"pass"].is_null()) pass = parsed[
"pass"].int_value();
356 cerr<<
"ERROR = "<<error<<endl;
394 if(!parsed[
"utc"].is_null()) utc = parsed[
"utc"].number_value();
399 cerr<<
"ERROR = "<<error<<endl;
456 if(!parsed[
"utc"].is_null()) utc = parsed[
"utc"].number_value();
461 cerr<<
"ERROR = "<<error<<endl;
497 {
"pass" ,
static_cast<int>(
pass) }
511 if(!parsed[
"utc"].is_null()) utc = parsed[
"utc"].number_value();
515 if(!parsed[
"pass"].is_null()) pass = parsed[
"pass"].int_value();
517 cerr<<
"ERROR = "<<error<<endl;
607 uint16_t closest = 0;
637 {
"sun2earth" , sun2earth },
638 {
"sun2moon" , sun2moon },
639 {
"closest" , closest }
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();
660 if(!p[
"ddj2e"].is_null()) ddj2e.
from_json(p[
"ddj2e"].
dump());
664 if(!p[
"dde2j"].is_null()) dde2j.
from_json(p[
"dde2j"].
dump());
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();
679 cerr<<
"ERROR: <"<<error<<
">"<<endl;
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());
724 cerr<<
"ERROR = "<<error<<endl;
746 float earthsep = 0.f;
752 float sunradiance = 0.f;
775 {
"earthsep" , earthsep },
776 {
"moonsep" , moonsep },
777 {
"sunsize" , sunsize },
778 {
"sunradiance" , sunradiance },
779 {
"bearth" , bearth },
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());
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();
810 if(!parsed[
"bearth"].is_null()) bearth.
from_json(parsed[
"bearth"].
dump());
811 if(!parsed[
"orbit"].is_null()) orbit = parsed[
"orbit"].number_value();
814 cerr<<
"ERROR = "<<error<<endl;
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());
867 cerr<<
"ERROR = "<<error<<endl;
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());
911 cerr<<
"ERROR = "<<error<<endl;
926 uint16_t snumber = 0;
953 {
"snumber" , snumber },
962 {
"orbit" ,
static_cast<int>(orbit) }
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();
989 cerr<<
"ERROR = "<<error<<endl;
rvector bearth
Earth magnetic vector in ITRS for this time and location.
Definition: convertdef.h:754
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
Definition: eci2kep_test.cpp:33
double mm
Mean Motion.
Definition: convertdef.h:561
rvector v
Definition: convertdef.h:412
In units for the SGP4 propogator (not NORAD TLE itself).
Definition: convertdef.h:921
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
Quaternion, scalar last, using x, y, z.
Definition: vector.h:402
double utc
Definition: convertdef.h:410
avector v
Definition: convertdef.h:369
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:390
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
Definition: convertdef.h:1012
std::istream & operator>>(std::istream &in, cartpos &a)
Definition: convertlib.cpp:3908
qatt lvlh
Definition: convertdef.h:827
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
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
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
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
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
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
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
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
quaternion s
0th derivative: Quaternion
Definition: convertdef.h:479
double i
Definition: convertdef.h:1015
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
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
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
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
gvector v
Velocity vector.
Definition: convertdef.h:265
double raan
Definition: convertdef.h:1019
Definition: convertdef.h:876
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