与Brightway中的不同单位进行交流

时间:2019-07-07 15:42:39

标签: brightway

是否可以在Brightway中定义与不同单位进行交流的活动? (例如,兆焦耳代替兆焦耳)。我写了一些代码来测试这一点,但我的幼稚方法似乎行不通:

co2_f=[f for f in bw.Database('biosphere3')
if 'Carbon dioxide' in f['name']
and ' fossil' in f['name']
and f['categories']==('air', 'low population density, long-term')
][0]
co2_f

for act in bw.Database('ei_35cutoff'):
    if act['unit']=='megajoule':
       break

db = bw.Database("a&e")

db.write({
("a&e", "cat1"): 
    {
    'name': 'cat1',
    'unit': 'kilogram',
    'exchanges': [
        {'input': act.key  ,'amount': 10,'type': 'technosphere','unit':'megajoule'},
        {'input': co2_f.key,'amount': 1,'type': 'biosphere','unit':'kilogram'}]
    },

("a&e", "cat2"): 
    {
    'name': 'cat2',
    'unit': 'kilogram',
    'exchanges': [
        {'input': act.key  ,'amount': 10,'type': 'technosphere','unit':'terajoule'},
        {'input': co2_f.key,'amount': 1,'type': 'biosphere','unit':'kilogram'}]
    },
("a&e", "cat3"): 
    {
    'name': 'cat3',
    'unit': 'kilogram',
    'exchanges': [
        {'input': act.key  ,'amount': 10,'type': 'technosphere','unit':'megajoule'},
        {'input': co2_f.key,'amount': 1,'type': 'biosphere','unit':'ton'}]
    },
})

ipcc2013 = ('IPCC 2013', 'climate change', 'GWP 100a')

for a in db:
    actlca=bw.LCA({a:1},method=ipcc2013)
    actlca.lci()
    actlca.lcia()
    print(a['name'],actlca.score)

都产生相同的结果。好像二氧化碳是千克,act是兆焦耳。

1 个答案:

答案 0 :(得分:0)

如果您的意思是“基于'units'属性进行Brightway2规模交换”,答案是否定的。

与Brightway2中的几乎所有其他内容一样,这并非不可能。但是,单位不是Brightway存​​储的processed数据的一部分(即它不是MatrixBuilder从其构建 A B 矩阵)。

有关处理后的数据和构建矩阵的更多信息,请参见herehere