xarray-contrib / xwrf

A lightweight interface for working with the Weather Research and Forecasting (WRF) model output in Xarray.
https://xwrf.readthedocs.io/
Apache License 2.0
59 stars 16 forks source link

[MISC]: DOCS for how to load your own data #124

Closed deeplycloudy closed 1 year ago

deeplycloudy commented 1 year ago

What is your issue?

I had occasion to use xwrf for the first time, which leads me to propose adding a quick-start guide to the docs for the probably common use case of a time series of wrfout NetCDF files.

Right now all the examples in the docs load the tutorial dataset. I had to dig through a couple discussion threads to find the right combination of accessor usage and mfdataset calls to figure it out.

Would it work to add something like this to the "How to" section of the docs, in a new subsection after the installation instructions?


import xwrf
import xarray as xr

from glob import glob
wrf_files = sorted(glob('./wrfout*.nc'))
ds = xr.open_mfdataset(
    wrf_files,
    engine="netcdf4",
    parallel=True,
    concat_dim="Time",
    combine="nested",
    chunks={'Time': 1},decode_times=False
).xwrf.postprocess()
lpilz commented 1 year ago

Hi @deeplycloudy, thanks for raising this issue. We indeed presupposed that users would know how to do this, which is probably not fair to people who are not as xarray affine. I added the PR #126 which should address this issue. Please let us know if you think we should add more information.

deeplycloudy commented 1 year ago

Looks good to me!