solarspatialtools.synthirrad.copula.downscale_multihour
- solarspatialtools.synthirrad.copula.downscale_multihour(times, e_pos, n_pos, cloud_spd, cloud_dir, mean_csi, params, seed=None, scale=True, noneg=True)
Downscale the synthetic CSI for a position field using a copula. This implementation allows for multiple hours to be computed in one call, with different specification of cloud_spd, cloud_dir, mean_csi and params.
Based on methods developed by Widen and Munkhammar [1].
Parameters
- timespd.DatetimeIndex or list(pd.DatetimeIndex)
A DatetimeIndex of shape (n_times,) representing the time points for which to compute distances. Should represent a single hour or time period, corresponding to each entry in mean_csi.
- e_posnp.array
The eastward positions of the sites, shape (n_sites,)
- n_posnp.array
The northward positions of the sites, shape (n_sites,)
- cloud_spdnp.array
The cloud speed in the same units as Epos and Npos per unit time. This is used to compute the spacetime distances. Multiple values can be used for multiple hours.
- cloud_dirnp.array
The cloud direction in radians, where 0 is eastward and pi/2 is northward. This is used to compute the spacetime distances. Multiple values can be used for multiple hours.
- mean_csinp.array
The mean CSI for the hour, used to compute the parameters of the GMM. Multiple values can be used for multiple hours.
- paramsdict or list(dict)
The parameters of the model, containing at least: - ‘comp’: [a, c] parameters for the sigmoid function that determines the cloudy component weight based on meanCSI. - ‘mean’: [m_cloud, m_clear, c] parameters for computing the means of the cloud and clear components based on meanCSI and the cloudy component weight. - ‘sdevClear’: [sdev_clear_max, a, c] parameters for computing the standard deviation of the clear component based on meanCSI. - ‘sdevCloud’: [sdev_cloud_max, a, c] parameters for computing the standard deviation of the cloud component based on meanCSI.
- seedint or None
Seed for the random number generator.
- scalebool
Should the output be scaled to match mean_csi? Scale will occur on hourly basis.
- nonegbool
Should negative values be set to zero?
Returns
- np.array
The synthetic CSI values generated by the copula, shape (n_times * n_hours, n_sites). Concatenated for all hours.
References
[1] Widen, J. and Munkhammar, J., “Spatio-Temporal Downscaling of Hourly Solar irradiance Data Using Gaussian Copulas,” 2019 IEEE 46th Photovoltaic Specialists Conference (PVSC), Chicago, IL, USA, 2019, pp. 3172-3178, doi: https://dx.doi.org/10.1109/PVSC40753.2019.8980922.