Ventos "quase-sinóticos" globais -- Quickscat

obs: Dados de satélites quase-sinóticos


In [ ]:
import numpy as np
import numpy.ma as ma
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from quickscat import get_uv, QuikScatDaily


def make_basemap(projection='robin', figsize=(10, 5), resolution='c'):
    fig, ax = plt.subplots(figsize=figsize)
    m = Basemap(projection=projection, resolution=resolution,
                lon_0=0, ax=ax)
    m.drawcoastlines()
    m.fillcontinents(color='0.95')
    parallels = np.arange(-60, 90, 30.)
    meridians = np.arange(-360, 360, 60.)
    m.drawparallels(parallels, labels=[1, 0, 0, 0])
    m.drawmeridians(meridians, labels=[0, 0, 1, 0])
    return fig, m

In [ ]:
qscat = QuikScatDaily('../../data/qscat_20091031v4.gz')

In [ ]:
winddir = ma.masked_equal(qscat.variables['winddir'], -999.)
windspd = ma.masked_equal(qscat.variables['windspd'], -999.)
lon = qscat.variables['longitude']
lat = qscat.variables['latitude']
lon, lat = np.meshgrid(lon, lat)

u, v = get_uv(windspd, winddir)
bad = np.where(windspd < 0)
u[bad] = 0.
v[bad] = 0.

windspd = windspd[0, ...]
u = u[1, ...]
v = v[1, ...]

In [ ]:
cut = slice(0, -1, 10), slice(0, -1, 10)

fig, m = make_basemap(projection='robin', figsize=(14, 8), resolution='c')
cs = m.pcolormesh(lon[cut], lat[cut], windspd[cut], cmap=plt.cm.rainbow, latlon=True)
fig.colorbar(cs, extend='both', orientation='horizontal', shrink=0.65, pad=0.05)
Q = m.quiver(lon[cut], lat[cut], u[cut], v[cut], latlon=True)
qk = m.ax.quiverkey(Q, 0.05, 0.05, 0.1, r'1 m s$^{-1}$', labelpos='N')