# SGN-TS Documentation

SGN-TS extends the [SGN](https://docs.ligo.org/greg/sgn/) streaming pipeline
framework with time-series capabilities: offset-based timing, uniformly sampled
buffers, multi-channel alignment, and signal processing elements.

## Installation

```bash
pip install sgn-ts
```

??? info "Optional: PyTorch Support"
    ```bash
    pip install sgn-ts[torch]
    ```

    When PyTorch is installed, the `TorchBackend`, `Converter`, and `Resampler`
    can use GPU-accelerated operations. Without it, all operations fall back to
    NumPy.

??? info "Developer Installation"
    ```bash
    git clone https://git.ligo.org/greg/sgn-ts.git
    cd sgn-ts
    pip install -e ".[dev]"
    ```

    Run `make` to verify your development environment.

## Where to Start

- **[Tutorial](tutorials/first-ts-pipeline.md)** — New to SGN-TS? Build your first time-series pipeline step by step.
- **[User Guide](user/index.md)** — Offsets, buffers, frames, slicing, streaming, plotting.
- **[Developer Guide](developer/develop-elements.md)** — Writing custom sources, transforms, and sinks.
- **[Reference](reference/sources.md)** — Built-in sources, transforms, sinks, and auto-generated API documentation.
- **[Background](background/timeseries-concepts.md)** — Understand the design: why offsets, power-of-2 rates, and frame alignment.

## Related Libraries

- [`sgn`](https://docs.ligo.org/greg/sgn/): Base streaming pipeline framework
- [`sgn-ligo`](https://git.ligo.org/greg/sgn-ligo): LIGO-specific utilities for SGN
