A Python package to read, analyse and visualise cGENIE Earth System Model output
Project description
cgeniepy is an Python interface to the output of cGENIE Earth System Model. It is an alternative to the exisiting MATLAB libraries. It aims to do three things:
- Read model output
- Data analysis
- Data visualisation
Installation
cgeniepy is still under active development. But welcome to try the feature and download cgeniep from testpypi.
python3 -m pip install -i https://test.pypi.org/simple/ cgeniepy==0.7.0
Usage
1. Read data
- netCDF (*.nc)
- time series (*.res)
## Example
from cgeniepy.model import GenieModel
model = GenieModel(path_to_model_output)
model.get_var("XXXXX").array
2. Data analysis
- Data subsetting and statistics
- Model performance
- Unit-changing operation (e.g., rate to magnitude)
## get zonal average SST of the last model year
zonal_sst = model.get_var("ocn_sur_temp").isel(time=-1).mean(dim='lat')
## North Pacific SST
npac_sst = model.get_var("ocn_sur_temp").select_basin(47).isel(time=-1)
3. Visualisation
- 1D line (time series, zonal average)
- 2D map (including various projections like polar map)
- 2D cross section
- 3D (facet)
- Add a layer of observational data
## simply call `plot` after accessing the data
zonal_sst.plot()
npac_sst.plot()
4. Others
- ECOGEM shortcuts
from cgeniepy.ecology import EcoModel
model = EcoModel(path_to_model_path)
## get all phytoplankton carbon biomass and plot as map
model.get_pft("Phyto", "Biomass", "C").isel(time=-1).plot()
Gallery
A global biomass map of modelled picophytoplankton (0.6 μm)
A global distribution of basin-level nutrient (PO4)
Project Roadmap 🚩
- Publish the first stable version to
pypi - Examples and Documentation
- plot.py 3D facet subplots
- plot.py more dependency of data.dimension
- plot.py scatter data overlay
- create a simple logo
- ignore NAs when searching grid
- Read an ensemble of models
- use lat/lon/zt from GENIE output
- Move the computation functions in ecology.py and foram.py to array.py
- formatting the ugly unit string
Citation
@software{cgeniepy,
author = {Rui Ying},
title = {A Python interface to analyse and visualise cGENIE model output},
url = {https://github.com/ruiying-ocean/cgeniepy/},
version = {0.7.0},
date = {2023-10-09},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cgeniepy-0.7.0.tar.gz.
File metadata
- Download URL: cgeniepy-0.7.0.tar.gz
- Upload date:
- Size: 82.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a2b435f42d0fee1b8ff109184b7228e6c317999e5fabd1591ff6ef744cd0aa4
|
|
| MD5 |
3db4101a1813e8ae525478e5e3d7bf87
|
|
| BLAKE2b-256 |
9faf5dfc02841d10a78db741676b1d1be15b7460ddfd15b674db1632807f73e3
|
File details
Details for the file cgeniepy-0.7.0-py3-none-any.whl.
File metadata
- Download URL: cgeniepy-0.7.0-py3-none-any.whl
- Upload date:
- Size: 91.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6311b42d07cf42398c53669ce5b6013dc51d01201bfc545d757d5e0dde5939c
|
|
| MD5 |
05294bfcdc3c47acccacc757693f0dfb
|
|
| BLAKE2b-256 |
c81e6b4f9ad8ac806166d3286789157bbdda0d4b191665c83e0478dcc6227e20
|