mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-30 15:57:11 +00:00
Fixed access to average speed for supplied angle and windspeed
This commit is contained in:
1 parent
4ce4641e3d
commit
97e7a9d183
3 files changed
+8
-5
No files matched your search
+1
-1
@@ -165,7 +165,7 @@ public class PolarDataServiceImpl implements PolarDataService {
|
||||
@Override
|
||||
public PolynomialFunction getSpeedRegressionFunction(BoatClass boatClass, double trueWindAngle)
|
||||
throws NotEnoughDataHasBeenAddedException {
|
||||
return polarDataMiner.getSpeedRegressionFunction(boatClass, trueWindAngle);
|
||||
return polarDataMiner.getSpeedRegressionFunction(boatClass, Math.abs(trueWindAngle));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-3
@@ -72,10 +72,13 @@ public class GPSFixMovingWithPolarContext implements MovingAveragePolarClusterKe
|
||||
|
||||
private BearingWithConfidence<Void> computeTrueWindAngleAbsolute() {
|
||||
BearingWithConfidenceImpl<Void> result = null;
|
||||
Bearing bearing;
|
||||
Bearing bearing = null;
|
||||
try {
|
||||
Bearing realBearing = race.getCurrentLeg(competitor, fix.getTimePoint()).getBeatAngle(fix.getTimePoint());
|
||||
bearing = new DegreeBearingImpl(Math.abs(realBearing.getDegrees()));
|
||||
TrackedLegOfCompetitor currentLeg = race.getCurrentLeg(competitor, fix.getTimePoint());
|
||||
if (currentLeg != null) {
|
||||
Bearing realBearing = currentLeg.getBeatAngle(fix.getTimePoint());
|
||||
bearing = new DegreeBearingImpl(Math.abs(realBearing.getDegrees()));
|
||||
}
|
||||
} catch (NoWindException e) {
|
||||
bearing = null;
|
||||
}
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ public class SpeedRegressionPerAngleClusterProcessor implements Processor<Groupe
|
||||
double speedSum = 0;
|
||||
double numberOfSpeeds = 0;
|
||||
for (int i = -5; i <= 5; i++) {
|
||||
GroupKey key = createGroupKey(boatClass, new DegreeBearingImpl(trueWindAngle.getDegrees() + i));
|
||||
GroupKey key = createGroupKey(boatClass, new DegreeBearingImpl(Math.abs(trueWindAngle.getDegrees()) + i));
|
||||
if (regressions.containsKey(key)) {
|
||||
speedSum += regressions.get(key).getOrCreatePolynomialFunction().value(windSpeed.getKnots());
|
||||
numberOfSpeeds++;
|
||||
|
||||
Reference in new issue
Block a user