farms.utilities.uniform_variability

farms.utilities.uniform_variability(csr, cloud_type, var_frac, option='tri', tri_center=0.9)[source]

Get an array with uniform variability scalars centered at 1 that can be multiplied by a irradiance array with the same shape as csr.

Parameters:
  • csr (np.ndarray) – REST2 clearsky irradiance without bad or missing data. This is a 2D array with (time, sites).

  • cloud_type (np.ndarray) – Array of numerical cloud types.

  • var_frac (float) – Maximum variability fraction (0.05 is 5% variability).

  • option (str) – Variability function option (‘tri’ or ‘linear’).

  • tri_center (float) – Value of the clearsky ratio at which there is maximum variability (only used for the triangular distribution).

Returns:

variability_scalar (np.ndarray) – Array with shape matching csr with uniform random numbers centered at 1 with range (1 - var_frac) to (1 + var_frac). This array can be multiplied by an irradiance array with the same shape as csr