# CANYON-B Python (canyonbpy)
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).
## Features
- Calculate macronutrients and carbonate system variables using CANYON-B neural network
## Installation
You can install canyonbpy using pip:
```bash
pip install canyonbpy
```
## Usage
Here's a simple example of how to use canyonbpy:
```python
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
## 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:
```
@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}
}
@misc{canyonbpy2024,
author = {Raphaël Bajon},
title = {canyonbpy: A Python implementation of CANYON-B},
year = {2024},
publisher = {GitHub},
url = {https://github.com/RaphaelBajon/canyonbpy}
}
```
Raw data
{
"_id": null,
"home_page": null,
"name": "canyonbpy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "oceanography, CANYON-B, neural networks, carbon, nutrients",
"author": null,
"author_email": "Rapha\u00ebl Bajon <raphael.bajon@ifremer.fr>",
"download_url": "https://files.pythonhosted.org/packages/5b/a4/1918aef37394f8938f883a17ed4026968b2a32116bdcf5a421c0803624e0/canyonbpy-0.1.1.tar.gz",
"platform": null,
"description": "# CANYON-B Python (canyonbpy)\n\nA Python implementation of CANYON-B (CArbonate system and Nutrients concentration from hYdrological properties and Oxygen using Neural networks) based on Bittig et al. (2018).\n\n## Features\n\n- Calculate macronutrients and carbonate system variables using CANYON-B neural network \n\n## Installation\n\nYou can install canyonbpy using pip:\n\n```bash\npip install canyonbpy\n```\n\n## Usage\n\nHere's a simple example of how to use canyonbpy:\n\n```python\nfrom datetime import datetime\nfrom canyonbpy import canyonb\n\n\n# Prepare your data\ndata = {\n 'gtime': [datetime(2024, 1, 1)], # Date/time \n 'lat': [45.0], # Latitude (-90 to 90)\n 'lon': [-20.0], # Longitude (-180 to 180)\n 'pres': [100.0], # Pressure (dbar)\n 'temp': [15.0], # Temperature (\u00b0C)\n 'psal': [35.0], # Salinity\n 'doxy': [250.0] # Dissolved oxygen (\u00b5mol/kg)\n}\n\n# Make predictions\nresults = canyonb(**data)\n\n# Access results\nph = results['pH'] # pH prediction\nph_error = results['pH_ci'] # pH uncertainty\n```\n\nAvailable parameters for prediction:\n- AT: Total Alkalinity\n- CT: Total Dissolved Inorganic Carbon\n- pH: pH\n- pCO2: Partial pressure of CO2\n- NO3: Nitrate\n- PO4: Phosphate\n- SiOH4: Silicate\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Citation\n\nIf you use this package in your research, please cite both the original CANYON-B paper and this implementation:\n\n```\n@article{bittig2018canyon,\n 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},\n author={Bittig, Henry C and Steinhoff, Tobias and Claustre, Herv\u00e9 and K\u00f6rtzinger, Arne and others},\n journal={Frontiers in Marine Science},\n volume={5},\n pages={328},\n year={2018},\n publisher={Frontiers}\n}\n\n@misc{canyonbpy2024,\n author = {Rapha\u00ebl Bajon},\n title = {canyonbpy: A Python implementation of CANYON-B},\n year = {2024},\n publisher = {GitHub},\n url = {https://github.com/RaphaelBajon/canyonbpy}\n}\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python implementation of CANYON-B for oceanographic parameter predictions",
"version": "0.1.1",
"project_urls": {
"Bug Reports": "https://github.com/RaphaelBajon/canyonbpy/issues",
"Homepage": "https://github.com/RaphaelBajon/canyonbpy",
"Source": "https://github.com/RaphaelBajon/canyonbpy"
},
"split_keywords": [
"oceanography",
" canyon-b",
" neural networks",
" carbon",
" nutrients"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f9007211172bf34e55cdb597c10b9fc12f5fa35152cee9f30a31c96355f7c112",
"md5": "d20aed883a13ff23d43d0d81dcdb1354",
"sha256": "054dc3e38b32bc6dbc6795145cdf86b44588a9c16efbeebfb9956905191da0af"
},
"downloads": -1,
"filename": "canyonbpy-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d20aed883a13ff23d43d0d81dcdb1354",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 720869,
"upload_time": "2025-01-02T11:10:31",
"upload_time_iso_8601": "2025-01-02T11:10:31.858649Z",
"url": "https://files.pythonhosted.org/packages/f9/00/7211172bf34e55cdb597c10b9fc12f5fa35152cee9f30a31c96355f7c112/canyonbpy-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5ba41918aef37394f8938f883a17ed4026968b2a32116bdcf5a421c0803624e0",
"md5": "55f6d494ee43d005d0ed8205cf4d9e19",
"sha256": "ec0f86da0edd4a8e75e9cbd7d46093d428df07eb1227ca962890c012fe6b2592"
},
"downloads": -1,
"filename": "canyonbpy-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "55f6d494ee43d005d0ed8205cf4d9e19",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 708433,
"upload_time": "2025-01-02T11:10:34",
"upload_time_iso_8601": "2025-01-02T11:10:34.762608Z",
"url": "https://files.pythonhosted.org/packages/5b/a4/1918aef37394f8938f883a17ed4026968b2a32116bdcf5a421c0803624e0/canyonbpy-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-02 11:10:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "RaphaelBajon",
"github_project": "canyonbpy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": [
[
">=",
"1.20.0"
]
]
},
{
"name": "xarray",
"specs": [
[
">=",
"0.16.0"
]
]
},
{
"name": "matplotlib",
"specs": [
[
">=",
"3.3.0"
]
]
},
{
"name": "PyCO2SYS",
"specs": [
[
">=",
"1.8.0"
]
]
},
{
"name": "pandas",
"specs": [
[
">=",
"1.2.0"
]
]
},
{
"name": "scipy",
"specs": [
[
">=",
"1.6.0"
]
]
}
],
"lcname": "canyonbpy"
}