# Calibration lookup tables

> For the complete documentation index, see [llms.txt](https://docs.oriondata.io/llms.txt)

Input/output mappings, interpolation, clamping and lookup behaviour in calibration actions.

## What is a lookup table?

A lookup table is a set of **input → output mappings** stored on a device record. When applied to an action step, it transforms the left side’s value using the table before the operator is applied. Lookup tables are useful when a sensor’s raw output has a non-linear relationship with the real-world value — for example, mapping a voltage reading to a flow rate or pressure.

## How values are resolved

| Scenario                         | Behaviour                                                |
| -------------------------------- | -------------------------------------------------------- |
| Input matches exactly            | Returns the corresponding output                         |
| Input falls between two entries  | **Linear interpolation** between the surrounding outputs |
| Input is below the lowest entry  | **Clamped** to the lowest entry’s output                 |
| Input is above the highest entry | **Clamped** to the highest entry’s output                |

For an input $x$ that falls between two table entries $(x_1, y_1)$ and $(x_2, y_2)$, the interpolated output is:

$$
y = y_1 + (y_2 - y_1) \times \frac{x - x_1}{x_2 - x_1}
$$

**Example table:**

| Input | Output |
| ----- | ------ |
| 1     | 5      |
| 2     | 10     |

| Input value | Result                      |
| ----------- | --------------------------- |
| 1           | 5 (exact match)             |
| 1.5         | 7.5 (interpolated)          |
| 2           | 10 (exact match)            |
| −1          | 5 (clamped to lower bound)  |
| 3           | 10 (clamped to upper bound) |

## Applying a lookup table to an action step

Lookup tables are applied to the **left side** of an action step. The notation appends `[Lookup: TableName]` to whatever the left side type is.

**Examples:**

| Left side                   | With lookup                                   |
| --------------------------- | --------------------------------------------- |
| `Sensor Value: Temperature` | `Sensor Value: Temperature [Lookup: TempMap]` |
| `Previous Step 1`           | `Previous Step 1 [Lookup: FlowTable]`         |
| `Value: 5`                  | `Value: 5 [Lookup: PressureMap]`              |

## Where to manage lookup tables

Lookup tables are stored and managed on the **device record** in Orion. Navigate to the device, then find the Lookup Tables section to create or edit tables.
