Skip to main content

Python implementation of CANYON-B for oceanographic parameter predictions

Project description

CanyonbPy: CANYON-B Python

A Python implementation of CANYON-B (CArbonate system and Nutrients concentration from hYdrological properties and Oxygen using Neural networks) based on Bittig et al., 2018. It was developped from the MATLAB CANYON-B v1.0.

Features

  • Calculate macronutrients and carbonate system variables using CANYON-B neural network

Installation

You can install canyonbpy using pip:

pip install canyonbpy

Usage

Here's a simple example of how to use canyonbpy:

from datetime import datetime
from canyonbpy import canyonb


# Prepare your data
data = {
    'gtime': [datetime(2024, 1, 1)],  # Date/time 
    'lat': [45.0],          # Latitude (-90 to 90)
    'lon': [-20.0],         # Longitude (-180 to 180)
    'pres': [100.0],        # Pressure (dbar)
    'temp': [15.0],         # Temperature (°C)
    'psal': [35.0],         # Salinity
    'doxy': [250.0]         # Dissolved oxygen (µmol/kg)
}

# Make predictions
results = canyonb(**data)

# Access results
ph = results['pH']           # pH prediction
ph_error = results['pH_ci']  # pH uncertainty

Available parameters for prediction:

  • AT: Total Alkalinity
  • CT: Total Dissolved Inorganic Carbon
  • pH: pH
  • pCO2: Partial pressure of CO2
  • NO3: Nitrate
  • PO4: Phosphate
  • SiOH4: Silicate

Documentation

Documentation is available here.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use this package in your research, please cite both the original CANYON-B paper and this implementation with the corresponding version for bug tracking:

@article{bittig2018canyon,
  title={An alternative to static climatologies: Robust estimation of open ocean CO2 variables and nutrient concentrations from T, S, and O2 data using Bayesian neural networks},
  author={Bittig, Henry C and Steinhoff, Tobias and Claustre, Hervé and Körtzinger, Arne and others},
  journal={Frontiers in Marine Science},
  volume={5},
  pages={328},
  year={2018},
  publisher={Frontiers}, 
  doi={10.3389/fmars.2018.00328},
}

@misc{canyonbpy2024,
  author = {Raphaël Bajon},
  title = {canyonbpy: A Python implementation of CANYON-B},
  year = {2024},
  publisher = {GitHub},
  url = {https://github.com/RaphaelBajon/canyonbpy},
  version = {0.2.0},
}

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

canyonbpy-0.2.0.tar.gz (709.0 kB view details)

Uploaded Source

Built Distribution

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

canyonbpy-0.2.0-py3-none-any.whl (721.9 kB view details)

Uploaded Python 3

File details

Details for the file canyonbpy-0.2.0.tar.gz.

File metadata

  • Download URL: canyonbpy-0.2.0.tar.gz
  • Upload date:
  • Size: 709.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.7

File hashes

Hashes for canyonbpy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 593e9c72ad2adc040d800794ce69c07440443c0968e9db7bb3e05ed1b0e97208
MD5 66107e3a80fb2388214ab367f17f320f
BLAKE2b-256 348c4535edecbe7ba9d2ed2c63a8b4ade9e64167f6a03a6b56ce2f369b94b32c

See more details on using hashes here.

File details

Details for the file canyonbpy-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: canyonbpy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 721.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.7

File hashes

Hashes for canyonbpy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7385fe9981feb1f913744200a508d3a6af1bef742fe0a239e5d705d8f13e43ed
MD5 31d7437ec587ee11e4f5295201093b1d
BLAKE2b-256 cd15d7de816e74ac6e3e14cf409497c446a1723a0eeaebb138b38ac3116ec5f3

See more details on using hashes here.

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