Skip to content

Commit

Permalink
script to test GPS anomalies in the runBENrun data
Browse files Browse the repository at this point in the history
script to test GPS anomalies in the runBENrun data
  • Loading branch information
bspauld committed Jan 28, 2017
1 parent ad8b5ef commit e618257
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions runanomalies.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
script: runanomalies.sql
purpose: script to test GPS anomalies in the runBENrun data
instructions: run the script
*/


select i.runid,
i.dateval,
count(*) as TotalPoints,
count(distinct p.finaltimecounter) as TotalDistinctTimePoints,
(count(*)-count(distinct p.finaltimecounter)) as PercentPoints,
cast(i.rundist as float) as RunDist,
case
when count(distinct p.finaltimecounter) < count(*) then 'Bad GPS'
when count(distinct p.finaltimecounter) > count(*) then 'Huh?'
when count(distinct p.finaltimecounter) = count(*) then 'Good GPS'
else 'Unknown'
end as GPSTest
from public.rbr_AllRuns_2016_Points p inner join public.rbr_AllRuns_2016_ID i on p.runid = i.runid
group by i.runid,i.rundist,i.dateval
order by i.runid;

0 comments on commit e618257

Please sign in to comment.