class foxes.algorithms.downwind.models.PopulationModel(foxes.core.TurbineModel)[source]

This model manages parameter studies by introducing a population into the states

Attributes

index_coord: str

The name of the index coordinate, labeling individuals within the population.

turbine_coord: str

The name of the turbine coordinate

var2ncvar: dict

Mapping from variable names to NetCDF variable names

variables: list of str

The variables to be set. If None, all variables fields from the dataset are used

Public members

PopulationModel(data_source, index_coord='index', ...)[source]

Constructor

property n_pop

The population size

output_farm_vars(algo)[source]

The variables which are being modified by the model.

load_data(algo, verbosity=0)[source]

Load and/or create all model data that is subject to chunking.

set_running(algo, data_stash, sel=None, isel=None, verbosity=0)[source]

Sets this model status to running, and moves all large data to stash.

unset_running(algo, data_stash, sel=None, isel=None, verbosity=0)[source]

Sets this model status to not running, recovering large data from stash

calculate(algo, mdata, fdata, st_sel)[source]

The main model calculation.

farm2pop_results(algo, farm_results)[source]

Convert farm results to population results

classmethod new(tmodel_type, *args, **kwargs)[source]

Run-time turbine model factory.

output_coords()[source]

Gets the coordinates of all output arrays

ensure_output_vars(algo, fdata)[source]

Ensures that the output variables are present in the farm data.

run_calculation(algo, *data, out_vars, **calc_pars)[source]

Starts the model calculation in parallel, via xarray’s apply_ufunc.

__repr__()[source]

Return repr(self).

property model_id

Unique id based on the model type.

var(v)[source]

Creates a model specific variable name.

unvar(vnm)[source]

Translates model specific variable name to origninal variable name.

property initialized

Initialization flag.

sub_models()[source]

List of all sub-models

initialize(algo, verbosity=0, force=False)[source]

Initializes the model.

property running

Flag for currently running models

finalize(algo, verbosity=0)[source]

Finalizes the model.

get_data(variable, target, lookup='smfp', mdata=None, ...)[source]

Getter for a data entry in the model object or provided data sources