Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Python wrapper for sun position algorithm written in c++ by Blanco-Muriel.

Project Description

Python wrapper for sun position algorithm written in c++ by Blanco-Muriel. Accuracy 1 degree for the time interval from 1999 to 2015.

Blanco-Muriel M., Alarcon-Padilla D.C., Lopez-Mratalla D., and Lara-Coira M., “Computing the Solar Vector”, Solar Energy Vol. 70, No. 5, pp. 431-441, 2001.

To calculate sun position:
>>> import sunpos:
>>> print sunpos.__doc__

Sunpos package provides three structueres:


whith fields:

iYear:year, integer
iMonth:month, integer
iDay:day, integer
dHours:double, UTC hours
dMinutes:double, minutes
dSeconds:double, seconds

with fields:

dLongitude:double, longitude
dLatitude:double, latitude

with fields:

dZenithAngle:double, zenith angle, degrees
dAzimuth:double, azimuth angle, degrees
>>> loc=sunpos.cLocation()
>>> loc.dLatitude = 43.1
>>> loc.dLongitude = 131.9
>>> time=sunpos.cTime()
>>> time.iYear = 2013 #imteger, year
>>> time.iMonth = 10 #Integer, month
>>> time.iDay = 13 #integer, day
>>> time.dHours = 16 #double, hours UTC
>>> time.dMinutes = 32 #double, minutes
>>> time.dSeconds = 12 #double, seconds
>>> #calculations
>>> res = sunpos.sunposf(time, loc)
>>> #or
>>> res = sunpos.cSunCoordinates()
>>> sunpos.sunpos(time, loc, res)
>>> print res.dZenithAngle # sun's zenith  angle
>>> print res.dAzimuth # sun's azimuth  angle:

Release History

This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(34.5 kB) Copy SHA256 Hash SHA256
Source None Mar 31, 2013

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers