foxes.input.states.DatasetStates.get_calc_data(mdata, cmap, variables)[source]

Gathers data for calculations.

Call this function from the calculate function of the derived class.

Parameters

mdata: foxes.core.MData

The mdata object

cmap: dict

A mapping from foxes variable names to Dataset dimension names

variables: list of str

The variables to extract from the Dataset

Returns

coords: dict

keys: Foxes variable names, values: 1D coordinate value arrays

data: dict

The extracted data, keys are dimension tuples, values are tuples (DATA key, variables, data_array) where DATA key is the name in the mdata object, variables is a list of variable names, and data_array is a numpy.ndarray with the data values, the last dimension corresponds to the variables

weights: numpy.ndarray or None

The weights array, if only state dependent, otherwise weights are among data. Shape: (n_states,)