test hdop-dependent turnaround detection threshold for GPX up/down analysis

This commit is contained in:
sonora 2015-09-25 18:09:09 +02:00
parent 05e0178716
commit 38830460c2

View file

@ -226,7 +226,8 @@ public class GPXUtilities {
double totalSpeedSum = 0;
points = 0;
double channelThres = 10;
double channelThresMin = 5; // Minimum oscillation amplitude considered as noise for Up/Down analysis
double channelThres = channelThresMin; // Actual oscillation amplitude considered as noise, try depedency on current hdop
double channelBase;
double channelTop;
double channelBottom;
@ -277,12 +278,19 @@ public class GPXUtilities {
channelBase = point.ele;
channelTop = channelBase;
channelBottom = channelBase;
channelThres = channelThresMin;
}
// Channel maintenance
if (point.ele > channelTop) {
channelTop = point.ele;
if (!Double.isNaN(point.hdop)) {
channelThres = Math.max(channelThres, point.hdop);
}
} else if (point.ele < channelBottom) {
channelBottom = point.ele;
if (!Double.isNaN(point.hdop)) {
channelThres = Math.max(channelThres, point.hdop);
}
}
// Turnaround (breakout) detection
if ((point.ele <= (channelTop - channelThres)) && (climb == true)) {
@ -292,6 +300,7 @@ public class GPXUtilities {
channelBase = channelTop;
channelBottom = point.ele;
climb = false;
channelThres = channelThresMin;
} else if ((point.ele >= (channelBottom + channelThres)) && (climb == false)) {
if ((channelBase - channelBottom) >= channelThres) {
diffElevationDown += channelBase - channelBottom;
@ -299,6 +308,7 @@ public class GPXUtilities {
channelBase = channelBottom;
channelTop = point.ele;
climb = true;
channelThres = channelThresMin;
}
// End detection without breakout
if (j == (numberOfPoints -1)) {