Metadata-Version: 2.4
Name: msv4-utils
Version: 0.0.2
Summary: Utility methods for reasoning about Measurement Set v4 Datasets
License-File: LICENSE
Requires-Python: >=3.11
Provides-Extra: docs
Requires-Dist: furo; extra == 'docs'
Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
Requires-Dist: sphinx>=7; extra == 'docs'
Provides-Extra: test
Requires-Dist: pytest-httpserver; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# msv4-utils

Lightweight utilities for reasoning about Measurement Set v4.
Core functionality depends only on the Python standard library.

## Installation

```bash
pip install msv4-utils
```

## Usage

### Infer the MSv4 backend from a URI

```python
from msv4_utils import infer_backend, MSv4Backend

backend = infer_backend("/path/to/data.ms")
if backend == MSv4Backend.CASA_TABLE:
    # open with xarray-ms
    ...
elif backend == MSv4Backend.ZARR:
    # open with xarray
    ...
elif backend == MSv4Backend.MEERKAT:
    # open with xarray-kat
    ...
```

### MSv4 type constants

```python
from msv4_utils.msv4_types import VISIBILITY_XDS_TYPES

xds_type = xds.attrs["type"]
if xds_type in VISIBILITY_XDS_TYPES:
    print("interferometric data")
```

## Development

```bash
uv sync
uv run pytest tests
```
