Telemetry¶
get_telemetry(channels, start_time, end_time, side='', site=default_site, xargs={})
Arguments¶
channels: A list of channels.
A channel is defined by a list [ system, stream, channel ]
Example channel: [‘env’, ‘lbt_weather’, ‘temperature’]
start_time: ‘YYYY-MM-DD HH:MM’ in UT
end_time: ‘YYYY-MM-DD HH:MM’ in UT
side: ‘sx’, ‘dx’, or ‘’ (both sides when applicable)
site: ‘tucson’, ‘mountain’, ‘https://x.y.z’
xargs: optional arguments
supported:
{ ‘lttb’: [‘fixed’, 1000 ]} # downsample using a fixed numer
{ ‘lttb’: [‘scaled’, 3600 ]} # downscale factor from extracted data length
{ ‘reduce’: True } # remove sequential duplicate point
{ ‘parallel’: True } # parallel data extraction
{ ‘kind’: “time” } # unused, may allow scatter XY
{ ‘decimate’: 60 } # downsample every X seconds (only supported for mongodb channels)
Return Value¶
A dictionary with keys:
data = the raw data
clipped = currently unused
msg = empty if succes, description of the issue if an error occured
series = the massaged raw data as timeseries named tuples
Example¶
from lbto.dms import get_telemetry
data = get_telemetry([
['alta', 'daily', 'temp']
, ['env', 'lbt_weather', 'temperature']]
, '2019-09-19 00:00'
, '2019-09-19 14:00')
raw = data['data']['env.lbt_weather']['']['temperature']
ts, val = data['series']['env.lbt_weather.temperature']