farms.utilities

Common utilities FARMS module.

Functions

calc_beta(aod, alpha)

Calculate the Angstrom turbidity coeff.

calc_dhi(dni, ghi, sza)

Calculate the diffuse horizontal irradiance and correct the direct.

check_range(data, name[, rang])

Ensure that data values are in correct range.

cloud_variability(irrad, cs_irrad, cloud_type)

Add syntehtic variability to irradiance when it's cloudy.

dark_night(irrad_data, sza[, lim])

Enforce zero irradiance when solar angle >= threshold.

linear_variability(csr, var_frac)

Return an array with a linear relation between clearsky ratio and maximum variability fraction.

merge_rest_farms(clearsky_irrad, ...)

Combine clearsky and rest data into all-sky irradiance array.

normal_variability(csr, cloud_type, var_frac)

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

rayleigh(dhi, cs_dhi, fill_flag[, rayleigh_flag])

Perform Rayleigh violation check (all-sky diffuse >= clearsky diffuse).

screen_cld(cld_data[, rng])

Enforce a numeric range on cloud property data.

screen_sza(sza[, lim])

Enforce an upper limit on the solar zenith angle.

ti_to_radius(time_index[, n_cols])

Calculates Earth-Sun Radius Vector.

ti_to_radius_csv(time_index[, n_cols])

Convert a time index to radius.

tri_variability(csr, var_frac[, tri_center])

Return an array with a triangular distribution between clearsky ratio and maximum variability fraction.

uniform_variability(csr, cloud_type, var_frac)

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