from solarlib.location import Location
import datetime
import pytz
latitude = -31.9505
longitude = 115.8605
timezone = 'Australia/Perth'
perth = Location(latitude,longitude,timezone)
The output is a python datetime object.
print(perth.sunrise('2020-06-27'))
2020-06-27 07:17:33.495057+08:00
The output is a python datetime object.
print(perth.sunset('2020-06-27'))
2020-06-27 17:21:50.791503+08:00
The output is a python timedelta object.
print(perth.day_length('2020-06-27'))
10:04:17.296446
The output is irradiance in
perth.solar_irradiance('2020-06-27 14:27:00')
0.7360521598862617
import matplotlib.pyplot as plt
output = perth.daily_irradiance('2020-06-27')
time, irradiance = list(zip(*output))
plt.plot(time,irradiance)