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.1.tar.gz (709.1 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.1-py3-none-any.whl (722.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: canyonbpy-0.2.1.tar.gz
  • Upload date:
  • Size: 709.1 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.1.tar.gz
Algorithm Hash digest
SHA256 eb3b2718f59cdfda2979bc6087d9c09d094eb17d22e98bea537ed16cde8d73de
MD5 a3ce1fefe45ee5104b465a50396713ab
BLAKE2b-256 884d90ce68c0c7311a6f7432c8cb853d60487606df4afdbb214fc633134d1880

See more details on using hashes here.

File details

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

File metadata

  • Download URL: canyonbpy-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 722.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5ec83a83aeadb7f8ee64d2c3afe219697e326ae757e09341e80c1d4a6713777
MD5 270b7d6038865422a7f8a086d9e86896
BLAKE2b-256 6a9821a0e54a7ae255a7bc723b1657adc6849bc8ecb52ac55c724043cb5772b7

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