基于python27中编码的静态或动态co2相对全球变暖势的co2当量计算机。
PyGW的Python项目详细描述
PyGWP-aco2当量计算机基于静态或动态co2相对全球变暖潜能值。
来源
安装
我们将使用包管理系统来安装和管理用python编写的软件包,即pip。在OS Shell提示符下打开会话并键入
pip install pygwp
或者使用非python内置方法,即git,
git clone git://github.com/lfaucheux/PyGWP.git
cd PyGWP
python setup.py install
要求
用例
- 科学建模
示例用法:
>>> from PyGWP import GWPBasedCO2eq
>>> dyn_gwp20 = GWPBasedCO2eq(
... first_year = 2020,
... project_horizon = 5,
... GWP_horizon = 20,
... static = False
... )
>>> ghgs_weight_per_weight_of_output_inventory_flow = {'CO2':1., 'N2O':.0, 'CH4':.0}
>>> co2eq_traj = dyn_gwp20.co2eq_yields_trajectory_computer(
... ghgs_weight_per_weight_of_output_inventory_flow,
... as_row_array=False
... )
>>> co2eq_traj['as_array']
array([[1. ],
[0.95764081],
[0.91469171],
[0.87112496],
[0.82691128]])
>>> co2eq_traj['as_dict']
{2024: 0.82691127746144444, 2020: 1.0, 2021: 0.95764080833063492, 2022: 0.91469171438570718, 2023: 0.87112496115582216}
>>> co2eq_traj = dyn_gwp20.co2eq_yields_trajectory_computer({'CO2':.0,'N2O':1.,'CH4':.0})
>>> co2eq_traj['as_array']
array([[292.33637282, 278.90543843, 265.35617058, 251.68752668,
237.89845498]])
>>> co2eq_traj = dyn_gwp20.co2eq_yields_trajectory_computer({'CO2':.0,'N2O':.0,'CH4':1.})
>>> co2eq_traj['as_array']
array([[72.2209832 , 70.75950679, 69.17102216, 67.44449179, 65.56791893]])
>>> sta_gwp20 = GWPBasedCO2eq(
... first_year = 2020,
... project_horizon = 5,
... GWP_horizon = 20,
... static = True
... )
>>> co2eq_traj = sta_gwp20.co2eq_yields_trajectory_computer({'CO2':.0, 'N2O':.0, 'CH4':1.})
>>> co2eq_traj['as_array']
array([[72.2209832, 72.2209832, 72.2209832, 72.2209832, 72.2209832]])
许可证
分布在MIT license