Astral

Calculations for the position of the sun
Download

Astral Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Simon Kennedy
  • Publisher web site:
  • http://www.sffjunkie.co.uk

Astral Tags


Astral Description

Calculations for the position of the sun Astral is a Python library for calculating the times of various aspects of the sun.It calculates the followingDawn The time in the morning when the sun is a specific number of degrees below the horizon.Sunrise The time in the morning when the top of the sun breaks the horizon (asuming a location with no obscuring features.)Solar Noon The time when the sun is at its highest point.Sunset The time in the evening when the sun is about to disappear below the horizon (asuming a location with no obscuring features.)Dusk The time in the evening when the sun is a specific number of degrees below the horizon.Solar Azimuth The number of degrees clockwise from North at which the sun can be seenSolar Elevation The number of degrees up from the horizon at which the sun can be seenRahukaalam "Rahukaalam or the period of Rahu is a certain amount of time every day that is considered inauspicious for any new venture according to Indian astrology".ExampleThe following example demonstrates the functionality available in the moduleimport datetimefrom astral import Astralcity_name = 'London'a = Astral()a.solar_depression = 'civil'city = aprint('Information for %s/%s ' % (city_name, city.country))timezone = city.timezoneprint('Timezone: %s' % timezone)print('Latitude: %.02f; Longitude: %.02f ' % (city.latitude, city.longitude))sun = city.sun(date=datetime.date(2009, 4, 22), local=True)print('Dawn: %s' % str(sun))print('Sunrise: %s' % str(sun))print('Noon: %s' % str(sun))print('Sunset: %s' % str(sun))print('Dusk: %s' % str(sun))Produces the following output:Information for London/EnglandTimezone: Europe/LondonLatitude: 51.60; Longitude: 0.08Dawn: 2009-04-22 05:12:56+01:00Sunrise: 2009-04-22 05:49:36+01:00Noon: 2009-04-22 12:58:48+01:00Sunset: 2009-04-22 20:09:07+01:00Dusk: 2009-04-22 20:45:52+01:00LicenseThis module is licensed under the terms of the MIT license.DependenciesAstral has one external dependency on 'pytz' which can either be obtained from Sourceforge page or via the easy_install method, whichever is your particular poison.InstallationWhen you've added the pytz package to install astral unzip the archive to a handy location and execute the standard Python installation method:python setup.py install Requirements: · Python


Astral Related Software