light travel hours in struct

This commit is contained in:
Agnes Heppich
2018-12-27 20:05:18 -05:00
parent 920759132d
commit 60071a0401
4 changed files with 8 additions and 18 deletions

View File

@@ -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()) {

View File

@@ -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;
};
}

View File

@@ -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);
}

View File

@@ -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;