yt_xarray.sample_data

yt_xarray.sample_data.load_random_xr_data(fields: Mapping[str, tuple[str, ...]], dims: Mapping[str, tuple[int | float, int | float, int]], length_unit: str | None = None) Dataset[source]

Parameters

fieldsdict[str, tuple]

A dictionary specifying fields and their dimensions {‘field1’: (‘x’, ‘y’, ‘z’), ‘field2’: (‘x’, ‘y’)}

dims

a dictionary mapping any dimensions to their start, stop and size. Any dimensions specified in fields must exist here. {‘x’: (0, 1, 10), ‘y’: (0, 2, 15)} would create an x and y dimension that goes from 0 to 1 with 10 elements for x, 0 to 2 with 15 elements for y.

Returns

xr.Dataset

an xarray Dataset with fields of random values with the supplied names and dimensions.