Esempio n. 1
0
    print "Erro ao ler arquivo do hindcast"
    exit()

# Arquivo observação
try:
    obs_file = "cmap.{0}-{1}-1.0dg.fix.nc".format(hind_period, target_months)
    read_obs_file = pupynere.NetCDFFile(obs_file, 'r')
    obs = read_obs_file.variables['pcp'][:, :, :]
    read_obs_file.close()
except:
    print "Erro ao ler arquivo observado"
    exit()

# RMSE
print "... RMSE ..."
error_rmse = cs.rmse(hind, obs)
rmse_title = u'ECHAM4.6 x CMAP - {0}/{1} ({2})\nRMSE (mm) - Precip Acum'.format(fcst_month, target_months, hind_period)
fig_rmse = 'bra_precip_persistida_{0}_null-{1}_null_{2}_echam46_1dg_cmap_rmse.png'.format(hind_period, target_months, n_fcst_month)
levs = (0., 50., 100., 200., 400., 600., 800.) #7
my_colors = ('#ffffff', '#E1FFFF', '#B4F0FA', '#96D2FA', '#78B9FA', 
             '#50A5F5', '#3C96F5', '#2882F0') #8
pm.map_shaded(error_rmse, lats-1./2., lons-1./2., latsouthpoint=-60., latnorthpoint=15., 
    lonwestpoint=-90., loneastpoint=-30.,  fig_name=fig_rmse, barloc='right', 
    barcolor=my_colors, barlevs=levs, fig_title=rmse_title, barinf='max', ocean_mask=1)

# Desvio padrão
print u"... desvio padrão ..."
hind_std = np.nanstd(hind, axis=0)
hind_std_title = u'ECHAM4.6 x CMAP - {0}/{1} ({2})\nDesvio Padrão (mm) - Precip Acum'.format(fcst_month, target_months, hind_period)
fig_hind_std = 'bra_precip_persistida_{0}_null-{1}_null_{2}_echam46_1dg_cmap_std.png'.format(hind_period, target_months, n_fcst_month)
levs = (0., 25., 50., 75., 100., 150., 200.) #7