foxes.output.slices_data

Classes

SlicesData

Create data for horizontal or vertical 2D slices, all in a

Module Contents

class foxes.output.slices_data.SlicesData(algo: foxes.core.Algorithm, farm_results: xarray.Dataset, verbosity_delta: int = 1, **kwargs: Any)[source]

Bases: foxes.output.output.Output

Create data for horizontal or vertical 2D slices, all in a single Dataset

Parameters:
algo

The algorithm for point calculation

farm_results

The farm results

verbosity_delta

Verbosity threshold for printing calculation info

kwargs

Additional parameters for the Output class

get_fpath(fname: str | pathlib.Path) pathlib.Path

Gets the total file path

Parameters:
fname

The file name

Returns:
fpath

The total file path

get_mean_data_xy(z_list: list[float], verbosity: int = 0, **kwargs: Any) xarray.Dataset[source]

Creates mean data of 2D farm flow slices in a xy-plane.

Parameters:
z_list

The z values

args

Arguments for the SliceData function of the same name

verbosity

The verbosity level, 0 = silent

kwargs

Arguments for the SliceData function of the same name

Returns:
data

The gridded data

get_mean_data_xz(y_list: list[float], verbosity: int = 0, **kwargs: Any) xarray.Dataset[source]

Creates mean data of 2D farm flow slices in a xz-plane.

Parameters:
y_list

The y values

args

Arguments for the SliceData function of the same name

verbosity

The verbosity level, 0 = silent

kwargs

Arguments for the SliceData function of the same name

Returns:
data

The gridded data

get_mean_data_yz(x_list: list[float], verbosity: int = 0, **kwargs: Any) xarray.Dataset[source]

Creates mean data of 2D farm flow slices in a yz-plane.

Parameters:
x_list

The x values

args

Arguments for the SliceData function of the same name

verbosity

The verbosity level, 0 = silent

kwargs

Arguments for the SliceData function of the same name

Returns:
data

The gridded data

get_states_data_xy(z_list: list[float], verbosity: int = 0, **kwargs: Any) xarray.Dataset[source]

Creates states data of 2D farm flow slices in a xy-plane.

Parameters:
z_list

The z values

args

Arguments for the SliceData function of the same name

verbosity

The verbosity level, 0 = silent

kwargs

Arguments for the SliceData function of the same name

Returns:
data

The gridded data

get_states_data_xz(y_list: list[float], verbosity: int = 0, **kwargs: Any) xarray.Dataset[source]

Creates states data of 2D farm flow slices in a xz-plane.

Parameters:
y_list

The y values

args

Arguments for the SliceData function of the same name

verbosity

The verbosity level, 0 = silent

kwargs

Arguments for the SliceData function of the same name

Returns:
data

The gridded data

get_states_data_yz(x_list: list[float], verbosity: int = 0, **kwargs: Any) xarray.Dataset[source]

Creates states data of 2D farm flow slices in a yz-plane.

Parameters:
x_list

The x values

args

Arguments for the SliceData function of the same name

verbosity

The verbosity level, 0 = silent

kwargs

Arguments for the SliceData function of the same name

Returns:
data

The gridded data

classmethod new(output_type: str, *args: Any, **kwargs: Any) Output

Run-time output model factory.

Parameters:
output_type

The selected derived class name

args

Additional parameters for the constructor

kwargs

Additional parameters for the constructor

classmethod print_models() None

Prints all model names.

write(file_name: str, data: pandas.DataFrame, format_col2var: dict[str, str] | None = None, format_dict: dict[str, str] | None = None, **kwargs: Any) None

Writes data to file via pandas.

The kwargs are forwarded to the underlying pandas writing function.

Parameters:
file_name

The output file name

data

The data

format_col2var

Mapping from column names to foxes variables, for formatting

format_dict

Dictionary with format entries for columns, for example FV.P mapped to '{:.4f}'. Note that the keys are foxes variables.

nofig = False
out_dir = None
out_fname_fun = None