Threshold for altitude changes
My altimeter pressure sensor does have 0.3m fluctuation and I'm unable to filter them away with locus because locus does record each 0.1m altitude change.
It doesn't help to change altitude filter light to filter very strong because it does only smooth changes out a little bit.
And I notice that some flattening does happen on track save action. It does get reduced from 69m record climb value to 41m climb in saved track statistics on 2 hours testrun on same position. Well my pressure sensor is accurate enoght that even a simple integer convertion would nearly solve this issue.
What about a threshold for altitude changes? Store only new hight values if a specific amount of climb or descent change is reached?
We don't need to round, we just need to skip altitude change flickering from uphill to downhill.
Example
messurement after filtering -> value which get recorded with threshold handling
stard with "record climb only until 1.0m descent"
100.1 -> 100.1
100.4 -> 100.4
100.2 -> 100.4
100.3 -> 100.4
100.5 -> 100.5
100.7 -> 100.7
100.9 -> 100.9
101.1 -> 101.1
100.9 -> 101.1
101.2 -> 101.2
100.9 -> 101.2
100.4 -> 101.2
100.2 -> 100.2 (1.0m threashold reached, switch to descent mode, record decent only until 1.0m climb)
99.9 -> 99.9
100.1 -> 99.9
99.7 -> 99.7
Important: threshold handling have to be applied after filtering because not filtered values would easily hit the threshold.
There is only one minor problem: we get a rough transition from 101.2 to 100.2 but this could easyily fixed by postprocessing on track save if we care about it.
I don't like postprocessing solutions for the whole problem because I would like to rely on the record screen climb indicator.
I did create a sqllite trigger as an prove of concept to find out who well a threshold would work:
Results are impressive:I did write a trigger to get a partial locus integration. This workarround will work only on saved tracks and isn't efficient because of the limitations of SQLlite Triggers. And I can't use this trigger to fix my track recording screen. I need to save the track to trigger altitude threashold filter.
I did create a sqllite trigger as an prove of concept to find out who well a threshold would work:
Results are impressive:I did write a trigger to get a partial locus integration. This workarround will work only on saved tracks and isn't efficient because of the limitations of SQLlite Triggers. And I can't use this trigger to fix my track recording screen. I need to save the track to trigger altitude threashold filter.
Currently I work on a tasker solution based on locus/data/seonsors/ files to extract pressure values. This would even work without GPS.
- use only pressure changes (no calebration needed)
- apply pressure to altitute change calculation based on hight
- calculate pressure change by darksky to remove weather related climb and descent meters.
- apply threshold on altitue change calculation
- display the result as popup
I need to use stream based solutions on comandline like awk for this because tasker read file to memory is to slow because it take a while to move 30mb of sensor data to script execution or other tasks.
Basically I will use 2 Workarrounds:
Currently I work on a tasker solution based on locus/data/seonsors/ files to extract pressure values. This would even work without GPS.
- use only pressure changes (no calebration needed)
- apply pressure to altitute change calculation based on hight
- calculate pressure change by darksky to remove weather related climb and descent meters.
- apply threshold on altitue change calculation
- display the result as popup
I need to use stream based solutions on comandline like awk for this because tasker read file to memory is to slow because it take a while to move 30mb of sensor data to script execution or other tasks.
Basically I will use 2 Workarrounds:
Hi Falco, I haven't caught too much about your example and further comments but I totally agree that a filtering threshold could be a solution. As a matter of fact I thought that the existing filtering is based on this concept but maybe not. Cumulative elevation error is one of the major issues with locus., Threshold correction/filtering could be applied diredtly during track recording but also with postprocessing, thus allowing to save the corrected track but also keep the original measurement and to try several corrections with different thresholds .
Hi Falco, I haven't caught too much about your example and further comments but I totally agree that a filtering threshold could be a solution. As a matter of fact I thought that the existing filtering is based on this concept but maybe not. Cumulative elevation error is one of the major issues with locus., Threshold correction/filtering could be applied diredtly during track recording but also with postprocessing, thus allowing to save the corrected track but also keep the original measurement and to try several corrections with different thresholds .
I did work on the 2nd Workarround "read sensor data log for calculating live recording climb elevation"
Here is the main part, the awk script for parsing locus sensor log:
prmulti is the elevation related static value for meters per pressure And 0.15 is my threshold simular to database trigger workarround (0.15 pressure * 9 = 1,35m threshold) Here an example 270km roadcycle tour to leipzig without any major climbs
As you see it is very close to smoothed SRTM data. I would say SRMT is the correct result because I did select the test tour based on the small very even hills to get a nerly perfect SRTM result as base.
It's interesting to see that even the 1.0m threshold database trigger is not enoght to get close to the SRTM result. And point reduction with Reumann Witkam and 5m corridor does kill the elevation on road tours because there are many segments which goes straight over many small hills like a huge pumptrack.
I did attach 14MB of Sensor data if somebody want to play with. There are 300 000 Lines. And the awk scripts does parse and calculate all of them in just 7 seconds on my sony phone. (5 seconds if you merge both awk scripts and skip the whole print and parse step between them)
If somebody ask why I don't use smoothed SRTM if this is the truth: SRTM does only work on small elevation changes far away from steep trails or even canyon like things. I would to get flat country SRTM accuracy in the middle of the mountains with canyons and trails on the edge of the mountain. And this is only possible with barometric values.
I did work on the 2nd Workarround "read sensor data log for calculating live recording climb elevation"
Here is the main part, the awk script for parsing locus sensor log:
prmulti is the elevation related static value for meters per pressure And 0.15 is my threshold simular to database trigger workarround (0.15 pressure * 9 = 1,35m threshold) Here an example 270km roadcycle tour to leipzig without any major climbs
As you see it is very close to smoothed SRTM data. I would say SRMT is the correct result because I did select the test tour based on the small very even hills to get a nerly perfect SRTM result as base.
It's interesting to see that even the 1.0m threshold database trigger is not enoght to get close to the SRTM result. And point reduction with Reumann Witkam and 5m corridor does kill the elevation on road tours because there are many segments which goes straight over many small hills like a huge pumptrack.
I did attach 14MB of Sensor data if somebody want to play with. There are 300 000 Lines. And the awk scripts does parse and calculate all of them in just 7 seconds on my sony phone. (5 seconds if you merge both awk scripts and skip the whole print and parse step between them)
If somebody ask why I don't use smoothed SRTM if this is the truth: SRTM does only work on small elevation changes far away from steep trails or even canyon like things. I would to get flat country SRTM accuracy in the middle of the mountains with canyons and trails on the edge of the mountain. And this is only possible with barometric values.
Here is my tasker task for calculating weather related climb and descent errors
It does need %SENSORS_DIR = /sdcard/Locus/data/sensors
and %DARKSKYAPI = free api key for dark sky weather
Here is my tasker task for calculating weather related climb and descent errors
It does need %SENSORS_DIR = /sdcard/Locus/data/sensors
and %DARKSKYAPI = free api key for dark sky weather
And here is my Tasker Task for calculating elevation based on sensor pressure (does even work if you turn GPS off) and just for fun a weather data correction of the elevation based on first GPS position and recording timespan :D
I did add pointsPerSec and maxTimeGap to my awk sensor data parser to track if I lost any sensor data to give me the opportunity to judge the output elevation accuracy. For example in a deep power saving mode I get sensor readouts every 5 minutes which could be accurate enoght if the max time gap between 2 values do not exceed 5 minutes
Don't forgett
%SENSORS_DIR = /sdcard/Locus/data/sensors
and %DARKSKYAPI = free api key for dark sky weather
AWK script optimizations did make alot of fun, it was a little bit difficult to find out how to get the first data line (2nd line) without dooing 300.000 times if(linenumer == 2)
And here is my Tasker Task for calculating elevation based on sensor pressure (does even work if you turn GPS off) and just for fun a weather data correction of the elevation based on first GPS position and recording timespan :D
I did add pointsPerSec and maxTimeGap to my awk sensor data parser to track if I lost any sensor data to give me the opportunity to judge the output elevation accuracy. For example in a deep power saving mode I get sensor readouts every 5 minutes which could be accurate enoght if the max time gap between 2 values do not exceed 5 minutes
Don't forgett
%SENSORS_DIR = /sdcard/Locus/data/sensors
and %DARKSKYAPI = free api key for dark sky weather
AWK script optimizations did make alot of fun, it was a little bit difficult to find out how to get the first data line (2nd line) without dooing 300.000 times if(linenumer == 2)
Here are some bugfixes, performance improvement for the workarround and a task which get the date of the current selected track. If there is any Date string on current screen the task will use this as date for the calculation if you want to calculate elevation of recorded track from last week with sensor data instead of using track data.
If no date got found it use the current date to support calculation during track recording.
GetLocusDate needs AutoInput plugin to read screen labels. WeatherElevation need a darksky api key and internet and LocusSensorElevation need busybox or similar toolsets to get awk.
Here are some bugfixes, performance improvement for the workarround and a task which get the date of the current selected track. If there is any Date string on current screen the task will use this as date for the calculation if you want to calculate elevation of recorded track from last week with sensor data instead of using track data.
If no date got found it use the current date to support calculation during track recording.
GetLocusDate needs AutoInput plugin to read screen labels. WeatherElevation need a darksky api key and internet and LocusSensorElevation need busybox or similar toolsets to get awk.
Replies have been locked on this page!