SAL backend for xarray
Project description
sal-xarray
An xarray backend for SAL (Simple Access Layer) that enables seamless integration of SAL data sources with the xarray ecosystem.
Overview
sal-xarray provides a backend plugin for xarray that allows you to access SAL data sources using xarray's familiar API. It automatically handles the conversion of SAL signals to xarray DataArrays and Datasets, making it easy to work with SAL data in scientific Python workflows.
Features
- xarray Integration: Access SAL data using xarray's
open_datasetfunction - Automatic Conversion: Converts SAL signals to xarray DataArrays with proper coordinates and metadata
- Status Mask Handling: Includes status mask data alongside signal data
- URI-based Access: Simple URI scheme (
sal://pulse/<shot_number>/<signal_name>) for accessing data
Installation
pip install sal-xarray
Or using uv:
uv pip install sal-xarray
JET data access requires a VPN connection to the JDC. You will also require a config file at ~/.sal/credentials with the following content:
[https://sal.jetdata.eu]
user=<user-name>
password=<password>
Usage
Open a SAL dataset using xarray:
import xarray as xr
# Open a SAL signal by name and shot number
ds = xr.open_dataset("sal://pulse/87737/ppf/signal/jetppf/magn/ipla", engine="sal")
# Access the data
data = ds["data"]
status = ds["status"]
# The dataset includes time coordinates
time = ds["time"]
# Access metadata
units = ds["data"].attrs["units"]
signal_name = ds["data"].attrs["sal_name"]
The URI format is: sal://pulse/<shot_number>/<signal_name>
Data Structure
When you open a SAL dataset, sal-xarray creates an xarray Dataset with:
- data: The signal data as a DataArray
- status: The status data as a DataArray
- time: Time coordinates (dimension)
- attrs: Metadata including units and SAL signal name
Development
Setup
Clone the repository and install development dependencies:
git clone https://github.com/samueljackson92/sal-xarray.git
cd sal-xarray
uv sync
Running Tests
uv run pytest tests/
Code Quality
The project uses ruff for linting and formatting, and pylint for additional checks:
# Run ruff
uv run ruff check sal_xarray tests
uv run ruff format sal_xarray tests
# Run pylint
uv run pylint sal_xarray
# Run ty
uv run ty check sal_xarray
Contributing
Contributions are welcome! Please ensure:
- Tests pass for any new functionality
- Code follows the project's style guidelines (ruff and pylint)
- Documentation is updated as needed
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sal_xarray-0.2.1.tar.gz.
File metadata
- Download URL: sal_xarray-0.2.1.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac841e1d79e43c36d6ab0a887df33b54bc22086b367d2e9fe0394d8d60d28831
|
|
| MD5 |
0b816054742c0ee4bb7783e933e70a31
|
|
| BLAKE2b-256 |
b26df0751e2302faaa0bf25084fe307439190b62c32fdd229dceea604416eb31
|
Provenance
The following attestation bundles were made for sal_xarray-0.2.1.tar.gz:
Publisher:
publish.yml on samueljackson92/sal-xarray
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sal_xarray-0.2.1.tar.gz -
Subject digest:
ac841e1d79e43c36d6ab0a887df33b54bc22086b367d2e9fe0394d8d60d28831 - Sigstore transparency entry: 902823218
- Sigstore integration time:
-
Permalink:
samueljackson92/sal-xarray@614339e710d30741db7c0bc16bf9d375f1b17a6e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/samueljackson92
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@614339e710d30741db7c0bc16bf9d375f1b17a6e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file sal_xarray-0.2.1-py3-none-any.whl.
File metadata
- Download URL: sal_xarray-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80858e425e31647b67fea02f761899bea03a995f9f1047ec7794dac5e225960e
|
|
| MD5 |
4dce712365175fc303d231847f84d17d
|
|
| BLAKE2b-256 |
339f338d9d8f0b62dc0aac394af8a16ea868f5c67421c638d911e6b1b2256372
|
Provenance
The following attestation bundles were made for sal_xarray-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on samueljackson92/sal-xarray
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sal_xarray-0.2.1-py3-none-any.whl -
Subject digest:
80858e425e31647b67fea02f761899bea03a995f9f1047ec7794dac5e225960e - Sigstore transparency entry: 902823293
- Sigstore integration time:
-
Permalink:
samueljackson92/sal-xarray@614339e710d30741db7c0bc16bf9d375f1b17a6e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/samueljackson92
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@614339e710d30741db7c0bc16bf9d375f1b17a6e -
Trigger Event:
workflow_dispatch
-
Statement type: