You can find here the code used to generate the data of the web page http://ptaff.ca/soleil/?lang=en_CA. This project was inspired by the file used to compute the sunset and the sunrise of the sun, this file is written by Henrik Härkönen and can be found on this web page.
For 1 or 2 geographical place on the earth, crepyscule produces four graphics:
If one chooses to show 2 places, the curves of these 2 places will lie on the same graphic, using different colors.
For now, the title of the graphs can be in english or in french, the default language being english. See the example of usage for more details.
Developed under GNU/Linux, this script is known to work under GNU/Linux and Windows; if you use another platform than GNU/Linux, please inform the developer in order to publish the documentation for this specific implementation.
In a general way, this application should be called in command line like this:
python crepyscule.py --filename=filename --ctime=ctime --background-color=bg_color --lat1=latitude1 --lon1=longitude1 --utc1=utc1 --tz1=timezone1 [--lat2=latitude2 --lon2=longitude2 --utc2=utc2 --tz2=timezone2] [--graph-sunrise-sunset] [--graph-sun-altitude] [--graph-daylight-variation] [--graph-solar-flux] [--text-sunrise-sunset] [--graph-all]
Parameter | Description |
---|---|
--version | Show program's version number and exit |
-h, --help | Show help message and exit |
-f FILENAME, --filename=FILENAME | Filename of the graphic |
--ctime=FTIME | ctime for the current day |
--background-color=SBACKGROUNDCOLOR | Background color of the graphics |
--lat1=FLAT1 | Latitude of the first place (negative value for south) |
--lon1=FLON1 | Longitude of the first place (negative value for west) |
--utc1=FUTC1 | Difference of the time zone compared to the UTC time for the first place |
--tz1=STZ1 | Time zone parameter used for summer time. Possible value are: IR, JD, EU, IQ, US, CH, EG, MX, SK, HK, NB, FK, PY, NZ, TS, BZ, CL, AU, TG, ZN, LB, SY, RU |
--lat2=FLAT2 | Latitude of the second place (negative value for south) |
--lon2=FLON2 | Longitude of the second place (negative value for west) |
--utc2=FUTC2 | Difference of the time zone compared to the UTC time for the second place |
--tz2=STZ2 | Time zone parameter for 2nd place. See --tz1 for possible value |
--graph-sunrise-sunset | Create the graphic for sunrise/sunset |
--graph-sun-altitude | Create the graphic for sun altitude |
--graph-daylight-variation | Create the graphic for daylight variation |
--graph-solar-flux | Create the graphic for the solar flux |
--graph-twilight-length | Create the graphic for the twilight length |
--text-sunrise-sunset | Create a text file containing the sunrise/sunset value |
--graph-all | Create all the graphics for these lat/lon |
[]
are optional; you may compare two places this way. Note that you should give at least one of the following options: --graph-sunrise-sunset
, --graph-sun-altitude
, --graph-daylight-variation
, --graph-solar-flux
, --text-sunrise-sunset
ou --graph-all
.;filename
parameter is used to indicate the path and the name of the image. The .png
extension is mandatory. The first graphic takes this exact name of the parameter; the altitude graphic will be have the same name but with the characters "_alt" added before the extension name .png
, the daily variation of daylight graphic will be have the same name but with the characters "_delta_t" added before the extension name .png
and the solar flux graphic will be have the same name but with the characters "_sf" added before the extension name .png
,;background-color
parameter should be in the X11 color list and should be written using lower case.;latitude
and longitude
parameters are real numbers. For example, we will represent 45°30' by 45.5;UTC
parameter represents the difference of the time zone compared to the UTC time. For example, for New York this parameter is -5.0;tz
parameter, please refer to file summer_time.py
or the file TZrules.dat
that comes with the kstars application. For the GNU/Linux system, this file is usually found at the path /usr/share/apps/kstars/
when kstars is installed.;LANGUAGE
environment variable..You can consult crepyscule's API.
For any bug report, please contact soleil.miguel@ptaff.ca
Copyright © 2005 Miguel Tremblay.
crepyscule is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.