An interface between the CBM CFS3, libcbm_py, model and the GOBLIN model.
Project description
🌲 GOBLIN_CBM_runner, a CBM CFS3 interface for the GOBLIN model
Based on the GOBLIN (General Overview for a Backcasting approach of Livestock INtensification) LifeCycle Analysis tool, the cbm_runner package generates the data requried for the CBM CFS3 (libcbm_py) tool. It also interfaces with the tool directly, generating results in a single dataframe for all scenarios.
The outputs are related to biomass, and dead organic matter. These are summed into a total ecosystem value.
The estimated volumns are all in t of C.
Installation
Install from git hub.
pip install "cbm_runner@git+https://github.com/GOBLIN-Proj/goblin_cbm_runner.git@main"
Install from PyPI
pip install goblin_cbm_runner
Usage
The Runner class takes the total afforestation area and divides it evenly across years (calibration year - target year).
from goblin_cbm_runner.default_runner.runner import Runner
import pandas as pd
import os
def main():
# path to data
path = "./data/runner_input"
results_path = "./data/runner_results"
# afforestation data for each scenario
afforest_data = pd.read_csv(
os.path.join(path, "cbm_afforestation.csv"), index_col=0
)
# basic configuration file
config = os.path.join(path, "cbm_factory.yaml")
# scenario_data
sc_data = pd.read_csv(os.path.join(path, "scenario_dataframe.csv"))
# calibration and end point
calibration_year = 2020
# instance of the Runner class
runner = Runner(config, calibration_year, afforest_data, sc_data)
# generation of data for each of the scenarios
runner.generate_input_data()
# generation of aggregated results
runner.run_aggregate_scenarios().to_csv(os.path.join(results_path, "c_aggregate.csv"))
# generation of annual flux results
runner.run_flux_scenarios().to_csv(os.path.join(results_path, "c_flux.csv"))
if __name__ == "__main__":
main()
License
This project is licensed under the terms of the MIT license.
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
Hashes for goblin_cbm_runner-0.3.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c34d701d5b2178fb5628c9f3432cc60e0fe91ae6cdb335635668451a2498174c |
|
MD5 | 4ea8228ff29839257671bebcaa7e6646 |
|
BLAKE2b-256 | 50ff95108cfa266a9b2a16ef6f08f59c26df30e5e454f1283744be87fa2d8b4f |