eWaterCycle / notebooks

Plotting and analysis of eWaterCycle forecast output using Jupyter notebooks
2 stars 1 forks source link

Use iris-sample-data for datafiles #15

Open sverhoeven opened 4 years ago

sverhoeven commented 4 years ago

Some notebooks use netcdf files from some unknown place. We could use https://github.com/SciTools/iris-sample-data/tree/master/iris_sample_data/sample_data repo as a source of datasets.

For example to get a netcdf filename use

import iris
import xarray as xr

fname = iris.sample_data_path('hybrid_height.nc')
cube = xr.open_dataset(fname)
cube.isel(model_level_number=1)['air_potential_temperature'].plot()
sverhoeven commented 4 years ago

Or use https://github.com/pydata/xarray-data via xarray.tutorial.open_dataset()