Using NetCDF data
[1]:
import earthkit.data as ekd
ekd.download_example_file("test.nc")
[2]:
fs = ekd.from_source("file", "test.nc")
[3]:
type(fs)
[3]:
earthkit.data.readers.netcdf.NetCDFFieldListReader
[4]:
len(fs)
[4]:
2
[5]:
for f in fs:
print(f)
NetCDFField(t2m,)
NetCDFField(msl,)
[6]:
fs.to_xarray()
[6]:
<xarray.Dataset> Size: 2kB
Dimensions: (longitude: 19, latitude: 11)
Coordinates:
* longitude (longitude) float64 152B -27.0 -23.0 -19.0 ... 37.0 41.0 45.0
* latitude (latitude) float64 88B 73.0 69.0 65.0 61.0 ... 41.0 37.0 33.0
number int32 4B ...
time datetime64[ns] 8B ...
step timedelta64[ns] 8B ...
surface int32 4B ...
valid_time datetime64[ns] 8B ...
Data variables:
t2m (latitude, longitude) float32 836B dask.array<chunksize=(11, 19), meta=np.ndarray>
msl (latitude, longitude) float32 836B dask.array<chunksize=(11, 19), meta=np.ndarray>
Attributes:
GRIB_edition: 1
GRIB_centre: ecmf
GRIB_centreDescription: European Centre for Medium-Range Weather Forecasts
GRIB_subCentre: 0
Conventions: CF-1.7
institution: European Centre for Medium-Range Weather Forecasts
history: GRIB to CDM+CF via cfgrib-0.9.5/ecCodes-2.17.0 w...[7]:
fs.bounding_box()
[7]:
[BoundingBox(north=73,west=-27,south=33,east=45),
BoundingBox(north=73,west=-27,south=33,east=45)]