예제 #1
0
ps_m = ds_m['PS']
q_m = ds_m['QV']
plev_m = get_coord(T_m, 'plev')
lat_m = get_coord(T_m, 'lat')
lon_m = get_coord(T_m, 'lon')

# ----------------------------------------------------------------------
# latlon_equal, lon_convention, set_lon

print(latlon_equal(ps, T))
print(latlon_equal(T, T_m))

print(lon_convention(lon))
print(lon_convention(lon_m))

ps_m2 = set_lon(ps_m, lonmax=360)

t = 0
x1, y1 = np.meshgrid(lon_m, lat_m)
x2, y2 = np.meshgrid(ps_m2.XDim, ps_m2.YDim)
cmap='jet'
ncontours = 30

plt.figure(figsize=(7,8))
plt.subplot(211)
plt.contourf(x1, y1, ps_m[t].values, ncontours, cmap=cmap)
plt.colorbar()
plt.subplot(212)
plt.contourf(x2, y2, ps_m2[t].values, ncontours, cmap=cmap)
plt.colorbar()
예제 #2
0
ps_m = ds_m['PS']
q_m = ds_m['QV']
plev_m = get_coord(T_m, 'plev')
lat_m = get_coord(T_m, 'lat')
lon_m = get_coord(T_m, 'lon')

# ----------------------------------------------------------------------
# latlon_equal, lon_convention, set_lon

print(latlon_equal(ps, T))
print(latlon_equal(T, T_m))

print(lon_convention(lon))
print(lon_convention(lon_m))

ps_m2 = set_lon(ps_m, lonmax=360)

t = 0
x1, y1 = np.meshgrid(lon_m, lat_m)
x2, y2 = np.meshgrid(ps_m2.XDim, ps_m2.YDim)
cmap = 'jet'
ncontours = 30

plt.figure(figsize=(7, 8))
plt.subplot(211)
plt.contourf(x1, y1, ps_m[t].values, ncontours, cmap=cmap)
plt.colorbar()
plt.subplot(212)
plt.contourf(x2, y2, ps_m2[t].values, ncontours, cmap=cmap)
plt.colorbar()
예제 #3
0
lon_m = get_coord(T_m, 'lon')

# ----------------------------------------------------------------------
# latlon_equal, lon_convention

print(latlon_equal(ps, T))
print(latlon_equal(T, T_m))

print(lon_convention(lon))
print(lon_convention(lon_m))

# ----------------------------------------------------------------------
# set_lon with DataArray and ndarray

# xray.DataArray as input
ps_m2 = set_lon(ps_m, lonmax=360)

# ndarray as input
ps_m3, lon_out = set_lon(ps_m.values, lonmax=360, lon=lon_m)

t = 0
x1, y1 = np.meshgrid(lon_m, lat_m)
x2, y2 = np.meshgrid(ps_m2.XDim, ps_m2.YDim)
x3, y3 = np.meshgrid(lon_out, lat_m)
cmap='jet'
ncontours = 30

plt.figure(figsize=(7,10))
plt.subplot(311)
plt.contourf(x1, y1, ps_m[t].values, ncontours, cmap=cmap)
plt.colorbar()
예제 #4
0
lon_m = get_coord(T_m, 'lon')

# ----------------------------------------------------------------------
# latlon_equal, lon_convention

print(latlon_equal(ps, T))
print(latlon_equal(T, T_m))

print(lon_convention(lon))
print(lon_convention(lon_m))

# ----------------------------------------------------------------------
# set_lon with DataArray and ndarray

# xray.DataArray as input
ps_m2 = set_lon(ps_m, lonmax=360)

# ndarray as input
ps_m3, lon_out = set_lon(ps_m.values, lonmax=360, lon=lon_m)

t = 0
x1, y1 = np.meshgrid(lon_m, lat_m)
x2, y2 = np.meshgrid(ps_m2.XDim, ps_m2.YDim)
x3, y3 = np.meshgrid(lon_out, lat_m)
cmap = 'jet'
ncontours = 30

plt.figure(figsize=(7, 10))
plt.subplot(311)
plt.contourf(x1, y1, ps_m[t].values, ncontours, cmap=cmap)
plt.colorbar()