Metropolitan-Council / tc.sensors

Package with functions to pull sensor data, sensor IDs, and sensor configuration for MnDOT metro district
https://metropolitan-council.github.io/tc.sensors
Other
1 stars 0 forks source link

Calculate speed function + vignette #7

Closed eroten closed 4 years ago

eroten commented 4 years ago

Write function and vignette for calculating speed from pull_sensor() return

ashleyasmus commented 4 years ago

For hourly speed data I do:

  # CALCULATE SPEED --- 
    hourlydat_sensor[,occupancy.pct := (occupancy.sum/216000)]
    hourlydat_sensor[,speed:=ifelse(volume.sum != 0, 
                                    (volume.sum*detector_field)/(5280*occupancy.pct), 0)]
eroten commented 4 years ago

What intervals do you think are needed? Hourly, time periods (morning rush, evening rush), daily?

eroten commented 4 years ago

Speed was integrated into aggregate_sensor() in PR #12