class foxes.core.Data(foxes.utils.Dict)[source]

Container for numpy array data and the associated meta data.

Attributes

dims: dict

The dimensions tuples, same or subset of data keys

loop_dims: array_like of str

List of the loop dimensions during xarray’s apply_ufunc calculations

sizes: dict

The dimension sizes

Public members

Data(data, dims, loop_dims, states_i0=None, name='data')[source]

Constructor.

property n_states

The number of states

property n_turbines

The number of turbines

states_i0(counter=False)[source]

Get the state counter for first state in chunk

add(name, data, dims)[source]

Add data entry

get_slice(variables, s, dim_map={}, name=None)[source]

Get a slice of data.

classmethod from_dataset(ds, *args, callback=None, ...)[source]

Create Data object from a dataset

get_item(key, *deflt, prnt=True)[source]

Gets an item, prints readable error if not found

pop_item(key, *deflt, prnt=True)[source]

Pops an item, prints readable error if not found

__getitem__(key)[source]

Return self[key].

classmethod from_yaml(yml_file, verbosity=1)[source]

Reads a yaml file