SunTimes

SunTimes is a command line utility that determines, for a given day or a period of time:

The software needs the observer's position (longitude, latitude, altitude above sea level) and optionally accounts for atmospheric refraction.
Very precise algorithms are used for the computation of the sun position, but local atmospheric conditions can affect the actual values.
Exceptionally, the algorithm might not converge for very specific combinations of time and observer's location, but this limitation should not be problem for most of the users.

It can output either data tables or graphs.

Single day output

SunTimes shows times of sunrise, sunset, as well as morning and evening civil, nautical and astronomical twilights. It displays also the length of day, between sunrise and sunset, and also between the various morning and evening twilights. It also indicates the maximum sun altitude for the day of interest, and the minimum sun altitudes for the previous and next days.

Example:
>SunTimes.exe --day 12082007 --latitude 40 --longitude 3 --altitude 0.2 --verbose
Values for 12/08/2007 at 0.20 km height, 40° latitude and 3° longitude.

Morning Astronomical Twilight      : 03:10:08
Morning Nautical Twilight          : 03:48:45
Morning Civil Twilight             : 04:24:34

Sunrise                            : 04:57:08
Sun Transit                        : 11:53:06
Sunset                             : 18:49:03

Evening Civil Twilight             : 19:21:38
Evening Nautical Twilight          : 19:57:26
Evening Astronomical Twilight      : 20:36:04

Length Of Day:
- between sunrise and sunset       : 13:51:56
- between civil twilights          : 14:57:04
- between nautical twilights       : 16:08:41
- between astronomical twilights   : 17:25:56

Sun Elevations from observer's horizon, without atmospheric refraction:
Previous Minimum Sun Altitude  : -34.40°
Maximum Sun Altitude           : 65.45°
Next Minimum Sun Altitude      : -34.70°

Data table output for several days

The results are fomatted with seventeen columns:
Example:
>SunTimes.exe --start 01082007 --end 10082007 --latitude 40 --longitude 3 --altitude 0.2 --verbose
Values between 01/08/2007 and 10/08/2007 at 0.20 km height, 40° latitude and 3° longitude.
Interval is 1 day.

  Column 1  is the day (DD/MM/YYYY).
  Column 2  is the morning astronomical twilight time.
  Column 3  is the morning nautical twilight time.
  Column 4  is the morning civil twilight time.
  Column 5  is the sunrise time.
  Column 6  is the noon time.
  Column 7  is the sunset time.
  Column 8  is the evening civil twilight time.
  Column 9  is the evening nautical twilight time.
  Column 10 is the evening astronomical twilight time.
  Column 11 is the day length between sunrise and sunset.
  Column 12 is the day length between civil twilights.
  Column 13 is the day length between nautical twilights.
  Column 14 is the day length between astronomical twilights.
  Column 15 is the previous minimum sun altitude, in degrees.
  Column 16 is the maximum sun altitude, in degrees.
  Column 17 is the next minimum sun altitude, in degrees.

          	------ Morning ------	   	     	     	------ Evening ------	------- Length Of Day -------	------ Sun Altitudes -------
Day       	Astro	Nauti	Civil	Rise 	Noon 	Set  	Civil	Nauti	Astro	Day	Civil	Nauti	Astro	Prev Min	Max	Next Min
01 Aug 2007	02:54	03:36	04:13	04:47	11:54	19:02	19:36	20:13	20:55	14:15	15:23	16:38	18:01	-31.38		68.49	-31.63
02 Aug 2007	02:56	03:37	04:14	04:48	11:54	19:01	19:34	20:12	20:53	14:13	15:20	16:35	17:57	-31.63		68.24	-31.89
03 Aug 2007	02:57	03:38	04:15	04:49	11:54	18:60	19:33	20:11	20:51	14:11	15:18	16:33	17:54	-31.89		67.98	-32.15
04 Aug 2007	02:58	03:39	04:16	04:50	11:54	18:59	19:32	20:09	20:50	14:09	15:16	16:30	17:51	-32.15		67.72	-32.41
05 Aug 2007	02:60	03:40	04:17	04:51	11:54	18:58	19:31	20:08	20:48	14:07	15:14	16:27	17:48	-32.41		67.45	-32.68
06 Aug 2007	03:01	03:42	04:18	04:51	11:54	18:56	19:30	20:06	20:46	14:05	15:11	16:25	17:45	-32.68		67.18	-32.96
07 Aug 2007	03:03	03:43	04:19	04:52	11:54	18:55	19:28	20:05	20:45	14:03	15:09	16:22	17:42	-32.96		66.90	-33.24
08 Aug 2007	03:04	03:44	04:20	04:53	11:54	18:54	19:27	20:03	20:43	14:01	15:07	16:20	17:39	-33.24		66.62	-33.52
09 Aug 2007	03:06	03:45	04:21	04:54	11:54	18:53	19:26	20:02	20:41	13:59	15:04	16:17	17:36	-33.52		66.34	-33.81
10 Aug 2007	03:07	03:46	04:22	04:55	11:53	18:52	19:24	20:00	20:40	13:56	15:02	16:14	17:32	-33.81		66.05	-34.10

Combined Graph output

SunTimes can generate a single image file with three different plots. The x-axis corresponds to the days.
The upper plot contains the transit, sunrise, sunset and twilights times.
The middle plot contains the lengths of days, from sunrise to sunset and between the different morning and evening twilights.
The lower plot contains the minimum and maximum sun elevations.

Example:
>SunTimes.exe --start 01012007 --end 31122007 --latitude 40 --longitude 3 --altitude 0.2 --graph 'test.png' --height 600
SunTimes combined graph output example

Transit, sunrise, sunset and twilights times graph output

The x-axis corresponds to the days.
The red line is the UTC sun transit time.
The gray lines is the UTC sunrise/sunset and civil, nautical and astronomical morning and evening times.

Example:
>SunTimes.exe --start 01012007 --end 31122007 --latitude 40 --longitude 3 --altitude 0.2 --graphtimes 'test.png'
SunTimes times graph output example

Day length graph output

The x-axis corresponds to the days.
The yellow line correspond to day length from sunrise to sunset.
The orange lines correspondent to day length from civil, nautical and astronomical twilights.

Example:
>SunTimes.exe --start 01012007 --end 31122007 --latitude 40 --longitude 3 --altitude 0.2 --graphdaylen 'test.png'
SunTimes day length graph output example

Sun elevation graph output

The x-axis corresponds to the days.
The green lines correspond to minimum and maximum sun elevations.

Example:
>SunTimes.exe --start 01012007 --end 31122007 --latitude 40 --longitude 3 --altitude 0.2 --graphalt 'test.png'
SunTimes sun elevation graph output example

Download

Current version is 1.1.1.0.

SunTimes binary and source can be downloaded through anonymous SVN at the following address:
https://anonsvn.loudet.org/SunTimes/tags/

SunTimes has been developped in C# under MonoDevelop 2.0. It can also be compiled under Visual Studio Express 2010.
It has been tested under Linux Ubuntu 9.10/Mono 2.4.2.3, and under Windows XP/.NET 2.0.

Installation

Under Windows, it is necessary to install :
Under Linux, it is necessary to install :
In addition, gnuplot must be installed to generate graphs: Refer to the gnuplot homepage. Under Linux, gnuplot needs the Arial font that must be installed, and the environment variable GDFONTPATH must be initialized to the relevant font path, for instance:

Changelog


Help

 | --start  --end 
    --longitude  --latitude  | --locator 
    --altitude  --step  [--refract|-r] [--verbose|-v]
    [--extended|-e] [--mysql|-m]
    [--gnuplot ""]
    [--graph null|""]
      [--height ] [--width ]
    [--graphtimes null|""]
      [--heighttimes ] [--widthtimes ]
    [--graphdaylen null|""]
      [--heightdaylen ] [--widthdaylen ]
    [--graphalt null|""]
      [--heightalt ] [--widthal ]

  Options:
    help        Shows this message.
    day         Date for which the values are calculated, for a single day
                calculation. Default is the current day.
                Format is DDMMYYYY (e.g. 12012006 for 12 January 2006).
    start       Start day for several days calculations.
                Format is DDMMYYYY (e.g. 12012006 for 12 January 2006).
    end         End day for several days calculations.
                Format is DDMMYYYY (e.g. 12012006 for 12 January 2006).
    longitude   Value between -180 and 180 expressing the longitude of the
                location in degrees. String representations are accepted.
                Positive values in the eastern hemisphere. Default is 0.
    latitude    Value between -90 and 90 expressing the latitude of the
                location in degrees. String representations are accepted.
                Positive values in the northern hemisphere. Default is 0.
    locator     Maidenhead locator of the location. If set, latitude
                and longitude options must not be defined.
    altitude    Real non negative value expressing the height of the observer
                for which the sun altitudes are calculated.
                Expressed in kilometers. Default is 0km (ground level).
    step        Positive integer value representing the interval in days
                between two computations. Default is 1.
    refract     Indicates if the atmospheric refraction is accounted for.
    verbose     Shows legend.
    extended    Shows full date and time (dd MMM YYYY HH:MM:SS).
    mysql       Shows full date and time in mysql format (YYYYMMddHHMMSS).
    gnuplot     Path to the gnuplot executable. If empty, default is:
                on Windows platforms [Program Files Directory]\gnuplot\bin\wgnuplot.exe.
                on Linux platforms /usr/bin/gnuplot.
    graph       Path to the png file that will be created.
                set to null if the image is to be sent to stdout.
                Plot contains sunrise/transit/set/twilights times, day lengths
                and altitudes.
    height      height of the png image, in pixels. Default is 400.
    width       width of the png image, in pixels. Default is 745.
    graphtimes  Path to the Times png file that will be created.
                set to null if the image is to be sent to stdout.
                Plot contains sunrise/transit/set/twilights times.
    heighttimes height of the Times png image, in pixels. Default is 400.
    widthtimes  width of the Times png image, in pixels. Default is 745.
    graphdaylen Path to the  Day Lengths png file that will be created.
                set to null if the image is to be sent to stdout.
                Plot contains day lengths.
    heightdaylen height of the  Day Lengths png image, in pixels. Default is 400.
    widthdaylen width of the Day Lengths png image, in pixels. Default is 745.
    graphalt    Path to the Altitudes png file that will be created.
                set to null if the image is to be sent to stdout.
                Plot contains sun altitudes.
    heightalt   height of the Altitudes png image, in pixels. Default is 400.
    widthalt    width of the Altitudes png image, in pixels. Default is 745.
]]>
Creative Commons License SID monitoring station by Lionel LOUDET is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Disclaimer
Last Update: 04 Apr 2013
Apache Web Server PHP
Apache/2.4.59 (Debian)
Valid XHTML + RDFa Valid CSS!
Page generated in 0.053 seconds.