# plot SRMSE skills ax = plt.figure(figsize=(6.5,3.5)).gca() for j in range(n_decades-1): plt.plot(lead_times, srmse_dec[:,j], c=decade_color[j], label=f"Deep Ens. ({decade_name[j]})") plt.plot(lead_times, srmse, label="Deep Ens. (1962-2017)", c='k', lw=2) plt.ylim(0,1.5) plt.xlim(0.,lead_times[-1]) plt.xlabel('Lead Time [Months]') plt.ylabel('SRMSE') plt.grid() plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) ax.xaxis.set_major_locator(MaxNLocator(integer=True)) plt.tight_layout() # ============================================================================= # Seasonal correlation skills # ============================================================================= # evaluate the model in different seasons r_seas, p_seas = evaluation_seasonal_correlation(f'{model_name}', variable_name='prediction') plot_seasonal_skill(lead_times, r_seas, vmin=0, vmax=1) plt.contour(np.arange(1,13),lead_times, p_seas, levels=[0.01, 0.05, 0.1], linestyles=['solid', 'dashed', 'dotted'], colors='k') plt.title('Correlation skill') plt.tight_layout() srsme_seas = evaluation_seasonal_srmse(f'{model_name}', variable_name='prediction') plot_seasonal_skill(lead_times, srsme_seas, vmin=0, vmax=1.5, cmap=plt.cm.inferno_r, extend='max') plt.title('SSRMSE skill') plt.tight_layout()
ax.xaxis.set_major_locator(MaxNLocator(integer=True)) plt.tight_layout() #%% ============================================================================= # Seasonal correlation skills # ============================================================================= # evaluate the model in different seasons background = "all" #background = "el-nino-like" r_seas, p_seas = evaluation_seasonal_correlation(f'{model_name}_prob', background=background, variable_name=f'median') plot_seasonal_skill(lead_times, r_seas, vmin=0, vmax=1) plt.contour(np.arange(1, 13), lead_times, p_seas, levels=[0.01, 0.05, 0.1], linestyles=['solid', 'dashed', 'dotted'], colors='k') plt.title('Correlation skill') plt.tight_layout() #%% pca_dec = reader.read_statistic('pca', variable='dec_sst', dataset='ERSSTv5', processed='anom')['pca1'] lead = 1
lw=2) plt.ylim(0., 2) plt.xlim(0, lead_time_arr[-1]) plt.xlabel('Lead Time [Months]') plt.ylabel('SSRMSE') #plt.title('Normalized RMSE') plt.grid() plt.legend(loc='center left', bbox_to_anchor=(1, 0.5)) ax.xaxis.set_major_locator(MaxNLocator(integer=True)) plt.tight_layout() if period == "" and save: plt.savefig(join(plotdir, f'ed_all_season_rmse.pdf')) #%% contour skill plots ONI plot_seasonal_skill(lead_time_arr, seas_corr.T, vmin=0, vmax=1) plt.contour(np.arange(1, 13), lead_time_arr, seas_p.T, levels=[0.01, 0.05, 0.1], linestyles=['solid', 'dashed', 'dotted'], colors='k') plt.title('Correlation skill') plt.tight_layout() if save: plt.savefig(join(plotdir, f'ed_seasonal_corr{period}.pdf')) plot_seasonal_skill(lead_time_arr, seas_rmse.T, vmin=0, vmax=1.2,