foxes.input.states.create.create_dataset_mean(data_source, coord, var2ncvar, vname_mean_ws='MEAN_WS', vname_main_wd='MAIN_WD', wd_histo_width=10.0, add_uv=False, add_counts=False, to_file=None, preprocess=None, verbosity=1, **kwargs)[source]

Create dataset mean state data and optionally write to file.

Parameters

data_source: str or xarray.Dataset

The data or the file search pattern, should end with suffix ‘.nc’. One or many files.

coord: str

Name of the coordinate which should be averaged over

var2ncvar: dict

Mapping from variable names to netCDF variable names

vname_mean_ws: str

The variable name to use for the mean wind speed

vname_main_wd: str

The variable name to use for the main wind direction

wd_histo_width: float

The minimal wind direction histogramm bin width

add_uv: bool

Flag for adding U and V to the resulting data

add_counts: bool

Flag for adding the counts of each data variable

to_file: str, optional

If given, write the mean state to this file

preprocess: callable, optional

Preprocessing function with signature ds = preprocess(ds) which is applied to each dataset after reading.

verbosity: int

The verbosity level, 0 = silent

kwargs: dict, optional

Additional keyword arguments passed to xarray.open_dataset

Returns

data: xarray.Dataset

The created mean state data