Skip to content

Commit

Permalink
Merge pull request #414 from forsyth2/qbo-data
Browse files Browse the repository at this point in the history
Scale data to minimum number of months
  • Loading branch information
forsyth2 authored Mar 24, 2021
2 parents 6f7cc4e + 5d8acc7 commit 1cb0916
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions acme_diags/plot/cartopy/qbo_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def plot(period_new, parameter, test, ref):

fig = plt.figure(figsize=(14, 14))

months = min(ref["qbo"].shape[0], test["qbo"].shape[0])
months = np.minimum(ref["qbo"].shape[0], test["qbo"].shape[0])
x_test, y_test = np.meshgrid(np.arange(0, months), test["level"])
x_ref, y_ref = np.meshgrid(np.arange(0, months), ref["level"])
cmap2 = plt.cm.RdBu_r
Expand All @@ -100,7 +100,7 @@ def plot(period_new, parameter, test, ref):
# Panel 0 (Top Left)
x = dict(axis_range=[0, months], axis_scale="linear", data=x_test, label=" ")
y = dict(axis_range=[100, 1], axis_scale="log", data=y_test, label="hPa")
z = dict(data=test["qbo"].T)
z = dict(data=test["qbo"].T[:, :months])
title = "{} U 5S-5N ({})".format(test["name"], parameter.test_yrs)
ax0 = plot_panel( # noqa
0,
Expand All @@ -119,7 +119,7 @@ def plot(period_new, parameter, test, ref):
# Panel 1 (Middle Left)
x = dict(axis_range=[0, months], axis_scale="linear", data=x_ref, label="month")
y = dict(axis_range=[100, 1], axis_scale="log", data=y_ref, label="hPa")
z = dict(data=ref["qbo"].T)
z = dict(data=ref["qbo"].T[:, :months])
title = "{} U 5S-5N ({})".format(ref["name"], parameter.ref_yrs)
# FIXME: F841 - assigned but unused
ax1 = plot_panel( # noqa
Expand Down

0 comments on commit 1cb0916

Please sign in to comment.