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 {
/** End of search time span. */
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. */
private final double tStep;
......@@ -80,8 +83,9 @@ public class SpacecraftToObservedBody {
throws RuggedException {
try {
this.minDate = minDate;
this.maxDate = maxDate;
this.minDate = minDate;
this.maxDate = maxDate;
this.overshootTolerance = overshootTolerance;
// safety checks
final AbsoluteDate minPVDate = positionsVelocities.get(0).getDate();
......@@ -218,10 +222,10 @@ public class SpacecraftToObservedBody {
throws RuggedException {
// check date range
if (date.compareTo(minDate) < 0) {
if (minDate.durationFrom(date) > overshootTolerance) {
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);
}
......
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