Documentation menu

Output formats

The output_format parameter chooses how time series and spectra are laid out in the JSON response.

View as Markdown

High-rate readings come back as series: a list of values, each with a time (or, for spectra, a frequency). The output_format parameter sets the layout of every series in a response. Single values, such as theta in the data table, are not affected.

The five formats

FormatLayout of one seriesExample
map (default)Object keyed by time or frequency{"1764547200000.0": 0.012}
tuple_arrayList of [time, value] pairs[[1764547200000, 0.012]]
dict_arrayList of objects[{"time": 1764547200000, "val": 0.012}]
combined_tupleAxes grouped in one list[[1764547200000, 0.012, -0.003, 0.998]]
combined_dictAxes grouped in one list of objects[{"time": 1764547200000, "x": 0.012, "y": -0.003, "z": 0.998}]

map

Each series is an object. The keys are strings, and the values are numbers. Time keys are milliseconds written as decimals, such as "1764547200019.53125", because a sample can fall between two whole milliseconds. Frequency keys are hertz with at least three digits before the point, such as "002.5". Parse keys as numbers; don't compare them as strings.

tuple_array and dict_array

Each series is a list, in time order. tuple_array gives [time, value] pairs. dict_array gives objects with time and val, or freq and val for spectra.

combined_tuple and combined_dict

These formats put the axes of one sensor side by side, so each row holds one moment for all axes:

GroupReplacesRow in combined_tupleKeys in combined_dict
accacc_x, acc_y, acc_z[time, x, y, z]time, x, y, z
gyrgyr_x, gyr_y, gyr_z[time, x, y, z]time, x, y, z
ainain_a, ain_b[time, a, b]time, a, b
fftfft_x, fft_y, fft_z[freq, x, y, z]freq, x, y, z

A group is only formed when all of its series are in the item. Other series in the same item, such as tamb in acc, use tuple_array under combined_tuple and dict_array under combined_dict.

Which fields are series

TableSeries fields
accacc_x, acc_y, acc_z, tamb, w_s, w_d
gyrgyr_x, gyr_y, gyr_z
ainain_a, ain_b
fftfft (with merge=false), or fft_x, fft_y, fft_z
dataw_s_avg
env, connectednone

The w_s_avg field is a short series of six wind-speed averages. In map format its keys are w_s_avg_0 to w_s_avg_5 instead of times; in the other formats each point has the time it belongs to. See data: summaries and tilt.