• 175 views | 4 messages Discussion: LEAP
    Topic: Exporting GHG emissions data using APISubscribe | Previous | Next
  • Chibulu Luo 1/8/2018

    Hello,

    I am trying to export GHG emissions to excel. What is the branch and variable path for this?

    Currently I am using:

    L.Branch("Demand").Variable("100-Year GWP: Direct (At Point of Emissions)").Value(2015, "Tonnes of CO2 Equivalent")

    However this is not working.

    Chibulu

  • Taylor Binnington 1/10/2018
      Best Response

    Hi Chibulu -

    Can you expalin what you mean when you say it's not working?

    In any case, try the following instead:

    L.Branch("Demand").Variable("One_Hundred Year GWP Direct At Point of Emissions").Value(2015, "Metric Tonnes")

    Taylor

  • Chibulu Luo 1/10/2018
      Best Response

    Thanks so much Taylor! I am running my model with the excel API and I want to extract tables with CO2 data from 2015 to 2100 for different model scenarios.

    When I ran the initial code, I kept on getting the following error message:

    "Branch.Variable: Invalid branch/variable format"

    But, it works now thanks to your correction!

    On a related note, just to avoid asking to many of the same question to you!: is there a way to find out the names of all LEAP variables in the results view? e.g. for other environment variables, including particulates and black carbon?

    Thanks again,
    Chibulu

  • Taylor Binnington 1/11/2018
      Best Response

    Hi Chibulu -

    There is no simple way to print our all result variables. With the API you could loop through all branches and print the names of all associated variables with that branch, but that would give you quite a lot of redundant information.

    I'd suggest instead manually creating a branch reference in Analysis view (press Ctrl-b inside an expression), and navigating through the list of variables which appear at a branch that you select. Once you're finished, LEAP will write out the path name in full (in branch:variable format), and you can just copy the proper variable name into your script.

    Best,
    Taylor