public
Description: Pysolar is a collection of Python libraries for simulating the irradiation of any point on earth by the sun. It includes code for extremely precise ephemeris calculations.
Home | Edit | New

Home

Pysolar

Pysolar is a collection of Python libraries for simulating the irradiation of any point on earth by the sun. It includes code for extremely precise ephemeris calculations, and more.

Hosting history

Pysolar was initially hosted on Sourceforge with Subversion, but we switched to git and Github in 2008. Earlier releases are still on the Sourceforge site for now, but you’re probably wrong if you think you want to download them. You can find more details and usage examples at pysolar.org

Difference from PyEphem

Pysolar is similar to PyEphem, with a few key differences. Both libraries compute the location of the sun based on Bretagnon’s VSOP 87 theory. Pysolar is aimed at modeling photovoltaic systems, while PyEphem is targeted at astronomers. Pysolar is written in pure Python, while PyEphem is a Python wrapper for the libastro library, written in C, which is part of XEphem.

Validation

Pysolar has recently been validated against similar ephemeris code maintained by the US Naval Observatory. In a random sampling of 6000 locations distributed across the Northern Hemisphere at random times in 2008, Pysolar matched the observatory’s predictions very accurately. The azimuth estimations correlated much more closely than the altitude estimations, but both agreed with the naval observatory’s to within less than 0.1 degrees on average.

More details on the validation page.

Prerequisites for use

Pysolar requires Python, which comes preinstalled on most Unix machines, including Apple’s OS X. You can check to see if you have it installed on a Unix machine by typing python at a command prompt. If the result is something like

Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>>

you have Python. (You can escape from the Python prompt with Ctrl-D.)

If the result is more like

bash: python: command not found

you probably don’t have Python.

If you need to, you can download Python from the Python.org download page.

Usage examples

Some usage examples to help you get started. See also the page on sun path analysis.

Contributors

Many people have contributed to Pysolar since its inception.

Thanks to Holger Zebner, Pietro Zambelli, Sean Taylor, Simeon Obinna Nwaogaidu, Tim Michelsen, and Lahmeyer International for their contributions of code, bugfixes, documentation, and general encouragement.

Pysolar has been used at several universities, including the University of Oldenburg in Germany and the University of Trento in Italy. It is also deployed in at least one commercial solar tracking system.

Old download statistics:

  • version 0.1.0: 22 downloads, 2007-04-18 – 2007-07-01
  • version 0.2.0: 97 downloads, 2007-07-01 – 2008-03-10
Last edited by pingswept, Fri Apr 10 21:39:40 -0700 2009
Home | Edit | New
Versions: