rdtools.soiling.soiling_srr
- rdtools.soiling.soiling_srr(energy_normalized_daily, insolation_daily, reps=1000, precipitation_daily=None, day_scale=13, clean_threshold='infer', trim=False, method='half_norm_clean', clean_criterion='shift', precip_threshold=0.01, min_interval_length=7, exceedance_prob=95.0, confidence_level=68.2, recenter=True, max_relative_slope_error=500.0, max_negative_step=0.05, outlier_factor=1.5)
Functional wrapper for
SRRAnalysis
. Perform the stochastic rate and recovery soiling loss calculation. Based on the methods presented in Deceglie et al. JPV 8(2) p547 2018.- Parameters:
energy_normalized_daily (pandas.Series) -- Daily performance metric (i.e. performance index, yield, etc.) Alternatively, the soiling ratio output of a soiling sensor (e.g. the photocurrent ratio between matched dirty and clean PV reference cells). In either case, data should be insolation-weighted daily aggregates.
insolation_daily (pandas.Series) -- Daily plane-of-array insolation corresponding to energy_normalized_daily. Arbitrary units.
reps (int, default 1000) -- number of Monte Carlo realizations to calculate
precipitation_daily (pandas.Series, default None) -- Daily total precipitation. Units ambiguous but should be the same as precip_threshold. Note default behavior of precip_threshold. (Ignored if
clean_criterion='shift'
.)day_scale (int, default 13) -- The number of days to use in rolling median for cleaning detection, and the maximum number of days of missing data to tolerate in a valid interval. An odd value is recommended.
clean_threshold (float or 'infer', default 'infer') -- The fractional positive shift in rolling median for cleaning detection. Or specify 'infer' to automatically use outliers in the shift as the threshold.
trim (bool, default False) -- Whether to trim (remove) the first and last soiling intervals to avoid inclusion of partial intervals
method (str, {'half_norm_clean', 'random_clean', 'perfect_clean'} default 'half_norm_clean') --
How to treat the recovery of each cleaning event
'random_clean' - a random recovery between 0-100%
'perfect_clean' - each cleaning event returns the performance metric to 1
'half_norm_clean' - The starting point of each interval is taken randomly from a half normal distribution with its mode (mu) at 1 and its sigma equal to 1/3 * (1-b) where b is the intercept of the fit to the interval.
clean_criterion (str, {'shift', 'precip_and_shift', 'precip_or_shift', 'precip'} default 'shift') --
The method of partitioning the dataset into soiling intervals
'precip_and_shift' - rolling median shifts must coincide with precipitation to be a valid cleaning event.
'precip_or_shift' - rolling median shifts and precipitation events are each sufficient on their own to be a cleaning event.
'shift', only rolling median shifts are treated as cleaning events.
'precip', only precipitation events are treated as cleaning events.
precip_threshold (float, default 0.01) -- The daily precipitation threshold for defining precipitation cleaning events. Units must be consistent with precip.
min_interval_length (int, default 7) -- The minimum duration, in days, for an interval to be considered valid. Cannot be less than 2 (days).
exceedance_prob (float, default 95.0) -- the probability level to use for exceedance value calculation in percent
confidence_level (float, default 68.2) -- the size of the confidence interval to return, in percent
recenter (bool, default True) -- specify whether data is centered to normalized yield of 1 based on first year median
max_relative_slope_error (float, default 500.0) -- the maximum relative size of the slope confidence interval for an interval to be considered valid (percentage).
max_negative_step (float, default 0.05) -- The maximum magnitude of negative discrete steps allowed in an interval for the interval to be considered valid (units of normalized performance metric).
outlier_factor (float, default 1.5) -- The factor used in the Tukey fence definition of outliers for flagging positive shifts in the rolling median used for cleaning detection. A smaller value will cause more and smaller shifts to be classified as cleaning events.
- Returns:
insolation_weighted_soiling_ratio (float) -- P50 insolation weighted soiling ratio based on stochastic rate and recovery analysis
confidence_interval (numpy.array) -- confidence interval (size specified by
confidence_level
) of degradation rate estimatecalc_info (dict) --
'renormalizing_factor' - value used to recenter data
'exceedance_level' - the insolation-weighted soiling ratio that was outperformed with probability of exceedance_prob
'stochastic_soiling_profiles' - List of Pandas series corresponding to the Monte Carlo realizations of soiling ratio profiles
'soiling_ratio_perfect_clean' - Pandas series of the soiling ratio during valid soiling intervals assuming perfect cleaning and P50 slopes
'soiling_interval_summary' - Pandas dataframe summarizing the soiling intervals identified. The columns of the dataframe are as follows:
Column Name
Description
'start'
Start timestamp of the soiling interval
'end'
End timestamp of the soiling interval
'soiling_rate'
P50 Soiling rate for interval, in day^−1 Negative value indicates soiling is occurring. E.g. a rate of −0.01 indicates 1% soiling loss per day.
'soiling_rate_low'
Low edge of confidence interval for soiling rate for interval, in day^−1
'soiling_rate_high'
High edge of confidence interval for soiling rate for interval, in day^−1
'inferred_start_loss'
Estimated performance metric at the start of the interval
'inferred_end_loss'
Estimated performance metric at the end of the interval
'length'
Number of days in the interval
'valid'
Whether the interval meets the criteria to be treated as a valid soiling interval