mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-27 22:49:39 -06:00
light travel hours in struct
This commit is contained in:
@@ -105,7 +105,7 @@ namespace openspace {
|
||||
position.dec = pos["DecDn"].get<double>();
|
||||
position.range = pos["GeoRngDn"].get<double>();
|
||||
position.lightTravelTime = pos["DLT"].get<double>();
|
||||
_lightTravelHours = ceil(position.lightTravelTime / 3600);
|
||||
position.lightTravelHours = ceil(position.lightTravelTime / 3600);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
LERROR(fmt::format("{}: Error in json object number {} while reading file '{}'", objectIdentifier, objectCounter, filename));
|
||||
@@ -164,8 +164,8 @@ namespace openspace {
|
||||
|
||||
// if our light travel time is longer than an hour,
|
||||
// compensate the position parsing index
|
||||
if (_lightTravelHours > 1) {
|
||||
index = index + _lightTravelHours;
|
||||
if (position.lightTravelHours > 1) {
|
||||
index = index + position.lightTravelHours;
|
||||
}
|
||||
|
||||
if (index >= _dataFiles.size()) {
|
||||
|
||||
@@ -43,6 +43,7 @@ namespace openspace {
|
||||
mutable double dec;
|
||||
mutable double range;
|
||||
mutable double lightTravelTime; //Downlink light time travel time in seconds
|
||||
mutable double lightTravelHours = 1; //Downlink light time travel time in seconds
|
||||
};
|
||||
|
||||
//Used to determine if we need to search for new data
|
||||
@@ -85,7 +86,7 @@ namespace openspace {
|
||||
|
||||
private:
|
||||
/* Our light travel positioning compensation, expressed in hours */
|
||||
mutable int _lightTravelHours = 1;
|
||||
// mutable int _lightTravelHours = 1;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -143,15 +143,6 @@ glm::dvec3 RadecTranslation::radecToCartesianCoordinates(glm::vec3 pos) const {
|
||||
glm::dvec3 RadecTranslation::position(const UpdateData& data) const{
|
||||
double time = data.time.j2000Seconds();
|
||||
|
||||
//if (!radecManager.timeDoubles.size() || time == -1) {
|
||||
// LERROR(fmt::format("{}: Did not manage to extract position for {}.", _identifier, radecManager.objectIdentifier.c_str()));
|
||||
// return _position;
|
||||
//}
|
||||
|
||||
if (radecManager.objectIdentifier == "Cassini" || radecManager.objectIdentifier== "StereoB") {
|
||||
LDEBUG(fmt::format("{}: Did not manage to extract position for {}.", _identifier, radecManager.objectIdentifier.c_str()));
|
||||
}
|
||||
|
||||
const bool haveDataForTime = (time >= _firstTimeInData) && (time < _lastTimeInData);
|
||||
|
||||
if (haveDataForTime) {
|
||||
@@ -162,7 +153,7 @@ glm::dvec3 RadecTranslation::position(const UpdateData& data) const{
|
||||
glm::dvec3 radecPos = radecManager.getPosForTime(_firstTimeInData);
|
||||
_position = radecToCartesianCoordinates(radecPos);
|
||||
}
|
||||
else { // time > _lastTimeWithData
|
||||
else {
|
||||
glm::dvec3 radecPos = radecManager.getPosForTime(_lastTimeInData);
|
||||
_position = radecToCartesianCoordinates(radecPos);
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ public:
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
private:
|
||||
double _firstTimeInData = -1;
|
||||
double _lastTimeInData = -1;
|
||||
double _firstTimeInData = 0;
|
||||
double _lastTimeInData = 0;
|
||||
|
||||
RadecManager radecManager;
|
||||
///Converts the Ra Dec range coordinates into cartesian coordinates
|
||||
@@ -61,8 +61,6 @@ private:
|
||||
glm::dvec3 radecToCartesianCoordinates(glm::vec3 pos) const;
|
||||
///Translated position
|
||||
mutable glm::dvec3 _position = {0.0,0.0,0.0};
|
||||
///Determines between what dates there is data available. Set in the asset file.
|
||||
double _dataStart, _dataEnd;
|
||||
///Determines how many minutes between updates in positioning data
|
||||
properties::FloatProperty _updateFrequency;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user