How to use the pysolar.radiation.get_radiation_direct function in pysolar

To help you get started, we’ve selected a few pysolar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enesbcs / rpieasy / commands.py View on Github external
elif svname==SysVars[27]: #sun radiation
    try:
      from pytz import reference
      from pysolar.solar import get_altitude
      from pysolar.radiation import get_radiation_direct
      pysolarsupported = 1
    except:
      pysolarsupported = 0
    res = "-1"
    if pysolarsupported==1:
     try:
      localtime = reference.LocalTimezone()
      today = datetime.now(localtime)
      altitude_deg = get_altitude(Settings.AdvSettings["Latitude"],Settings.AdvSettings["Longitude"], today)
      res = get_radiation_direct(today, altitude_deg)
     except Exception as e:
      print(e)
     return res

 return res

pysolar

Collection of Python libraries for simulating the irradiation of any point on earth by the sun

GPL-3.0
Latest version published 1 year ago

Package Health Score

56 / 100
Full package analysis