예제 #1
0
파일: matrices.py 프로젝트: sonya/eea
    for code in energy_codes:
        conversions[code] = hybrid_pce.get_element(code) / \
            conven_pce.get_element(code)

    for group in bea.nipa_groups:
        Y = common.pce_bridge_vector(year, group)

        deflator = deflators.get_pce_deflator(year)
        pce = Y.sum() * deflator

        if group not in pce_imports:
            pce_imports[group] = {}

        # pce gets /1000 and /1000 again in "is_intensity" version
        # of print_table()
        pce_imports[group][year] = pa_collapser.matrix_mult(Y).\
            mult(imp_to_cons).sum() * deflator / 1000000

        pce_title = group + " (billion 2005 chained dollars)"
        if pce_title not in plots:
            plots[pce_title] = GNUPlot(group, pce_title, "usa-pce-dollars")
            plots[pce_title].style = "histogram"
        # values are saved in thousands
        plots[pce_title].set_value(year, "dollars", pce / 1000000)

        # billion btu / 1000
        consumption = group + " (trillion Btu)"
        if consumption not in plots:
            plots[consumption] = GNUPlot(group, consumption, "usa-pce-btu")
            plots[consumption].style = "histogram"

        # billion btu / thousand dollars * 1000000