Commit a50cb4cc authored by Beatriz Recinos's avatar Beatriz Recinos
Browse files

test bokeh app

parent cdbce596
No related merge requests found
......@@ -16,3 +16,4 @@ satellite_sst_buoy_1x1 = '/gws/nopw/j04/orchestra/ESAcci_sst_v2.1_coarse/v2.1_at
satellite_sst_buoy_2x2 = '/gws/nopw/j04/orchestra/ESAcci_sst_v2.1_coarse/v2.1_atbuoy_2x2/'
time_series = '/gws/nopw/j04/orchestra/ESAcci_sst_v2.1_coarse/time_series_ESAcci_sst/'
This diff is collapsed.
File added
......@@ -20,6 +20,7 @@ def plot_sst_map(sst_data, ax, vmin=None, vmax=None, cbar=True):
ax: axes to plot the data
vmin: minimum value of the color scale
vmax: maximum value of the color scale
cbar: If True include colour bar
Returns
-------
......@@ -37,8 +38,7 @@ def plot_sst_map(sst_data, ax, vmin=None, vmax=None, cbar=True):
cax, kw = colorbar.make_axes(ax, location='bottom', pad=0.001, aspect=30)
cb = plt.colorbar(im, cax=cax, **kw) # orientation="horizontal")
cb.set_label(label='CCI SST temperature normalised ($^{\circ}$C)',
size='medium', weight='bold')
size='medium', weight='bold')
gl = ax.gridlines(crs=crs.PlateCarree(),
draw_labels=True,
linewidth=2, color='gray', alpha=0.5, linestyle='--')
......@@ -107,3 +107,36 @@ def plot_stats_on_salem_map(ds, var, t, lon_xinterval=0.5, lat_yinterval=0.5):
sm.set_lonlat_contours(xinterval=lon_xinterval, yinterval=lat_yinterval)
sm.set_cmap(cmap)
return sm
def plot_time_series(data_dic,
name_one, name_two,
variable,
label_one, label_two,
axs):
"""
Plot time series of data
Parameters
----------
data_dic_one: dictionary with the data resolution 1
data_dic_two: dictionary with the data resolution 2
name_one: file name (e.g. '1M_1x1', '1Y_1x1' or 'QS-JAN_1x1')
name_two: file name (e.g. '1M_2x2', '1Y_2x2' or 'QS-JAN_2x2')
variable: variable to plot from the data_dic columns
(e.g. weighted_analysed_sst_diff_mean)
label_one: variable label for data 1 (e.g. SST diff 1x1)
label_two: variable label for data 2 (e.g. SST diff 2x2)
axs: axes to plot the data on
legend: True if legend wanted
"""
# Gathering data to plot
time = data_dic[name_one][0].time
var_1 = data_dic[name_one][0][variable]
var_2 = data_dic[name_two][0][variable]
axs.plot(time, var_1, label=label_one)
axs.plot(time, var_2, label=label_two)
return {}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment