COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems

#include <convertdef.h>

Collaboration diagram for posstruc:

Public Member Functions

json11::Json to_json () const
 Convert class contents to JSON object. More...
 
void from_json (const string &js)
 Set class contents from JSON string. More...
 

Public Attributes

double utc = 0.
 
cartpos icrf
 
cartpos eci
 
cartpos sci
 
cartpos geoc
 
cartpos selc
 
geoidpos geod
 
geoidpos selg
 
spherpos geos
 
extrapos extra
 
float earthsep = 0.f
 Separation between sun/satellite and sun/limbofearth vectors in radians. More...
 
float moonsep = 0.f
 Separation between sun/satellite and sun/limbofmoon vectors in radians. More...
 
float sunsize = 0.f
 Radius of sun in radians. More...
 
float sunradiance = 0.f
 Watts per square meter per steradian. More...
 
rvector bearth
 Earth magnetic vector in ITRS for this time and location. More...
 
double orbit = 0.
 Decimal Orbit number. More...
 

Member Function Documentation

json11::Json posstruc::to_json ( ) const
inline

Convert class contents to JSON object.

Returns a json11 JSON object of the class

Returns
A json11 JSON object containing every member variable within the class
762  {
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  }
rvector bearth
Earth magnetic vector in ITRS for this time and location.
Definition: convertdef.h:754
std::map< std::string, Json > object
Definition: json11.hpp:88
double orbit
Decimal Orbit number.
Definition: convertdef.h:756
spherpos geos
Definition: convertdef.h:743
cartpos selc
Definition: convertdef.h:740
cartpos geoc
Definition: convertdef.h:739
float moonsep
Separation between sun/satellite and sun/limbofmoon vectors in radians.
Definition: convertdef.h:748
float earthsep
Separation between sun/satellite and sun/limbofearth vectors in radians.
Definition: convertdef.h:746
float sunradiance
Watts per square meter per steradian.
Definition: convertdef.h:752
geoidpos selg
Definition: convertdef.h:742
double utc
Definition: convertdef.h:735
extrapos extra
Definition: convertdef.h:744
cartpos sci
Definition: convertdef.h:738
float sunsize
Radius of sun in radians.
Definition: convertdef.h:750
cartpos eci
Definition: convertdef.h:737
geoidpos geod
Definition: convertdef.h:741
cartpos icrf
Definition: convertdef.h:736
void posstruc::from_json ( const string &  js)
inline

Set class contents from JSON string.

Parses the provided JSON-formatted string and sets the class data. String should be formatted like the string returned from to_json()

Parameters
sJSON-formatted string to set class contents to
Returns
n/a
790  {
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  }
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
Definition: json11.hpp:79
double orbit
Decimal Orbit number.
Definition: convertdef.h:756
spherpos geos
Definition: convertdef.h:743
cartpos selc
Definition: convertdef.h:740
cartpos geoc
Definition: convertdef.h:739
float moonsep
Separation between sun/satellite and sun/limbofmoon vectors in radians.
Definition: convertdef.h:748
float earthsep
Separation between sun/satellite and sun/limbofearth vectors in radians.
Definition: convertdef.h:746
float sunradiance
Watts per square meter per steradian.
Definition: convertdef.h:752
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:192
geoidpos selg
Definition: convertdef.h:742
void dump(std::string &out) const
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:346
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:291
double utc
Definition: convertdef.h:735
extrapos extra
Definition: convertdef.h:744
cartpos sci
Definition: convertdef.h:738
float sunsize
Radius of sun in radians.
Definition: convertdef.h:750
cartpos eci
Definition: convertdef.h:737
void from_json(const string &s)
Set class contents from JSON string.
Definition: vector.h:80
geoidpos geod
Definition: convertdef.h:741
cartpos icrf
Definition: convertdef.h:736

Member Data Documentation

double posstruc::utc = 0.
cartpos posstruc::icrf
cartpos posstruc::eci
cartpos posstruc::sci
cartpos posstruc::geoc
cartpos posstruc::selc
geoidpos posstruc::geod
geoidpos posstruc::selg
spherpos posstruc::geos
extrapos posstruc::extra
float posstruc::earthsep = 0.f

Separation between sun/satellite and sun/limbofearth vectors in radians.

float posstruc::moonsep = 0.f

Separation between sun/satellite and sun/limbofmoon vectors in radians.

float posstruc::sunsize = 0.f

Radius of sun in radians.

float posstruc::sunradiance = 0.f

Watts per square meter per steradian.

rvector posstruc::bearth

Earth magnetic vector in ITRS for this time and location.

double posstruc::orbit = 0.

Decimal Orbit number.


The documentation for this struct was generated from the following file: