Differences between revisions 4 and 5
Revision 4 as of 2009-06-09 15:48:36
Size: 702
Editor: CarlNobile
Comment:
Revision 5 as of 2009-06-09 15:51:55
Size: 922
Editor: CarlNobile
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
The constructor takes three positional arguments and one keyword argument. The constructor takes three positional arguments and one keyword argument. The {{{date}}} argument is a datetime object with timezone info, {{{lat}}} and {{{lon}}} are floating point values, and {{{zenith}}} is a string consisting of any of the above bold values--the default is '''official'''.

Sunrise Sunset

This class will determine the sunrise and sunset. It can use either official, civil, nautical, amateur, or astronomical zenith.

The constructor takes three positional arguments and one keyword argument. The date argument is a datetime object with timezone info, lat and lon are floating point values, and zenith is a string consisting of any of the above bold values--the default is official.

ss = SunriseSunset(date, lat, lon, zenith='official')

There are two callable methods after the class is instantiated.

The getSunRiseSet() method returns a tuple of datetime objects with timezome info.

rise, set = ss.getSunRiseSet()

The isNight() method returns True if it is nighttime and False if it is daytime.

isNight = ss.isNight()

sunrisesunset.py

SunriseSunset (last edited 2015-08-17 01:55:30 by CarlNobile)