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; double totalSpeedSum = 0;
points = 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 channelBase;
double channelTop; double channelTop;
double channelBottom; double channelBottom;
@ -277,12 +278,19 @@ public class GPXUtilities {
channelBase = point.ele; channelBase = point.ele;
channelTop = channelBase; channelTop = channelBase;
channelBottom = channelBase; channelBottom = channelBase;
channelThres = channelThresMin;
} }
// Channel maintenance // Channel maintenance
if (point.ele > channelTop) { if (point.ele > channelTop) {
channelTop = point.ele; channelTop = point.ele;
if (!Double.isNaN(point.hdop)) {
channelThres = Math.max(channelThres, point.hdop);
}
} else if (point.ele < channelBottom) { } else if (point.ele < channelBottom) {
channelBottom = point.ele; channelBottom = point.ele;
if (!Double.isNaN(point.hdop)) {
channelThres = Math.max(channelThres, point.hdop);
}
} }
// Turnaround (breakout) detection // Turnaround (breakout) detection
if ((point.ele <= (channelTop - channelThres)) && (climb == true)) { if ((point.ele <= (channelTop - channelThres)) && (climb == true)) {
@ -292,6 +300,7 @@ public class GPXUtilities {
channelBase = channelTop; channelBase = channelTop;
channelBottom = point.ele; channelBottom = point.ele;
climb = false; climb = false;
channelThres = channelThresMin;
} else if ((point.ele >= (channelBottom + channelThres)) && (climb == false)) { } else if ((point.ele >= (channelBottom + channelThres)) && (climb == false)) {
if ((channelBase - channelBottom) >= channelThres) { if ((channelBase - channelBottom) >= channelThres) {
diffElevationDown += channelBase - channelBottom; diffElevationDown += channelBase - channelBottom;
@ -299,6 +308,7 @@ public class GPXUtilities {
channelBase = channelBottom; channelBase = channelBottom;
channelTop = point.ele; channelTop = point.ele;
climb = true; climb = true;
channelThres = channelThresMin;
} }
// End detection without breakout // End detection without breakout
if (j == (numberOfPoints -1)) { if (j == (numberOfPoints -1)) {