foxes.output.farm_results_eval.FarmResultsEval¶
- class foxes.output.farm_results_eval.FarmResultsEval[source]¶
Bases:
Output
Evaluates farm results data.
This sums over turbines and/or states, given the state-turbine farm_calc results.
- Parameters:
farm_results (xarray.Dataset) – The farm results
- results¶
The farm results
- Type:
xarray.Dataset
Methods
__init__
(farm_results)add_capacity
([algo, P_nom, ambient, verbosity])Adds capacity to the farm results
add_efficiency
([verbosity])Adds efficiency to the farm results
Calculates farm efficiency
calc_farm_mean
(vars)Calculates the mean over states and turbines.
calc_farm_sum
(vars)Calculates the sum over states and turbines.
calc_farm_yield
([turbine_yield, power_uncert])Calculates yield, P75 and P90 at the farm level
calc_mean_farm_power
([ambient])Calculates the mean total farm power.
calc_states_mean
(vars)Calculates the mean wrt states.
calc_states_std
(vars)Calculates the standard deviation wrt states.
calc_states_sum
(vars)Calculates the sum wrt states.
calc_turbine_mean
(vars)Calculates the mean wrt turbines.
calc_turbine_sum
(vars)Calculates the sum wrt turbines.
calc_turbine_yield
([algo, annual, ambient, ...])Calculates the yield per turbine
new
(model_type, **kwargs)Run-time output model factory.
Prints all model names.
reduce_all
(states_op, turbines_op)Reduces states and turbine dimension by some operation
reduce_states
(vars_op)Reduces the states dimension by some operation
reduce_turbines
(vars_op)Reduces the turbine dimension by some operation
weinsum
(rhs, *vars)Calculates Einstein sum, adding weights as last argument to the given fields.
write
(file_path, data[, format_col2var, ...])Writes data to file via pandas.
- add_capacity(algo=None, P_nom=None, ambient=False, verbosity=1)[source]¶
Adds capacity to the farm results
- Parameters:
algo (foxes.core.Algorithm, optional) – The algorithm, for nominal power calculation
P_nom (list of float, optional) – Nominal power values for each turbine, if algo not given
ambient (bool, optional) – Flag for calculating ambient capacity, by default False
verbosity (int) – The verbosity level, 0 = silent
- add_efficiency(verbosity=1)[source]¶
Adds efficiency to the farm results
- Parameters:
verbosity (int) – The verbosity level, 0 = silent
- calc_farm_efficiency()[source]¶
Calculates farm efficiency
- Returns:
eff – The farm efficiency
- Return type:
- calc_farm_yield(turbine_yield=None, power_uncert=None, **kwargs)[source]¶
Calculates yield, P75 and P90 at the farm level
- Parameters:
- Returns:
farm_yield (float) – Farm yield result, same unit as turbine yield
P75 (float, optional) – The P75 value, same unit as turbine yield
P90 (float, optional) – The P90 value, same unit as turbine yield
- calc_states_std(vars)[source]¶
Calculates the standard deviation wrt states.
- Parameters:
vars (_type_) – _description_
- Returns:
_description_
- Return type:
_type_
- calc_turbine_yield(algo=None, annual=False, ambient=False, hours=None, delta_t=None, P_unit_W=None)[source]¶
Calculates the yield per turbine
- Parameters:
algo (foxes.core.Algorithm, optional) – The algorithm, for P_nominal lookup
annual (bool, optional) – Flag for returing annual results, by default False
ambient (bool, optional) – Flag for ambient power, by default False
hours (int, optional) – The duration time in hours, if not timeseries states
delta_t (np.datetime64, optional) – The time delta step in case of time series data, by default automatically determined
P_unit_W (float) – The power unit in Watts, 1000 for kW. Looked up in algorithm if not given
- Returns:
A dataframe of yield values by turbine in GWh
- Return type:
pandas.DataFrame
- classmethod new(model_type, **kwargs)¶
Run-time output model factory.
- Parameters:
model_type (string) – The selected derived class name
- classmethod print_models()¶
Prints all model names.
- reduce_all(states_op, turbines_op)[source]¶
Reduces states and turbine dimension by some operation
- Parameters:
- Returns:
data – The fully contracted results
- Return type:
- reduce_states(vars_op)[source]¶
Reduces the states dimension by some operation
- Parameters:
vars_op (dict) – The operation per variable. Key: str, the variable name. Value: str, the operation, choices are: sum, mean, min, max.
- Returns:
data – The results per turbine
- Return type:
pandas.DataFrame
- reduce_turbines(vars_op)[source]¶
Reduces the turbine dimension by some operation
- Parameters:
vars_op (dict) – The operation per variable. Key: str, the variable name. Value: str, the operation, choices are: sum, mean, min, max.
- Returns:
data – The results per state
- Return type:
pandas.DataFrame
- weinsum(rhs, *vars)[source]¶
Calculates Einstein sum, adding weights as last argument to the given fields.
It’s all about treating NaN values.
- Parameters:
- Returns:
result – The results array
- Return type:
np.ndarray
- classmethod write(file_path, data, format_col2var={}, format_dict={}, **kwargs)¶
Writes data to file via pandas.
The kwargs are forwarded to the underlying pandas writing function.
- Parameters: