У меня есть файл netcdf с ежедневными данными за месяц. В этом файле содержится irregular latitude and longitude
точек данных. Я хочу создать график time[0]
или любое время из этих данных, но результат кажется неверным. Как я могу показать сюжет с nan-space
?
файл данных
https://www.dropbox.com/s/ll35zh4k5ws7nnh/day1.nc?dl=0
код
import xarray as xr
month_daily1 = xr.open_dataset('/Daily_Month/1/day1.nc')
month_daily1
<xarray.Dataset>
Dimensions: (Lat: 175, Lon: 200, time: 31)
Coordinates:
* time (time) datetime64[ns] 2018-01-01 ... 2018-01-31
* Lat (Lat) float64 29.92 29.93 29.94 ... 33.0 33.01 33.02
* Lon (Lon) float64 47.61 47.62 47.63 ... 50.5 50.51 50.52
Data variables:
Alt (time, Lat, Lon) float64 ...
Temperature (time, Lat, Lon) float64 ...
Relative Humidity (time, Lat, Lon) float64 ...
Wind speed (time, Lat, Lon) float64 ...
Wind direction (time, Lat, Lon) float64 ...
Short-wave irradiation (time, Lat, Lon) float64 ...
# convert kelvin to celsius
data_nonnull = month_daily1.dropna(dim ='time', how='all')
air = data_nonnull.Temperature - 273.15
air
<xarray.DataArray 'Temperature' (time: 31, Lat: 175, Lon: 200)>
array([[[nan, nan, ..., nan, nan],
[nan, nan, ..., nan, nan],
...,
[[nan, nan, ..., nan, nan],
[nan, nan, ..., nan, nan],
[[nan, nan, ..., nan, nan],
[nan, nan, ..., nan, nan],
Coordinates:
* time (time) datetime64[ns] 2018-01-01 2018-01-02 ... 2018-01-31
* Lat (Lat) float64 29.92 29.93 29.94 29.95 ... 32.99 33.0 33.01 33.02
* Lon (Lon) float64 47.61 47.62 47.63 47.64 ... 50.41 50.5 50.51 50.52
%matplotlib inline
import matplotlib.pyplot as plt
ax = plt.subplot(projection=ccrs.PlateCarree())
air2d = air.isel(time= 0)
air2d.plot.pcolormesh('Lon', 'Lat');
Результат
