# Anomalia anomaly, anomaly_pad = cs.compute_anomaly(fsct, hind) # Shift na longitude e nos dados do modelo # Isso é necessário pois a longitude do NetCDF é no formato 0 - 360 # a função aceita valores de longitude no formato -180:+180 # Chefinho quer ver todos os oceanos # anomaly, fsct_lon = shiftgrid(30., anomaly, fsct_lon, start=False) anomaly, lons_anom_aux = shiftgrid(180., anomaly, lons, start=False) # Plot map anomalia globo # a variavel a ser plotada deve ser 2d figtitle = "ECHAM4.6 - Anomalia de Prec Acum (mm)\n{0} {1} - {2} {3}".format(fcst_month, fcst_year, target_months, target_year, hind_period) # figname = "anomalia_echam46_issue_{0}{1}_target_{2}{3}.{4}.png".format(fcst_month, fcst_year, target_months, target_year, hind_period) # pm.anom_map_shaded(anomaly[0, :, :], lons_anom_aux-2.8125/2., lats-2.8125/2., fig_name=figname, fig_title=figtitle) # Plot map anomalia globo sem oceano # figname = "anomalia_echam46_issue_{0}{1}_target_{2}{3}.{4}_noocean.png".format(fcst_month, fcst_year, target_months, target_year, hind_period) # pm.anom_map_shaded(anomaly[0, :, :], lons_anom_aux-2.8125/2., lats-2.8125/2., fig_name=figname, # fig_title=figtitle, ocean_mask=1) # Plot map anomalia Brasil # figname = "anomalia_echam46_issue_{0}{1}_target_{2}{3}.{4}_br.png".format(fcst_month, fcst_year, target_months, target_year, hind_period) # pm.anom_map_shaded(anomaly[0, :, :], lons_anom_aux-2.8125/2., lats-2.8125/2., fig_name=figname, # fig_title=figtitle, br_country=1) # Plot map anomalia Brasil sem oceano figname = "bra_precip_persistida_hind%s_%s-%s_%s_%s_echam46_1dg_null_anom.png" % (fcst_month, fcst_year, target_months, target_year, hind_period) pm.anom_map_shaded(anomaly[0, :, :], lons_anom_aux-2.8125/2., lats-2.8125/2., fig_name=figname, fig_title=figtitle, ocean_mask=1, br_country=1)
# Carrega arquivo da climatologia clim_file = Dataset('/Users/Hulk/TestPyFuncemeClimateTools/lib/python2.7/site-packages/PyFuncemeClimateTools/examples/pcp-daily-total-ec4amip_8908JFM.nc') clim_pcp = clim_file.variables['pcp'][:] # Carrega arquivo da previsão fsct_file = Dataset('/Users/Hulk/TestPyFuncemeClimateTools/lib/python2.7/site-packages/PyFuncemeClimateTools/examples/pcp-daily-total-ec4amip_2015JFM.nc') fsct_pcp = fsct_file.variables['pcp'][:] # Longitude e latitudes fsct_lon = fsct_file.variables['longitude'][:] fsct_lat = fsct_file.variables['latitude'][:] # Calcula anomalias # A função abaixo retornar dois parametros myanom, myanom_pad = cs.compute_anomaly(fsct_pcp, clim_pcp) # Shift na longitude e nos dados do modelo # Isso é necessário pois a longitude do NetCDF é no formato 0 - 360 # a função aceita valores de longitude no formato -180 - +180 myanom, fsct_lon = shiftgrid(180., myanom, fsct_lon, start=False) # Plot map # a variavel a ser plotada deve ser 2d pm.anom_map_shaded(myanom[0, :, :], fsct_lon-2.8125/2., fsct_lat-2.8125/2.)