solarspatialtools.stats.calc_quantile

solarspatialtools.stats.calc_quantile(timeseries, n_days='30d', quantile=0.9)

Calculate a single-day percentile-based summary of data by aggregating multiple days.

So the timeseries output on any given day represents the quantile-th percentile value over the past n-days during any particular timestamp.

An example usage of this is in the QCPV algorithm of Killinger et al. [1], who use it on a time series of PV data to compute an empirical ‘Clear Sky PV’ value that can be used to simulate a PV clear sky index.

Parameters

timeseriespandas.Series or pandas.DataFrame

the timeseries of input data. Needs to just be a single column or a Series

n_daysstr, default ‘30d’

the number of days window to use for the calculation on quantile in a format readable by pandas.to_timedelta()

quantilenumeric, default 0.9

the quantile level as a fraction

Returns

outputpandas.DataFrame

output timeseries. nan for first days of the series until enough days for the window to be met. The data will be stored in a column based on the input column name with “_quant” added.

[1] Killinger, Sven & Engerer, Nick & Müller, Björn. (2017). QCPV: A quality control algorithm for distributed photovoltaic array power output. Solar Energy. 143. 120-131. https://www.researchgate.net/publication/312145487_QCPV_A_quality_control_algorithm_for_distributed_photovoltaic_array_power_output