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.3.0.tar.gz (712.2 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.3.0-py3-none-any.whl (724.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: canyonbpy-0.3.0.tar.gz
  • Upload date:
  • Size: 712.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for canyonbpy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 76636ed97308a928aeef7baa26ced9bee2269dbc264df9ac0b0d69326565da40
MD5 20b98b85c6d3073a774151779fd2c8d3
BLAKE2b-256 77f5ad38115ee94de4721ed8e6cbec15ad39c9497897a7cc690c3c7f2dd317c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: canyonbpy-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 724.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for canyonbpy-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1cfe7a564c05031036bdbcedec1795c7aec4c000762997edb07c5eeab7642aeb
MD5 ade333bdf8ac9739436a190c3f1208fb
BLAKE2b-256 85ac6223eaadff268edcc6cab5fdc42736d3880d794f8c5d901b5aacc3791954

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