Skip to main content

Sensor Data Format

All sensor data in mindLAMP follows a consistent event-based format, making retrieval and analysis straightforward.

SensorEvent Structureโ€‹

{
"timestamp": 1649859212042,
"sensor": "lamp.gps",
"data": {
"latitude": 42.3601,
"longitude": -71.0589,
"altitude": 12.5,
"accuracy": 10.0
}
}
FieldTypeDescription
timestampintegerUnix timestamp in milliseconds when the data was collected
sensorstringThe SensorSpec identifier (e.g., lamp.gps, lamp.accelerometer)
dataobjectSensor-specific payload โ€” structure varies by sensor type

The data payload structure depends on the sensor. See the Sensor Reference for the fields produced by each sensor.

Data Retrievalโ€‹

Data can be retrieved through:

  • REST API โ€” Query sensor events for specific participants, time ranges, and types. See the API documentation.
  • Python SDK โ€” import LAMP for programmatic data access. See Python SDK.
  • Cortex โ€” Process raw events into computed behavioral features automatically. See Cortex.
  • Dashboard โ€” View and export data through the Data Portal or the Portal tab.

Cortex Analysisโ€‹

Sensor event data โ€” sometimes referred to as raw data โ€” is what the Cortex pipeline uses to calculate higher-level behavioral metrics. Cortex transforms this raw sensor data into behavioral insights through three stages:

  1. Raw features โ€” Retrieve sensor event data directly (e.g., gps, accelerometer, device_state).
  2. Primary features โ€” Compute intermediate metrics (e.g., significant_locations, trips, screen_active, acc_jerk).
  3. Secondary features โ€” Aggregate into behavioral measures (e.g., hometime, entropy, screen_duration, step_count).

See the Cortex documentation for details. For per-sensor schemas, see the Sensor Reference.

Deprecated Sensorsโ€‹

The following sensor identifiers have been superseded. Data collected under these identifiers may still appear in historical records. Cortex handles both old and new identifiers automatically.

Old SensorSpecReplaced ByNotes
lamp.gyroscopelamp.device_motionRotation data now in rotation sub-object
lamp.magnetometerlamp.device_motionMagnetic field data now in magnetic sub-object
lamp.screen_statelamp.device_stateIdentical schema โ€” renamed for clarity
lamp.callslamp.telephonyCall type changed from integer codes to string labels
lamp.smslamp.telephonyText metadata now combined with call data
lamp.bluetoothlamp.nearby_deviceField names changed; now includes WiFi alongside Bluetooth
lamp.wifilamp.nearby_deviceBSSID/SSID fields changed to address/name
lamp.distanceโ€”Removed. Distance available via lamp.steps with type: "distance"
lamp.flightsโ€”Removed. No direct replacement.
lamp.weightโ€”Removed. No direct replacement.
lamp.heightโ€”Removed. No direct replacement.