# Time axes

## timenet\_connectors.time\_axes

Map source timestamps to a declared Record origin without resampling values.

### axis\_for\_offsets

```
axis_for_offsets(
    offsets: ndarray, *, period_us: Fraction | None = None
) -> RegularAxis | IrregularAxis
```

Represent exact offsets compactly without filling gaps.

An optional published period prevents a gapped sequence from becoming a slower
regular signal. Without one, only a constant positive observed step implies regularity.

Returns:

| Type | Description |
| --- | --- |
| `RegularAxis | IrregularAxis` | A shifted regular axis or an axis that retains every explicit offset. |

Raises:

| Type | Description |
| --- | --- |
| `TimeFFormatError` | If the source offsets are invalid. |

### offsets\_from\_origin

```
offsets_from_origin(
    timestamps_us: ndarray, origin_us: int
) -> ndarray
```

Subtract an explicit origin from whole-microsecond source timestamps.

The caller establishes alignment and chooses the origin. This function does not
infer either fact. Input order is preserved, including interleaved tag groups.

Returns:

| Type | Description |
| --- | --- |
| `ndarray` | Integer offsets in the same shape and order as the source timestamps. |

Raises:

| Type | Description |
| --- | --- |
| `TimeFFormatError` | If timestamps are not a non-empty integer vector or offsets overflow. |
