Convert from Seaglider basestation to OG1 format
Project description
seagliderOG1
This repository converts Seaglider basestation files (pSSSDDDD*.nc) into OG1 format for standardized oceanographic glider data.
Code is based on votoutils.
Installation
Recommended: Using pip
For most users, pip installation is the simplest approach:
# Install from PyPI (when available)
pip install seagliderOG1
# Or install from source
pip install git+https://github.com/ocean-uhh/seagliderOG1.git
Development setup
For contributors and developers:
# Clone the repository
git clone https://github.com/ocean-uhh/seagliderOG1.git
cd seagliderOG1
# Install dependencies and package in development mode
pip install -r requirements-dev.txt
pip install -e .
Alternative: Using conda/micromamba
If you prefer conda environments:
# Using conda
conda env create -f environment.yml
conda activate TEST
# Using micromamba (faster)
micromamba env create -f environment.yml
micromamba activate TEST
Package Structure
Scripts within the seagliderOG1 package are organized by functionality:
- readers.py - Reads basestation files (
*.nc) from server or local directory - writers.py - Writes OG1
*.ncfiles to output directory (default:data/) - plotters.py - Basic plotting and data visualization functions
- convertOG1.py - Main conversion logic from basestation to OG1 format
- vocabularies.py - Vocabulary translation mappings for OG1 compliance
- tools.py - User-facing utility functions
- utilities.py - Internal helper functions for data processing
Configuration
The seagliderOG1/config/ directory contains YAML files that define OG1 format specifications:
OG1_global_attrs.yaml- Global attributes for OG1 formatOG1_var_names.yaml- Variable name mappingsOG1_sensor_attrs.yaml- Sensor attribute definitionsOG1_vocab_attrs.yaml- Vocabulary attribute mappingsOG1_author.yaml- Author information templatemission_yaml.yaml- Mission configuration template
Usage
Basic conversion
from seagliderOG1 import convertOG1, readers
# Load basestation files
datasets = readers.load_basestation_files("path/to/basestation/files/")
# Convert to OG1 format
og1_dataset, variable_list = convertOG1.convert_to_OG1(datasets)
# Save result
from seagliderOG1 import writers
writers.save_dataset(og1_dataset, "output_file.nc")
Examples
See the notebooks/ directory for detailed examples:
demo.ipynb- Basic usage demonstrationdev_notebooks/- Development and troubleshooting notebooks
Development
Running tests
pytest # Run all tests
pytest -v # Verbose output
pytest tests/test_*.py # Run specific test file
Code quality
black . # Format code
ruff check --fix # Lint and auto-fix
pre-commit run --all-files # Run all pre-commit hooks
Building documentation
cd docs
make clean html
Dependencies
The project uses different dependency files for different use cases:
- requirements.txt - Core runtime dependencies (recommended for most users)
- requirements-dev.txt - Additional development tools (testing, documentation, code quality)
- environment.yml - Complete conda/micromamba environment (alternative for conda users)
Core dependencies
- xarray & netCDF4 - NetCDF file handling and data manipulation
- numpy, pandas - Numerical operations and data structures
- gsw - Seawater property calculations (TEOS-10)
- matplotlib - Plotting and visualization
- pooch - Data downloading and caching
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and ensure they pass
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Status
This project is under active development. Collaborations and contributions are welcome!
License
See LICENSE for details.
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 seagliderog1-0.0.2.tar.gz.
File metadata
- Download URL: seagliderog1-0.0.2.tar.gz
- Upload date:
- Size: 9.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac70d4807b7c814d3674a1f8f4e1c8e876f94d8d7cef23eb32522e43019068cf
|
|
| MD5 |
3e4db29580a97ab79e00a757abdb2dae
|
|
| BLAKE2b-256 |
66bfff786f7e61bf00c2ecb994e1631eb551244e10e46884e3fdcc7797cb5452
|
Provenance
The following attestation bundles were made for seagliderog1-0.0.2.tar.gz:
Publisher:
pypi.yml on ocean-uhh/seagliderOG1
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seagliderog1-0.0.2.tar.gz -
Subject digest:
ac70d4807b7c814d3674a1f8f4e1c8e876f94d8d7cef23eb32522e43019068cf - Sigstore transparency entry: 543722914
- Sigstore integration time:
-
Permalink:
ocean-uhh/seagliderOG1@6876828ffbf6b703585519cfd05b495eed26142c -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/ocean-uhh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@6876828ffbf6b703585519cfd05b495eed26142c -
Trigger Event:
release
-
Statement type:
File details
Details for the file seagliderog1-0.0.2-py3-none-any.whl.
File metadata
- Download URL: seagliderog1-0.0.2-py3-none-any.whl
- Upload date:
- Size: 56.8 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 |
81b66ded26b9d556ed9b4194db405b0c00549bee0fbc163f10a90488e17f184d
|
|
| MD5 |
7968332e9b7cee6f0e33bfe11ca7da60
|
|
| BLAKE2b-256 |
98bd796541e8f4e2f68b0d44cd74bf6915fdd82b5addf7dcd36df0f4d63d007d
|
Provenance
The following attestation bundles were made for seagliderog1-0.0.2-py3-none-any.whl:
Publisher:
pypi.yml on ocean-uhh/seagliderOG1
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
seagliderog1-0.0.2-py3-none-any.whl -
Subject digest:
81b66ded26b9d556ed9b4194db405b0c00549bee0fbc163f10a90488e17f184d - Sigstore transparency entry: 543722915
- Sigstore integration time:
-
Permalink:
ocean-uhh/seagliderOG1@6876828ffbf6b703585519cfd05b495eed26142c -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/ocean-uhh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@6876828ffbf6b703585519cfd05b495eed26142c -
Trigger Event:
release
-
Statement type: