Module crepyscule_summer_time
[show private | hide private]
[frames | no frames]

Module crepyscule_summer_time

Adjust the sunset and sunrise hour depending on the timezone. The list of timezone (lTimezone) is based on software kstars of the kdeedu project (http://edu.kde.org/kstars/). The original file contains informations by column like this: city : province : country : Lat_deg : Lat_min : Lat_sec : N|S : Lon_deg : Lon_min : Lon_sec : E|W : UTC_difference : two_letters[??]

Project home page is http://ptaff.ca/crepyscule/
Function Summary
list adjust_summer_time(lSunrise, lSunset, sTimezone, nYear)
Adjust the hour of sunset and sunrise depending of the summer time
  adjust_summer_time_one_day(tDay, fValue, sTimezone)
Adjust the hour of sunset and sunrise depending of the summer time for this particular day.
tuple get_summer_time_days(sSummerCode, nYear)
Return in julian day the beginning of daylight time and the end of daylight time.
int __get_day(sPosition, sDay, sMonth, nYear)
Get the day of the month corresponding to the position in the month.
int __get_julian(sDate)
Return julian day corresponding to iso 8601 date format is YYYY-MM-DD

Function Details

adjust_summer_time(lSunrise, lSunset, sTimezone, nYear)

Adjust the hour of sunset and sunrise depending of the summer time
Parameters:
lSunrise - List of sunrise for the whole year.
           (type=list)
lSunset - List of sunset for the whole year.
           (type=list)
sTimezone - Summer time two letters code
           (type=string)
nYear - Year to retrieve the dates for this summer code.
           (type=int)
Returns:
List of the adjusted value of sunrise and sunset: [lSunrise, lSunset]
           (type=list)

adjust_summer_time_one_day(tDay, fValue, sTimezone)

Adjust the hour of sunset and sunrise depending of the summer time for this particular day.
Parameters:
tDay - Tuple of this day in the format (nYear, nMonth, nDay)
           (type=tuple)
fValue - sunrise or sunset value to adjust following summertime.
           (type=float)

get_summer_time_days(sSummerCode, nYear)

Return in julian day the beginning of daylight time and the end of daylight time.
Parameters:
sSummerCode - summer time two letters code
           (type=string)
nYear - Year to retrieve the dates for this summer code. Might have an effect in the case of 'US' since it had been change in 2007.
           (type=int)
Returns:
First and last julian day for this summer time code
           (type=tuple)

__get_day(sPosition, sDay, sMonth, nYear)

Get the day of the month corresponding to the position in the month. Eg: First monday of april would be __get_day('first', 'MON', 'APR')
Parameters:
sPosition - Value in ['first', 'second', 'third', 'last']
           (type=string)
sDay - Day of the week. See dWeek for possible value of string.
           (type=string)
sMonth - Month of the date. See dMonth for possible value of string.
           (type=string)
nYear - Year of which to retrieve the julian day.
           (type=int)
Returns:
Julian day of the year for this date.
           (type=int)

__get_julian(sDate)

Return julian day corresponding to iso 8601 date format is YYYY-MM-DD
Parameters:
sDate - ISO8601 date. Format is YYYY-MM-DD
           (type=string)
Returns:
Julian day
           (type=int)

Generated by Epydoc 2.1 on Wed Jan 28 21:01:07 2009 http://epydoc.sf.net