Metadata-Version: 2.4
Name: backscattering_simulation_data
Version: 1.0.1
Summary: Simulation data management for the measurement of backscattered light in the Virgo interferometer
Author-email: linarphy <linarphy@linarphy.net>
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.11
Requires-Dist: gwpy>=3.0.10
Requires-Dist: h5py>=3.14.0
Description-Content-Type: text/markdown

# Backscattering Simulation Data

**Python interface for managing and interfacing with backscattering
simulation data of the [Virgo interferometer](https://www.ego-gw.it/)**

This library specifically manage simulation data generated with
[backscattering_simulation](https://git.linarphy.net/linarphy/backscattering_simulation)
and
[backscattering_analyzer](https://git.linarphy.net/linarphy/backscattering_analyzer).

## Getting started

### Requirements

- Python >= 3.11
- [mise](https://mise.jdx.dev/) (optional, standard workflow)

### Installation

> [!TIP]
> This library is a core component of the
> [backscattering_simulation](https://git.linarphy.net/linarphy/backscattering_simulation)
> and
> [backscattering_analyzer](https://git.linarphy.net/linarphy/backscattering_analyzer)
> projects. Installing it alone is not intended.
>
> it is designed to be used as a dependency.

`python -m pip install .`

### Development tools & Workflow

**If [mise](https://mise.jdx.dev/) is installed, and [mise.toml](mise.toml)
is trusted, all tools will be installed.**

This project uses the following tools for development. While not all are
required for basic usage, they are used by the maintainer to ensure
consistency and avoid bugs.

- [just](https://just.system): command runner (optional)
- [hatch](https://hatch.pypa.io/): project manager (optional)
- [hatchling](https://hatch.pypa.io/latest/config/build/#build-system): package
builder (optional)
- [uv](https://docs.astral.sh/uv/): package manager (optional)
- [ruff](https://docs.astral.sh/ruff/): python linter and formatter (optional)
- [ty](https://docs.astral.sh/ty/): python type checker (optional)

> [!NOTE]
> Tools used in the project consume and produce interoperable format to
> avoid vendor lock-in. This is the toolchain of the current maintainer

[just](https://just.system) can be used as a command runner to speed up
development. For example, to setup a dev environment and add git hooks,
run `just dev`.

All commands available can be listed with `just -l`.

### Usage

> [!CAUTION]
> This library is a core component of
> [backscattering_simulation](https://git.linarphy.net/linarphy/backscattering_simulation).
> It is not intended to used alone.

```py
# Load data already generated by backscattering_simulation
from pathlib import Path

from h5py import File

from backscattering_simulation_data import Root

# path to the saved data file
filename = Path("path/to/data.hdf5")

with File(filename, "r") as file:
    root = Root.from_hdf5(file)

# get the power on the injection
print(root.metadata.interferometer.injection_power)
```

## Documentation

See the [API Reference](./doc/reference.md).

## License

This project is licensed under the GNU GPL v3+.
See [license file](LICENSE) for more information.

## Acknowledgment

Thanks to all the people that worked on [GWpy](https://gwpy.github.io),
[Finesse](https://finesse.ifosim.org/) and on all software and libraries
used in this project.
