Sunrise Sunset Estimation#
Sunrise Sunset Estimation Algorithm Module
This module contains an algorithm for robust estimation of sunrise and sunset times from measured power data. This algorithm utilizes the following prior information:
That sunrise and sunset times vary slowly from day to day (smooth signals)
That sunrise and sunset times repeat on a yearly basis (periodic signals)
This algorithm attempt to estimate the true sunrise and sunset times, in accordance with standard geometric models of sun position. It uses holdout validation to tune the theshold parameter, as opposed to the subroutines in the DataHandler pipeline which do not tune this parameter. This algorithm should be used in situations where exact estimates of true sunrise and sunset times are required, such as for latitude and longitude estimation from data.
Bennet Meyers, 7/2/20
- class solardatatools.algorithms.sunrise_sunset_estimation.SunriseSunset#
Bases:
object- calculate_errors()#
- calculate_times(data, threshold=None, plot=False, figsize=(12, 10), zoom_fit=False, solver='OSQP')#
- calculate_true(dh, lat, lon, tz_offset)#
- run_optimizer(data, random_seed=None, search_pts=21, plot=False, figsize=(8, 6), solver='OSQP')#
- solardatatools.algorithms.sunrise_sunset_estimation.clock_to_solar(clock_time, lon, doy, gmt_offset, eot='duffie')#
- solardatatools.algorithms.sunrise_sunset_estimation.eot_da_rosa(day_of_year)#
The equation of time as defined in: ‘Haghdadi, Navid, et al. “A method to estimate the location and orientation of distributed photovoltaic systems from their generation output data.” Renewable Energy 108 (2017): 390-400.’ These are equations (7) and (8) in the paper. :param day_of_year: the day of year, can be int, float, or numpy array :return: the difference between clock time and solar time for a given day of year
- solardatatools.algorithms.sunrise_sunset_estimation.eot_duffie(day_of_year)#
The equation of time as defined in: ‘Duffie, John A., and William A. Beckman. Solar engineering of thermal processes. New York: Wiley, 1991.’ These are equations (1.4.2) and (1.5.3) in the book :param day_of_year: the day of year, can be int, float, or numpy array :return: the difference between clock time and solar time for a given day of year
- solardatatools.algorithms.sunrise_sunset_estimation.num_daylight_hours(doy, lat)#
- solardatatools.algorithms.sunrise_sunset_estimation.solar_to_clock(solar_time, lon, doy, gmt_offset, eot='duffie')#
- Parameters:
solar_time – solar time in minutes since midnight (float or array)
lon – longitude (float)
doy – day of year (float or array)
gmt_offset – local timezone offset in hours from UTC/GMT (float or int)
eot – string specifying which equation of time formulation to use
- Returns:
- solardatatools.algorithms.sunrise_sunset_estimation.sunrise_sunset_times(lat, lon, doy, gmt_offset, eot='duffie')#
- solardatatools.algorithms.sunrise_sunset_estimation.sunset_hour_angle(doy, lat)#