pvanalytics.features.daytime.power_or_irradiance#

pvanalytics.features.daytime.power_or_irradiance(series, outliers=None, low_value_threshold=0.003, low_median_threshold=0.0015, low_diff_threshold=0.0005, median_days=7, clipping=None, freq=None, correction_window=31, hours_min=5, day_length_difference_max=30, day_length_window=14)#

Return True for values that are during the day.

After removing outliers and normalizing the data, a time is classified as night when two of the following three criteria are satisfied:

  • near-zero value

  • near-zero first-order derivative

  • near-zero rolling median at the same time over the surrounding week (see median_days)

Mid-day times where power goes near zero or stops changing may be incorrectly classified as night. To correct these errors, night or day periods with duration that is too long or too short are identified, and times in these periods are re-classified to have the majority value at the same time on preceding and following days (as set by correction_window).

Finally any values that are True in clipping are marked as day.

Parameters
  • series (Series) – Time series of power or irradiance.

  • outliers (Series, optional) – Boolean time series with True for values in series that are outliers.

  • low_value_threshold (float, default 0.003) – Maximum normalized power or irradiance value for a time to be considered night.

  • low_median_threshold (float, default 0.0015) – Maximum rolling median of power or irradiance for a time to be considered night.

  • low_diff_threshold (float, default 0.0005) – Maximum derivative of normalized power or irradiance for a time to be considered night.

  • median_days (int, default 7) – Number of days to use to calculate the rolling median at each minute. [days]

  • clipping (Series, optional) – True when clipping indicated. Any values where clipping is indicated are automatically considered ‘daytime’.

  • freq (str, optional) – A pandas freqstr specifying the expected timestamp spacing for the series. If None, the frequency will be inferred from the index.

  • correction_window (int, default 31) – Number of adjacent days to examine when correcting day/night classification errors. [days]

  • hours_min (float, default 5) – Minimum number of hours in a contiguous period of day or night. A day/night period shorter than hours_min is flagged for error correction. [hours]

  • day_length_difference_max (float, default 30) – Days with length that is day_length_difference_max minutes less than the median length of surrounding days are flagged for corrections.

  • day_length_window (int, default 14) – The length of the rolling window used for calculating the median length of the day when correcting errors in the morning or afternoon. [days]

Returns

Boolean time series with True for times that are during the day.

Return type

Series

Notes

NA values are treated like zeros.

References

1

Perry K., Meyers B., and Muller, M. “Survey of Time Shift Detection Algorithms for Measured PV Data”, 2023 PV Reliability Workshop (PVRW).

Examples using pvanalytics.features.daytime.power_or_irradiance#

Day-Night Masking

Day-Night Masking

Clearsky Limits for Irradiance Data

Clearsky Limits for Irradiance Data

Flag Sunny Days for a Fixed-Tilt System

Flag Sunny Days for a Fixed-Tilt System

Flag Sunny Days for a Tracking System

Flag Sunny Days for a Tracking System

PV Fleets QA Process: Irradiance

PV Fleets QA Process: Irradiance

PV Fleets QA Process: Power

PV Fleets QA Process: Power

Identifying and estimating time shifts

Identifying and estimating time shifts

Detect if a System is Tracking

Detect if a System is Tracking

Module Temperature Check

Module Temperature Check