Latency#
Demonstrate synoptic.services.Latency
Tells you how long it takes an observation to get to Synoptic’s servers
[1]:
from synoptic import Latency
from datetime import datetime, timedelta
[4]:
df = Latency(
stid="wbb",
start=datetime(2024, 6, 6),
end=datetime(2024, 6, 6, 1),
).df()
df
🚚💨 Speedy delivery from Synoptic's latency service.
📦 Received data from 1 stations (0.25 seconds).
[4]:
shape: (61, 16)
| stid | date_time | values | id | name | elevation | latitude | longitude | mnet_id | state | timezone | restricted_data | restricted_metadata | period_of_record_start | period_of_record_end | is_active |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| str | str | i64 | u32 | str | f64 | f64 | f64 | u32 | str | str | str | i64 | datetime[μs, UTC] | datetime[μs, UTC] | bool |
| "WBB" | "2024-06-06T00:00:00Z" | 5 | 1 | "U of U William Browning Buildi… | 4806.0 | 40.76623 | -111.84755 | 153 | "UT" | "America/Denver" | "0" | 0 | 1997-01-01 00:00:00 UTC | 2024-12-19 05:55:00 UTC | true |
| "WBB" | "2024-06-06T00:01:00Z" | 9 | 1 | "U of U William Browning Buildi… | 4806.0 | 40.76623 | -111.84755 | 153 | "UT" | "America/Denver" | "0" | 0 | 1997-01-01 00:00:00 UTC | 2024-12-19 05:55:00 UTC | true |
| "WBB" | "2024-06-06T00:02:00Z" | 8 | 1 | "U of U William Browning Buildi… | 4806.0 | 40.76623 | -111.84755 | 153 | "UT" | "America/Denver" | "0" | 0 | 1997-01-01 00:00:00 UTC | 2024-12-19 05:55:00 UTC | true |
| "WBB" | "2024-06-06T00:03:00Z" | 7 | 1 | "U of U William Browning Buildi… | 4806.0 | 40.76623 | -111.84755 | 153 | "UT" | "America/Denver" | "0" | 0 | 1997-01-01 00:00:00 UTC | 2024-12-19 05:55:00 UTC | true |
| "WBB" | "2024-06-06T00:04:00Z" | 6 | 1 | "U of U William Browning Buildi… | 4806.0 | 40.76623 | -111.84755 | 153 | "UT" | "America/Denver" | "0" | 0 | 1997-01-01 00:00:00 UTC | 2024-12-19 05:55:00 UTC | true |
| … | … | … | … | … | … | … | … | … | … | … | … | … | … | … | … |
| "WBB" | "2024-06-06T00:56:00Z" | 8 | 1 | "U of U William Browning Buildi… | 4806.0 | 40.76623 | -111.84755 | 153 | "UT" | "America/Denver" | "0" | 0 | 1997-01-01 00:00:00 UTC | 2024-12-19 05:55:00 UTC | true |
| "WBB" | "2024-06-06T00:57:00Z" | 7 | 1 | "U of U William Browning Buildi… | 4806.0 | 40.76623 | -111.84755 | 153 | "UT" | "America/Denver" | "0" | 0 | 1997-01-01 00:00:00 UTC | 2024-12-19 05:55:00 UTC | true |
| "WBB" | "2024-06-06T00:58:00Z" | 6 | 1 | "U of U William Browning Buildi… | 4806.0 | 40.76623 | -111.84755 | 153 | "UT" | "America/Denver" | "0" | 0 | 1997-01-01 00:00:00 UTC | 2024-12-19 05:55:00 UTC | true |
| "WBB" | "2024-06-06T00:59:00Z" | 5 | 1 | "U of U William Browning Buildi… | 4806.0 | 40.76623 | -111.84755 | 153 | "UT" | "America/Denver" | "0" | 0 | 1997-01-01 00:00:00 UTC | 2024-12-19 05:55:00 UTC | true |
| "WBB" | "2024-06-06T01:00:00Z" | 2 | 1 | "U of U William Browning Buildi… | 4806.0 | 40.76623 | -111.84755 | 153 | "UT" | "America/Denver" | "0" | 0 | 1997-01-01 00:00:00 UTC | 2024-12-19 05:55:00 UTC | true |
[ ]:
# TODO: Need to unnest and cast statistic columns
df = Latency(
stid="ukbkb",
start=datetime(2024, 6, 6),
end=datetime(2024, 6, 6, 0, 30),
stats="all",
).df()
df.unnest("statistics")
🚚💨 Speedy delivery from Synoptic's latency service.
📦 Received data from 1 stations (0.24 seconds).
shape: (3, 26)
| stid | date_time | values | id | name | elevation | latitude | longitude | mnet_id | state | timezone | restricted_data | restricted_metadata | period_of_record_start | period_of_record_end | start | end | maxtime | mintime | count | average | maximum | minimum | standard_deviation | median | is_active |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| str | str | i64 | u32 | str | f64 | f64 | f64 | u32 | str | str | str | i64 | datetime[μs, UTC] | datetime[μs, UTC] | str | str | str | str | f64 | f64 | f64 | f64 | f64 | f64 | bool |
| "UKBKB" | "2024-06-06T00:00:00Z" | 6 | 37032 | "EW2355 Spanish Fork" | 4734.0 | 40.09867 | -111.62767 | 65 | "UT" | "America/Denver" | "0" | 0 | 2013-03-13 00:00:00 UTC | 2024-12-19 06:00:00 UTC | "202406060000" | "202406060030" | "2024-06-06T00:00:00Z" | "2024-06-06T00:15:00Z" | 3.0 | 5.333333 | 6.0 | 5.0 | 0.471405 | 5.0 | true |
| "UKBKB" | "2024-06-06T00:15:00Z" | 5 | 37032 | "EW2355 Spanish Fork" | 4734.0 | 40.09867 | -111.62767 | 65 | "UT" | "America/Denver" | "0" | 0 | 2013-03-13 00:00:00 UTC | 2024-12-19 06:00:00 UTC | "202406060000" | "202406060030" | "2024-06-06T00:00:00Z" | "2024-06-06T00:15:00Z" | 3.0 | 5.333333 | 6.0 | 5.0 | 0.471405 | 5.0 | true |
| "UKBKB" | "2024-06-06T00:30:00Z" | 5 | 37032 | "EW2355 Spanish Fork" | 4734.0 | 40.09867 | -111.62767 | 65 | "UT" | "America/Denver" | "0" | 0 | 2013-03-13 00:00:00 UTC | 2024-12-19 06:00:00 UTC | "202406060000" | "202406060030" | "2024-06-06T00:00:00Z" | "2024-06-06T00:15:00Z" | 3.0 | 5.333333 | 6.0 | 5.0 | 0.471405 | 5.0 | true |