OMS-NetZero / FAIR-pro

Finite Amplitude Impulse-Response simple climate-carbon-cycle model repository with more functions for users who are comfortable with Python
Apache License 2.0
3 stars 0 forks source link

pymagicc comparison #14

Open rgieseke opened 7 years ago

rgieseke commented 7 years ago

Not sure if it's relevant anymore, but checking out FAIR I came across the notebook here:

https://github.com/OMS-NetZero/FAIR-pro/blob/magicc-comparison/index.ipynb

There is a typo which I think is causing the error ("return_Config"), the following should work:

import pymagicc
from pymagicc import scenarios

for name, scen in scenarios.items():
    results, params = pymagicc.run(scen, return_config=True)
    temp = results["SURFACE_TEMP"].GLOBAL.loc[1850:] - results["SURFACE_TEMP"].GLOBAL.loc[1850:1900].mean()
    temp.plot(label=name)
plt.legend()
plt.title("Global Mean Temperature Projection")
plt.ylabel(u"°C over pre-industrial (1850-1900 mean)");

Or even just (with returning the current default config):

import pymagicc
from pymagicc import scenarios

for name, scen in scenarios.items():
    params = pymagicc.run(scen)
    temp = results["SURFACE_TEMP"].GLOBAL.loc[1850:] - results["SURFACE_TEMP"].GLOBAL.loc[1850:1900].mean()
    temp.plot(label=name)
plt.legend()
plt.title("Global Mean Temperature Projection")
plt.ylabel(u"°C over pre-industrial (1850-1900 mean)");

(This is using pymagicc 0.7.0)

znicholls commented 7 years ago

Awesome thanks Robert! I was wondering why it wasn't working. Let's talk about getting pymagicc going with magicc 7 in the next few months?

On 26 Sep 2017, at 15:57, Robert Gieseke notifications@github.com wrote:

Not sure if it's relevant anymore, but checking out FAIR I came across the notebook here:

https://github.com/OMS-NetZero/FAIR-pro/blob/magicc-comparison/index.ipynb

There is a typo which I think is causing the error ("return_Config"), the following should work:

import pymagicc from pymagicc import scenarios

for name, scen in scenarios.items(): results, params = pymagicc.run(scen, return_config=True) temp = results["SURFACE_TEMP"].GLOBAL.loc[1850:] - results["SURFACE_TEMP"].GLOBAL.loc[1850:1900].mean() temp.plot(label=name) plt.legend() plt.title("Global Mean Temperature Projection") plt.ylabel(u"°C over pre-industrial (1850-1900 mean)"); Or even just (with returning the current default config):

import pymagicc from pymagicc import scenarios

for name, scen in scenarios.items(): params = pymagicc.run(scen) temp = results["SURFACE_TEMP"].GLOBAL.loc[1850:] - results["SURFACE_TEMP"].GLOBAL.loc[1850:1900].mean() temp.plot(label=name) plt.legend() plt.title("Global Mean Temperature Projection") plt.ylabel(u"°C over pre-industrial (1850-1900 mean)"); (This us using pymagicc 0.7.0)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

rgieseke commented 7 years ago

Let's talk about getting pymagicc going with magicc 7 in the next few months?

Sure! Would be great to get rid of the wine dependency for non-Windows users ... (Or at least the 32 requirement...)

znicholls commented 7 years ago

Great, just sent you an email

On 26 Sep 2017, at 16:41, Robert Gieseke notifications@github.com wrote:

Let's talk about getting pymagicc going with magicc 7 in the next few months?

Sure! Would be great to get rid of the wine dependency for non-Windows users ... (Or at least the 32 requirement...)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.