SunCalc Guide
SunCalc Guide
@database 0218f020-1
@master SunCalc.guide
@$VER: 1.0
@remark Created with Heddley v1.1 (c) Edd Dumbill 1994
@{b}SunCalc V1.1a
======================================================================
This software is provided "AS IS" without warranty of any kind, either
expressed or implied.
@endnode
SunCalc is a Shell based program which calculates Sunrise and Sunset for a
particular location given the longitude & latitude, time zone and date.
Thanks to @{"several users" link "Document_7" 0} in Australia and New Zealand who
Page: 1
File: G:\Long-Term Storage\DATA\SunCalc\SunCalc.guide 3/6/1998, 8:49:50 PM
provided feedback
for Version 1, I can now say that SunCalc has been tested in the Southern
Hemisphere.
SunCalc requires WorkBench 2.04+. I have tested SunCalc with Workbench 2.1
and 3.1.
@{u}To Do@{uu}
1. SunCalc GUI
If you have any other ideas @{"please let me know" link "Document_4" 0}.
Running SunCalc without any arguments calculates the Sunrise and Sunset for
the default location (where I live in Halifax/Dartmouth Nova Scotia, Canada)
for the current system date with the Daylight Savings Time flag set to
FALSE/OFF/0 (ie. Standard Time).
Note: You can change the defaults by adding environmental variables - @{"see" link
"Document_3" 176}
@{"below" link "Document_3" 176}.
SunCalc was written mainly as a Shell/CLI program but it can also be used
from @{"WorkBench" link "Document_3" 146}.
@{u}Shell/CLI Usage@{uu}
Command format:
'SunCalc [?][date=dd-mm-yy][latitude=xx.xxx][longitude=xx.xxx]
[tz=xx][dst][text="output message"][odf=x][otf=x]'
@{u}Options:@{uu}
Page: 2
File: G:\Long-Term Storage\DATA\SunCalc\SunCalc.guide 3/6/1998, 8:49:50 PM
Page: 3
File: G:\Long-Term Storage\DATA\SunCalc\SunCalc.guide 3/6/1998, 8:49:50 PM
"DATE/K,LATITUDE/K,LONGITUDE/K,TZ/K,DST/S,
TEXT/K,ODF/K,OTF/K:"
@{b}Examples@{ub}
1. Calculate the sunrise and sunset times for Boston, Mass. on 10 March 1986
at longitude 71.05 degrees W longitude and 42.37 degrees N latitude. The time
zone correction for Boston is GMT-5 (use -5 hours). The Daylight Savings
Time flag is not required as 10 March is Standard Time.
2. Using the data from example 1 above, add a text string to the output;
namely: 'For Boston, Mass. Sunrise at: $SR Sunset at: $SS'.
For Boston, Mass. Sunrise at: 0605 hrs Sunset at: 1744 hrs
3. Using the data from example 1 and 2 above, customize the output using
OTF, ODF, newline and TAB characters:
@{u}WorkBench Usage@{uu}
SunCalc may also be used from the WorkBench using the above arguments as
ToolTypes with the supplied icon. For example, lets try example 3 above from
Page: 4
File: G:\Long-Term Storage\DATA\SunCalc\SunCalc.guide 3/6/1998, 8:49:50 PM
date=10-3-86
longitude=71.05W
latitude=42.37N
tz=-5
text=\\nFor Boston, Mass. on $DATE\\n\\n\\tSunrise
at:\\t$SR\\n\\tSunset at:\\t$SS\\n
otf=1
odf=3
Save these TolTypes and double click on the icon. A small window will be
opened and the following text will be displayed:
To calculate sunrise & sunset for the current date, delete the DATE
tooltype.
Note that double quotations are not required around the string for the
'text' variable.
@{u}Environmental Variables@{uu}
longitude
latitude
tz
dst
text
otf
odf
The only SunCalc argument which does not have an environmental variable
equivalent is 'date'. The default date is the system date. This default
cannot be changed.
setenv suncalc/longitude=75.05W
Now whenever SunCalc is used, the value of 75.05W will be used for
'longitude' as long as it is not overridden by a 'longitude' shell argument
or tooltype. In order for this environmental variable to remain in effect
after a reboot, you must copy the contents of your ENV:suncalc directory to
the ENVARC: directory prior to shutting down your computer or rebooting. See
your AmigaDOS manual for more information on environmental variables.
Page: 5
File: G:\Long-Term Storage\DATA\SunCalc\SunCalc.guide 3/6/1998, 8:49:50 PM
Example:
Let's try the 3rd example for the city of Boston once again this time using
environmental variables. From the a Shell window enter the following:
setenv env:suncalc/longitude=71.05W
setenv env:suncalc/latitude=42.37N
setenv env:suncalc/tz=-5
setenv env:suncalc/otf=1
setenv env:suncalc/odf=3
Now whenever you use SunCalc, the above settings (as well as the system date)
are the defaults (When you reboot your computer there is a line in the
'startup-sequence' that copies the contents of ENVARC: to ENV:). To find
sunrise & sunset times as in the example on 10 March 1986, type:
suncalc date=10-3-86
Brian Savage
9 Wilton Cresent
Dartmouth, Nova Scotia,
Canada B2V 2S9
tel: 902-434-2993
@{u}email@{uu}: [email protected]
@{u}http@{uu}://home.istar.ca/~bsavage
@endnode
Page: 6
File: G:\Long-Term Storage\DATA\SunCalc\SunCalc.guide 3/6/1998, 8:49:50 PM
1. Corrected a bug which was causing sunrise & sunset times for some areas
Southern Hemisphere to be offset by 24hours.
2. Added better @{"Shell argument handling" link "Document_3" 15} - now uses DOS
Readargs
function.
7. Icon provided with instructions on how to use SunCalc from the WorkBench.
2. added cpu type to help screen in both 68000 and 68030fpu versions.
@endnode
Sunrise and sunset times were verified using in part "The Old Farmer's
Almanac", 1995 version, copyright 1994 by Yankee Publishing Incorporated,
Dublin, NH 03444.
@endnode
Page: 7
File: G:\Long-Term Storage\DATA\SunCalc\SunCalc.guide 3/6/1998, 8:49:50 PM
Thanks also goes to Kevin Glynn of Calgary, Canada for finding an icon for
SunCalc from the MWBarchive.lha on Aminet. To use this icon with SunCalc see
@{"Usage" link "Document_3" 146}.
@endnode
Page: 8