import fsspec
import xarray as xr
import hvplot.xarray
url = 's3://coawst-public/testing/hrrr_grib.nc'
ncfile = fsspec.open(url, anon=True)
ds = xr.open_dataset(ncfile.open())
In the next cell, when executed, the data on the map briefly, then disappears!
ds.t2m.hvplot.quadmesh(x='longitude',y='latitude',rasterize=True, geo=True, tiles='Wikipedia')
If we convert longitude
from [0,360]
to [-180,180]
, we get the data on the map, but the hover is broken:
ds['longitude'][:,:] = ds['longitude'][:,:]-360
ds.t2m.hvplot.quadmesh(x='longitude',y='latitude',rasterize=True, geo=True, tiles='Wikipedia')
ds
<xarray.Dataset> Dimensions: (x: 1799, y: 1059) Coordinates: time datetime64[ns] 2017-01-25T07:00:00 step timedelta64[ns] 15:30:00 heightAboveGround int64 2 latitude (y, x) float64 ... longitude (y, x) float64 ... valid_time datetime64[ns] 2017-01-25T22:30:00 Dimensions without coordinates: x, y Data variables: t2m (y, x) float32 ... q (y, x) float32 ... d2m (y, x) float32 ... Attributes: GRIB_edition: [2] GRIB_centre: kwbc GRIB_centreDescription: US National Weather Service - NCEP GRIB_subCentre: [0] Conventions: CF-1.7 institution: US National Weather Service - NCEP history: 2020-09-19T10:48:34 GRIB to CDM+CF via cfgrib-0....
array('2017-01-25T07:00:00.000000000', dtype='datetime64[ns]')
array(55800000000000, dtype='timedelta64[ns]')
array(2)
[1905141 values with dtype=float64]
[1905141 values with dtype=float64]
array('2017-01-25T22:30:00.000000000', dtype='datetime64[ns]')
[1905141 values with dtype=float32]
[1905141 values with dtype=float32]
[1905141 values with dtype=float32]