Beispiel #1
0
     compute_bias(mdl20_clim, obs1_clim),
     compute_bias(mdl21_clim, obs1_clim),
     compute_bias(mdl22_clim, obs1_clim),
     compute_bias(mdl23_clim, obs1_clim),
     compute_bias(mdl24_clim, obs1_clim),
     compute_bias(mdl25_clim, obs1_clim),
     compute_bias(mdl26_clim, obs1_clim),
     compute_bias(mdl27_clim, obs1_clim),
     compute_bias(mdl28_clim, obs1_clim),
     compute_bias(mdl29_clim, obs1_clim),
     compute_bias(mdl30_clim, obs1_clim),
     compute_bias(mdl31_clim, obs1_clim),
     compute_bias(mdl32_clim, obs1_clim)
 ],
 pbias=[
     compute_pbias(mdl1_clim, obs1_clim),
     compute_pbias(mdl2_clim, obs1_clim),
     compute_pbias(mdl3_clim, obs1_clim),
     compute_pbias(mdl4_clim, obs1_clim),
     compute_pbias(mdl5_clim, obs1_clim),
     compute_pbias(mdl6_clim, obs1_clim),
     compute_pbias(mdl7_clim, obs1_clim),
     compute_pbias(mdl8_clim, obs1_clim),
     compute_pbias(mdl9_clim, obs1_clim),
     compute_pbias(mdl10_clim, obs1_clim),
     compute_pbias(mdl11_clim, obs1_clim),
     compute_pbias(mdl12_clim, obs1_clim),
     compute_pbias(mdl13_clim, obs1_clim),
     compute_pbias(mdl14_clim, obs1_clim),
     compute_pbias(mdl15_clim, obs1_clim),
     compute_pbias(mdl16_clim, obs1_clim),
    'ensmean_cmip5'
]

for mdl in mdl_list:
    print 'CMIP5 Model:', mdl

    # Import cmip5 model end obs database monthly
    mdl_clim = import_cmip5_clim(mdl)

    obs = u'cru_ts4.02'
    obs_clim = import_obs_clim(obs)

    # Compute statiscts index from CMIP5 models
    x.append(metrics.mean_absolute_error(obs_clim, mdl_clim))
    y.append(metrics.mean_squared_error(obs_clim, mdl_clim))
    z.append(compute_pbias(obs_clim, mdl_clim))

fig = pyplot.figure()
ax = Axes3D(fig)

types = [
    'BCC-CSM1.1', 'BCC-CSM1.1M', 'BNU-ESM', 'CanESM2', 'CNRM-CM5',
    'CSIRO-ACCESS-1', 'CSIRO-ACCESS-3', 'CSIRO-MK36', 'FIO-ESM',
    'GISS-E2-H-CC', 'GISS-E2-H', 'GISS-E2-R', 'HadGEM2-AO', 'HadGEM2-CC',
    'HadGEM2-ES', 'INMCM4', 'IPSL-CM5A-LR', 'IPSL-CM5A-MR', 'IPSL-CM5B-LR',
    'LASG-FGOALS-G2', 'LASG-FGOALS-S2', 'MIROC5', 'MIROC-ESM-CHEM',
    'MIROC-ESM', 'MPI-ESM-LR', 'MPI-ESM-MR', 'MRI-CGCM3', 'NCAR-CCSM4',
    'NCAR-CESM1-BGC', 'NCAR-CESM1-CAM5', 'NorESM1-ME', 'NorESM1-M',
    'ensmean_cmip5'
]
Beispiel #3
0
	print 'CMIP5 Model:', mdl
	
	# Import cmip5 model end obs database monthly	
	mdl_clim = import_cmip5(mdl)
	
	obs  = u'cru_ts4.02'
	obs_clim = import_obs(obs)
	
	# Compute statiscts index from CMIP5 models
	r     = round((np.corrcoef(np.array(mdl_clim), np.array(obs_clim)))[0][1], 3)
	r2    = metrics.r2_score(obs_clim, mdl_clim)
	mae   = metrics.mean_absolute_error(obs_clim, mdl_clim)
	mse   = metrics.mean_squared_error(obs_clim, mdl_clim)
	rmse  = compute_rmse(obs_clim, mdl_clim)
	bias  = compute_bias(mdl_clim, obs_clim)
	pbias = compute_pbias(mdl_clim, obs_clim)
	apb   = compute_apb(mdl_clim, obs_clim)
	effic = compute_effic_coeffic(mdl_clim, obs_clim)
	mae = metrics.median_absolute_error(obs_clim, mdl_clim)
		
	print r, r2, mae, mse, rmse, bias, pbias, apb, effic, Mae
	
	tab_inform.append([mdl, r, r2, mae, mse, rmse, bias, pbias, apb, effic, mae])

tab.add_rows(tab_inform)
tab.set_cols_align(['c', 'c', 'c', 'c', 'c', 'c', 'c', 'c', 'c', 'c', 'c'])
tab.header([u'CMIP5 Models', u'R', u'R2_score', u'MAE', u'MSE', U'RMSE', U'BIAS', U'PBIAS', U'APB', U'NASH', u'MAE'])
table = str(tab.draw())
	
file_name = 'table_monthly_pre_neb_statist_indices_cmip5_models_1975-2005.asc'
file_save = open(file_name, 'w')