К сожалению, он рисует пустое белое изображение. Возможно, данные диапазона/яркостной температуры требуют некоторого «расширения»?
MWE выглядит следующим образом;
Код: Выделить всё
import xarray as xr
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import numpy as np
ds = xr.open_dataset('20200508090000-P1S-ABOM_OBS_B14-PRJ_GEOS141_2000-HIMAWARI8-AHI.nc')
dx = ds.isel(time=0, x=slice(3000, 4000, 1), y=slice(3000, 4000, 1))
central_longitude = dx['geostationary'].longitude_of_projection_origin
satellite_height = dx['geostationary'].satellite_height
mapx = dx['x'].to_numpy() * 1000 #to km
mapy = dx['y'].to_numpy() * 1000 #to km
#mapx = (mapx[0]-500, mapx[-1]+500) is this needed?
#mapy = (mapy[0]+500, mapy[-1]-500) is this needed?
b14 = dx['channel_0014_brightness_temperature'] #does still need to be stretched?
data_proj = ccrs.Geostationary(
central_longitude=central_longitude,
satellite_height=satellite_height,
)
map_proj = ccrs.Miller(central_longitude=central_longitude)
fig, ax = plt.subplots(
figsize=(20, 12), facecolor="w", dpi=300,
subplot_kw=dict(projection=map_proj),
)
datacrs = ccrs.PlateCarree()
pcm = ax.pcolorfast(mapx, mapy, b14, transform=data_proj, cmap='grey')
ax.add_feature(cfeature.COASTLINE.with_scale('10m'), linewidth=1.5, color='w')
ax.set_extent([116, 126, 12, 17.9])
Подробнее здесь: https://stackoverflow.com/questions/789 ... etcdf-data