esc
Start typing to search the docs
Navigate Open

Measurements

⚠️ This type is unstable and may change significantly in a way that the data won't be backwards compatible. One or more scalar measurements, each with a variance and a unit.

Use this for sensors that report a value together with its uncertainty: pressure, temperature, illuminance, relative humidity, range, and so on.

In a views.TimeSeriesView each series is drawn as a line with a translucent band around it, one standard deviation (the square root of the variance) wide in each direction. Leave variances unset if the uncertainty is unknown.

The current timeline value is used for the time/X-axis, so measurements should not be static. Number of values per timestamp is expected to be the same over time.

Unlike archetypes.Scalars, this archetype carries its own styling, so values and style are logged together. Changes over time are supported for most but not all styling fields (see respective fields for details).

Fields

Required

Optional

Can be shown in

Example

Pressure with variance

"""Log scalar measurements with variances over time."""

import math

import rerun as rr

rr.init("rerun_example_measurements_simple", spawn=True)

# Two parallel pressure sensors (in Pa), each with slowly drifting variance.
for step in range(64):
    rr.set_time("step", sequence=step)
    pressures = [
        101_325.0 + 50.0 * math.sin(step / 10.0),
        101_300.0 + 30.0 * math.cos(step / 8.0),
    ]
    variances = [
        100.0 + 25.0 * math.sin(step / 7.0),
        80.0 + 15.0 * math.cos(step / 11.0),
    ]
    rr.log(
        "pressure",
        rr.Measurements(values=pressures, variances=variances, units="Pa"),
    )