Esempio n. 1
0
topo = atm.get_ps_clim(lat, lon) / 100
topo.units = 'hPa'

# ----------------------------------------------------------------------
# Correct for topography

u_orig = u
u = atm.correct_for_topography(u_orig, topo)

# ----------------------------------------------------------------------
# Zonal mean zonal wind
season = 'jjas'
lon1, lon2 = 60, 100
cint = 5
months = atm.season_months(season)

uplot = atm.subset(u, 'lon', lon1, lon2, 'mon', months)
uplot = uplot.mean(['lon', 'mon'])

ps_plot = atm.subset(topo, 'lon', lon1, lon2)
ps_plot = ps_plot.mean('lon')

plt.figure()
cs = atm.contour_latpres(uplot, clev=cint, topo=ps_plot)
clev = atm.clevels(uplot, cint, omitzero=True)
plt.clabel(cs, clev[::2], fmt='%02d')

plt.figure()
atm.contourf_latpres(uplot, clev=cint, topo=ps_plot)
            sector_scale = (lon2 - lon1) / 360.0
            psbar = atm.dim_mean(ps, 'lon', lon1, lon2)
            clev = 10
        else:
            sector_scale = None
            psbar = atm.dim_mean(ps, 'lon')
            clev = 20
        vssn = v.mean(dim='month')
        vssn_bar = atm.dim_mean(vssn, 'lon')
        psi1 = atm.streamfunction(vssn, sector_scale=sector_scale)
        psi1 = atm.dim_mean(psi1, 'lon')
        psi2 = atm.streamfunction(vssn_bar, sector_scale=sector_scale)
        plt.figure(figsize=figsize)
        plt.suptitle(suptitle)
        plt.subplot(2, 1, 1)
        atm.contour_latpres(psi1, clev=clev, omitzero=omitzero, topo=psbar)
        plt.title('v -> $\psi$ -> [$\psi$]')
        plt.xlabel('')
        plt.subplot(2, 1, 2)
        atm.contour_latpres(psi2, clev=clev, omitzero=omitzero, topo=psbar)
        plt.title('[v] -> [$\psi$]')

# ----------------------------------------------------------------------
# Daily data

datadir = atm.homedir() + 'datastore/merra/daily/'
filestr = datadir + 'merra_V_sector_%s_%d.nc'
year = 1980
#lon1, lon2 = 0, 360
lon1, lon2 = 60, 100
lonstr = atm.latlon_str(lon1, lon2, 'lon')
            sector_scale = (lon2 - lon1) / 360.0
            psbar = atm.dim_mean(ps, 'lon', lon1, lon2)
            clev = 10
        else:
            sector_scale = None
            psbar = atm.dim_mean(ps, 'lon')
            clev = 20
        vssn = v.mean(dim='month')
        vssn_bar = atm.dim_mean(vssn, 'lon')
        psi1 = atm.streamfunction(vssn, sector_scale=sector_scale)
        psi1 = atm.dim_mean(psi1, 'lon')
        psi2 = atm.streamfunction(vssn_bar, sector_scale=sector_scale)
        plt.figure(figsize=figsize)
        plt.suptitle(suptitle)
        plt.subplot(2, 1, 1)
        atm.contour_latpres(psi1, clev=clev, omitzero=omitzero, topo=psbar)
        plt.title('v -> $\psi$ -> [$\psi$]')
        plt.xlabel('')
        plt.subplot(2, 1, 2)
        atm.contour_latpres(psi2, clev=clev, omitzero=omitzero, topo=psbar)
        plt.title('[v] -> [$\psi$]')

# ----------------------------------------------------------------------
# Daily data

datadir = atm.homedir() + 'datastore/merra/daily/'
filestr = datadir + 'merra_V_sector_%s_%d.nc'
year = 1980
#lon1, lon2 = 0, 360
lon1, lon2 = 60, 100
lonstr = atm.latlon_str(lon1, lon2, 'lon')