solarforecastarbiter.validation.validator.check_day_night_interval(solar_zenith, closed, interval_length, solar_zenith_interval_length=None, fraction_of_interval=0.1, max_zenith=87.0)[source]

Check for day/night periods based on solar zenith.

Interval average data may be analyzed by supplying higher resolution solar zenith data and parameters that describe the desired intervals.

  • solar_zenith (Series) – Solar zenith angle in degrees.
  • closed ({'left', 'right'}) – None for instantaneous data, ‘left’ for interval beginning labeled data, ‘right’ for interval ending labeled data.
  • interval_length (Timedelta) – Interval length to resample day/night periods to.
  • solar_zenith_interval_length (None or Timedelta) – If None, attempt to infer. Required if solar_zenith contains gaps.
  • fraction_of_interval (float) – The fraction of the points in an interval that must be daytime in order to mark the interval as daytime.
  • max_zenith (float) – Maximum zenith angle for a daylight time.

daytime (Series) – True when sufficient points within an interval are less than max_zenith. Index conforms to solar_zenith resampled to interval_length.


ValueError – If solar_zenith contains gaps and solar_zenith_interval_length is not provided.