Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Astral 0.7.2

    Download button

    No screenshots available
    Downloads: 469  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Simon Kennedy | More programs
    MIT/X Consortium Lic... / FREE
    September 19th, 2012, 13:55 GMT [view history]
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    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 following

    Dawn
     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 seen
    Solar Elevation
     The number of degrees up from the horizon at which the sun can be seen
    Rahukaalam
     "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".

    Example

    The following example demonstrates the functionality available in the module

    import datetime
    from astral import Astral

    city_name = 'London'

    a = Astral()
    a.solar_depression = 'civil'

    city = a[city_name]

    print('Information for %s/%s
    ' % (city_name, city.country))

    timezone = city.timezone
    print('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['dawn']))
    print('Sunrise: %s' % str(sun['sunrise']))
    print('Noon: %s' % str(sun['noon']))
    print('Sunset: %s' % str(sun['sunset']))
    print('Dusk: %s' % str(sun['dusk']))


    Produces the following output:

    Information for London/England

    Timezone: Europe/London
    Latitude: 51.60; Longitude: 0.08

    Dawn: 2009-04-22 05:12:56+01:00
    Sunrise: 2009-04-22 05:49:36+01:00
    Noon: 2009-04-22 12:58:48+01:00
    Sunset: 2009-04-22 20:09:07+01:00
    Dusk: 2009-04-22 20:45:52+01:00


    License

    This module is licensed under the terms of the MIT license.

    Dependencies

    Astral 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.

    Installation

    When 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


    Product's homepage

    Requirements:

    · Python

    What's New in This Release: [ read full changelog ]

    · Minor bug fix in GoogleGeocoder. location name and region are now stripped of whitespace.

      


    TAGS:

    sun position | calculate position | Python library | sun | position | calculator

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM