Every repository with this icon (
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
CONTRIBUTORS.markdown | Mon Nov 09 18:41:46 -0800 2009 | |
| |
COPYING | Sat Mar 01 15:36:54 -0800 2008 | |
| |
MANIFEST.in | Thu Jun 18 20:29:58 -0700 2009 | |
| |
README.markdown | Fri Apr 10 20:34:58 -0700 2009 | |
| |
__init__.py | Thu Jun 18 14:42:42 -0700 2009 | |
| |
constants.py | Sat Mar 08 17:06:06 -0800 2008 | |
| |
doc/ | Tue Jan 27 20:19:03 -0800 2009 | |
| |
horizon.py | Thu Jun 18 14:42:42 -0700 2009 | |
| |
images/ | Fri Apr 10 21:52:13 -0700 2009 | |
| |
julian.py | Fri May 23 05:49:49 -0700 2008 | |
| |
poly.py | Sat Mar 08 17:06:06 -0800 2008 | |
| |
pysolar.org/ | Mon Nov 09 18:19:10 -0800 2009 | |
| |
pysolar_v_usno.csv | Sun Jan 11 17:39:44 -0800 2009 | |
| |
query_usno.py | Sun Jan 11 17:34:39 -0800 2009 | |
| |
radiation.py | Fri Sep 18 07:42:20 -0700 2009 | |
| |
setup.py | Thu Jun 18 20:29:58 -0700 2009 | |
| |
shade.py | Sat Mar 01 15:36:54 -0800 2008 | |
| |
shade_test.py | Sat Mar 01 15:36:54 -0800 2008 | |
| |
simulate.py | Fri Apr 10 20:44:58 -0700 2009 | |
| |
solar.py | Sun Jan 11 17:34:39 -0800 2009 | |
| |
sun_path_widget.py | Thu Jun 18 14:42:42 -0700 2009 | |
| |
testsolar.py | Sun Jan 11 17:34:39 -0800 2009 | |
| |
usno_data_6259.txt | Sat Jul 19 18:41:04 -0700 2008 | |
| |
usno_data_short_test.txt | Sat Jul 19 18:41:04 -0700 2008 | |
| |
util.py | Tue Nov 10 20:18:59 -0800 2009 |
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.
Rough steps for use, until either forever or I have time to write more documentation:
- Install python.
- Get to a Python prompt.
- Execute code:
import datetime, solar d = datetime.datetime.utcnow() lat = 42.0 long = -71.0 solar.GetAltitude(lat, long, d) solar.GetAzimuth(lat, long, d)
For better examples of usage, see the examples on Github.
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 on Github.
A request
If you use Pysolar, please let me know how accurate it is. It's difficult to measure sun location with great precision, but I'd love to hear reports like, "Yeah, it worked to within a degree over the course of an afternoon in Spain."
Developer contact info
brandon at pingswept org







