Skip to content
Snippets Groups Projects
Commit 4aa917e8 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Allow slight overshoot in interpolation.

parent 0d10404e
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,9 @@ public class SpacecraftToObservedBody { ...@@ -44,6 +44,9 @@ public class SpacecraftToObservedBody {
/** End of search time span. */ /** End of search time span. */
private final AbsoluteDate maxDate; private final AbsoluteDate maxDate;
/** Tolerance in seconds allowed for {@code minDate} and {@code maxDate} overshooting. */
private final double overshootTolerance;
/** Step to use for inertial frame to body frame transforms cache computations. */ /** Step to use for inertial frame to body frame transforms cache computations. */
private final double tStep; private final double tStep;
...@@ -80,8 +83,9 @@ public class SpacecraftToObservedBody { ...@@ -80,8 +83,9 @@ public class SpacecraftToObservedBody {
throws RuggedException { throws RuggedException {
try { try {
this.minDate = minDate; this.minDate = minDate;
this.maxDate = maxDate; this.maxDate = maxDate;
this.overshootTolerance = overshootTolerance;
// safety checks // safety checks
final AbsoluteDate minPVDate = positionsVelocities.get(0).getDate(); final AbsoluteDate minPVDate = positionsVelocities.get(0).getDate();
...@@ -218,10 +222,10 @@ public class SpacecraftToObservedBody { ...@@ -218,10 +222,10 @@ public class SpacecraftToObservedBody {
throws RuggedException { throws RuggedException {
// check date range // check date range
if (date.compareTo(minDate) < 0) { if (minDate.durationFrom(date) > overshootTolerance) {
throw new RuggedException(RuggedMessages.OUT_OF_TIME_RANGE, date, minDate, maxDate); throw new RuggedException(RuggedMessages.OUT_OF_TIME_RANGE, date, minDate, maxDate);
} }
if (date.compareTo(maxDate) > 0) { if (date.durationFrom(maxDate) > overshootTolerance) {
throw new RuggedException(RuggedMessages.OUT_OF_TIME_RANGE, date, minDate, maxDate); throw new RuggedException(RuggedMessages.OUT_OF_TIME_RANGE, date, minDate, maxDate);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment