Skip to main content

Convert from Seaglider basestation to OG1 format

Project description

seagliderOG1

Run tests Deploy Documentation

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 *.nc files 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 format
  • OG1_var_names.yaml - Variable name mappings
  • OG1_sensor_attrs.yaml - Sensor attribute definitions
  • OG1_vocab_attrs.yaml - Vocabulary attribute mappings
  • OG1_author.yaml - Author information template
  • mission_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 demonstration
  • dev_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

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and ensure they pass
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Status

This project is under active development. Collaborations and contributions are welcome!

License

See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seagliderog1-0.0.2.tar.gz (9.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seagliderog1-0.0.2-py3-none-any.whl (56.8 kB view details)

Uploaded Python 3

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

Hashes for seagliderog1-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ac70d4807b7c814d3674a1f8f4e1c8e876f94d8d7cef23eb32522e43019068cf
MD5 3e4db29580a97ab79e00a757abdb2dae
BLAKE2b-256 66bfff786f7e61bf00c2ecb994e1631eb551244e10e46884e3fdcc7797cb5452

See more details on using hashes here.

Provenance

The following attestation bundles were made for seagliderog1-0.0.2.tar.gz:

Publisher: pypi.yml on ocean-uhh/seagliderOG1

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for seagliderog1-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81b66ded26b9d556ed9b4194db405b0c00549bee0fbc163f10a90488e17f184d
MD5 7968332e9b7cee6f0e33bfe11ca7da60
BLAKE2b-256 98bd796541e8f4e2f68b0d44cd74bf6915fdd82b5addf7dcd36df0f4d63d007d

See more details on using hashes here.

Provenance

The following attestation bundles were made for seagliderog1-0.0.2-py3-none-any.whl:

Publisher: pypi.yml on ocean-uhh/seagliderOG1

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page