Sun/Moon Calculator Reference

This page gives detailed descriptions of the Sun/Moon Calculator features. An illustrative introduction to many of these features is given in the Sun/Moon Calculator tutorial.

Contents

Inputs
Location Height/Weather Rise and Set Times Sun and Moon Positions Bottom-of-Form Buttons Rise/Set Criteria User Preferences
Output
Rise and Set Times Sun and Moon Positions Context-Sensitive Help List Locations Bottom-of-Page Buttons
Printing and Saving Results
Glossary
DMS and HM Input
Daylight Saving Time
Limitations
Additional Resources
Technical Notes
References
Legal

Inputs

Location

Check “Select:” to choose a location from the calculator’s database, or “Specify:” to enter location properties manually. Values entered under Specify are ignored unless the “Specify:” radio button is checked.

Search for

Search the locations database for a location that matches the specified pattern; the location matches if any part of its name contains the pattern. For example, ban will match Fairbanks, AK and several others as well as Banff NP, AB and Bangkok, Thailand. Entering a few additional characters will usually give a unique match: banf will match only Banff, and bangk will match only Bangkok.

By default, the pattern is simple text; there are no wildcards or boolean operators. The search is case sensitive if the pattern contains any uppercase letters, including a regular expression such as [A-K]; otherwise, case is ignored. For example, Ban will match Banff and Daka, Bangladesh but not Fairbanks, AK or Albany, NY. All entries are stored as ASCII text, so the pattern should not contain accented characters; to match Orléans, France, enter Orleans, F.

A search is performed as each character is entered; the selected location updates to the first matching location. The selected location also updates as the Backspace key is pressed. Pressing Enter or clicking Next Match searches for the next matching location. For example, entering NY and pressing Enter several times will find all locations in the state of New York; observing capitalization prevents unwanted matches. If no location matches the pattern, the selected location is not updated; an error message is given, and the character that caused the match to fail is erased.

When the location search feature is enabled, the following buttons are displayed:

New Search
Searches the database for location matching the pattern; the location is set to the first matching location in the database. If there are no matches, an error message is given, and the location is not changed.
Next Match
If more than one location matches the pattern, clicking this button proceeds to the next matching location in the database and sets the selected location to that location. When there are no additional matches, an error message is given, and the selected location is not changed. Clicking New Search repeats the search from the beginning of the location database.

If Allow regular expressions in location searches on the User Preferences form is checked, the pattern can include Perl-style regular expressions; for example, NP.*UT can be used to find all National Parks in Utah.

The location search feature is available only if Show location search on the User Preferences form is checked; it is enabled by default.

List Locations
Shows properties for all location in the database. This usually is a more convenient way of browsing the database than scrolling through the list, and is the only practical way to examine the properties for several different location. Name, Latitude, Longitude, Elevation, Time Zone, and Magnetic Declination are as explained below. If the elevation is not known, it is indicated by an em dash (“—”). DST rules and DST start and end dates are explained in the section on User Preferences. Magnetic declinations, DST rules, and DST start and end dates displayed only if the appropriate options are selected in the User Preferences form. If the cursor is passed over a location name, the cursor changes to a pointer and the tooltip Set location to name is displayed; Clicking on the location name sets that location as the selected location and gives focus to the main form. With some browsers, if the Use tabs for all pages preference is selected, and the Sun/Moon Calculator Locations tab already exists, it may be necessary to manually select that tab.
Check Locations
Checks the location option list for consistency with the internal location database, and checks for the existence of a daylight saving time rule for each location that observes daylight time. This can be useful (and is highly recommended) if the database has been edited, but is of little value otherwise. Latitude, longitude, and time zone are checked for reasonableness but not for whether they are correct for a given location. A warning is given if there is a mismatch between the time zone and the longitude (i.e., they have different signs). For some locations, such as Navy Town, AK, and several locations in Spain and western France, the mismatch is not a problem and may be safely ignored; in most other cases, this suggests that either the time zone or the longitude is incorrect. Daylight saving time rules are checked for format and reasonableness but not for correctness. This button is displayed only if the Show Check Locations button option is checked on the User Preferences form.

Specify:

If your location is not in the internal database, you can specify its properties.

Name
Enter a name for the location. The name is optional, but it can be helpful in identifying the location to which the results apply, especially if results for several different user-specified locations are printed. With the GeoNames web service, the name can be used to find a matching location and automatically fill in the remaining location properties. Additionally, the name is passed to the weather service when seeking forecast with the optional Weather feature.

If the name is given as place, country, and Uses Daylight Time? is set to Yes, country is used to determine the rules for the beginning and end of daylight saving time. For the United States and Canada, the state or province name can be given instead of the country; for example, Hornitos, CA. England, Scotland, Wales, Northern Ireland, and UK are recognized as United Kingdom. If Uses Daylight Time? is set to Yes and no country is specified, United States rules are used for north latitudes and the reverse of United States rules are used for south latitudes.

Latitude
Enter the latitude in the form dd:mm:ss or in decimal degrees. See the section on DMS and HM Input for additional information. Select either N or S to specify north or south. A negative latitude is always taken as south, regardless of value the of the N/S indicator (e.g., either -40 N or -40 S is taken as 40 S).
Longitude
Enter the longitude in the form dd:mm:ss or in decimal degrees. Select either E or W to specify east or west. A negative longitude is always taken as west, regardless of the value of the E/W indicator (e.g., either -120 E or -120 W is taken as 120 W).
Elevation
Enter the elevation above sea level; this information isn’t essential, however, unless your location is substantially above the horizon (see Height Above Horizon). When the elevation is available, the Sun/Moon Calculator adjusts the refraction for the decreased air density at higher elevations; however, the difference is slight, on the order of 0.15° at the horizon at 10,000 ft, and rise and set times are affected by a minute at most.

The Elevation is the total distance above sea level, so if you are in a tall building or other man-made structure, you should increase the location’s elevation by the height of that structure.

Elevation can be given in either fixed or scientific (e.g., 8.2e3) notation. With fixed notation, a comma may be used to group digits; elevations greater than 9999 ft are automatically reformatted with a comma as a digit-group separator.

Elevation can be given in either feet or meters, depending on the unit selected under User Preferences; the appropriate unit is indicated after the text box.

Time Zone
The standard time zone for the location. Select from the list; the value is the difference between local time and Coordinated Universal Time (UTC), so that values are usually positive for locations with east longitudes and negative for locations with west longitudes. See the section on Universal Time for more information about UTC. If the default value, (calculate), is selected, the time zone is calculated, to the nearest whole hour, from the longitude.
Uses Daylight Time?
Indicates whether or not the location uses daylight saving time (Summer Time) during the summer. Select either Yes or No.
Look Up a Location
If your location is not in the internal database, you can look up its properties using one of the databases in the drop-down box. Several of the databases allow a lookup of a location name, but require the user to transfer the properties to the calculator form. A lookup using the GeoNames database will automatically transfer the location properties to the form if a matching location is found. The Google Maps dropdown can show a map of the location using either its name or latitude and longitude.

Lookup Only

The USGS Geographic Names Information System server is arguably the most authoritative source for places in the United States. With the default search, latitude and longitude are shown in USGS packed DMS format ([d]ddmmssN|S|E|W). The values may be copied and pasted into the relevant fields of the Sun/Moon Calculator; the hemisphere indicator (N or S, E or W) on the calculator form is set to match the pasted value. With the Advanced Search, coordinates can be displayed either as packed DMS or decimal. With the latter format, ensure that the hemisphere indicator is N or E when pasting a positive latitude or longitude; although a negative value is always taken as a south latitude or west longitude, the interpretation of a positive value is determined by the hemisphere indicator.

The U.S. National Geospatial-Intelligence Agency’s GeoNet Names Server is useful for locations outside the United States (in most cases, click on the “GNS Search - Text Based” link at the top of the left frame). Clicking on the value in the Latitude/Longitude column toggles the format between DMS (shown as dd° mmss″ N|S|E|W) and decimal; when copying and pasting a positive decimal latitude or longitude, ensure that the hemisphere indicator is set to N or E.

Getty Thesaurus is useful for many places worldwide. Latitude and longitude are given in both DMS and decimal formats; either format may be copied and pasted into the Sun/Moon Calculator. If the DMS format (including the hemisphere indicator) is pasted into the form, the hemisphere indicator on the form is automatically set; when pasting a positive decimal latitude or longitude, ensure that the hemisphere indicator is set to N or E.

All three of these sources are comprehensive and authoritative, and include several search options, but they do not provide information about time zones or the observance of daylight saving time.

timeanddate.com has a smaller database, but is easy to use, and provides the time zone and information about daylight saving time as well as latitude and longitude for many locations inside and outside the United States.

Automatic Fill-In

GeoNames is a worldwide database that includes latitude, longitude, elevation, and time zone for named features. If a location Name is entered, clicking Go will automatically fill in the remaining location properties if a matching location is found. Because of this feature, GeoNames is usually the easiest way to look up and enter a location. If more than one location matches the name, a list of matching locations is shown. Passing the cursor over a location causes it to be highlighted; clicking a highlighted location selects that location, and causes its properties to be entered into the form.

Because GeoNames queries ultimately use the GeoNames search syntax, the syntax is somewhat different from that for searching the built-in location database. The search is always case insensitive, so that San francisco (which will fail when searching the internal location database) will work just fine. Neither regular expressions nor wildcards are allowed.

Some of syntax is specific to the Sun/Moon Calculator. By default, a location name without a comma (e.g., chicago) must exactly match the feature name; if a tilde (“~”) is prepended or appended to the location name (e.g., ~chicago), the name need only match part of the feature name, but the name must still consist only of one or more whole words (e.g., >~chicag will not work). If the name includes a comma, the text before the comma is the location name, and the text after the comma is one or more additional characteristics of the location (e.g., the country, state, or province, or other characteristic such as feature type) described on the GeoNames search page. For example, a search for Durango will produce a large number of matches, whereas a search for Durango, CO will produce only a few. A search for Durango, ppl will match only populated places. In addition, the name can include the postal abbreviation for a Canadian province (e.g., Vancouver, BC). Text after the comma can match more than one parameter (e.g., CA will match the state code for california but will also match the country code for Canada, so a search for mount williamson,ca will match Mount Williamson in British Columbia as well as Mount Williamson in California. Similarly, mt will match features that are mountains, but will also match the state code for Montana. The space between the comma and the first text is optional, as indicated in the last example above.

Regardless of the format of the query, the name of a matching or selected location is entered into the Sun/Moon Calculator in the same format as used in the internal location database: name, country, or for a location in the United States or Canada as name, state or name, province, using the postal abbreviation for the state or province.

The results from the basic GeoNames search do not always include a location’s elevation; consequently, when there is more than one matching location, some of the locations in the list may not show the elevation. Once a location is selected, however, the elevation is usually found from an additional query, although this can sometimes result in a slight delay for the elevation to be filled in on the calculator form.

If the location name is blank, GeoNames will open the interactive GeoNames page, which functions similarly to those of the other sources. Latitude and longitude are shown as N|S|E|W dd° mmss.

The calculator uses the free GeoNames web service, and the servers on which it relies are sometimes heavily loaded or unavailable altogether. If the service does not respond in 16 seconds, the request times out and a message is given to that effect. A single timeout may arise simply because the servers are heavily loaded, but several in succession usually mean that the servers are down. If that happens, you can clear the location name and perform a search using the interactive GeoNames web page, or choose another database.

Location Map

Google Maps offers road and terrain (topographic) maps as well as satellite imagery for locations worldwide.

If either of Latitude or Longitude is nonzero, a Google Maps lookup will show a terrain map centered on those coordinates. If a Name is given and both Latitude and Longitude are zero, the lookup will search for a location matching the name, and if a match is found, show a map centered on that location. If the name is blank and both the latitude and longitude are zero, Google Maps shows a default Google terrain map.

Google Maps works well in combination with GeoNames; you can find a location’s properties using a GeoNames lookup, and then show a map of that location using a Google Maps lookup. In addition to giving a general preview of the terrain, the map can be helpful in ensuring that a location selected from a large list of matches to a GeoNames search is the location you actually wanted.

Copy Selected Location
Copies the name, latitude, longitude, time zone, and daylight saving time status for the location selected from the internal database to the user-specified fields. These values are not automatically entered when a location is selected from the internal database; after selection, the Specify radio button must be checked, and the copy button then clicked. Switching between a user-specified location and one from the list can be helpful if you wish to compare times for a user-specified location with times for a location in the database on several different dates. Copying the values from a location in the database can be helpful if you want precise times for a nearby location and only need to change some of the values. This also can provide a quick means of viewing the properties for a location selected from the list.
Clear
Clears the specified properties for the location.

Height/Weather

Height Above Horizon
Enter the height above the horizon. This value may be needed if you are situated on a hill or mountain, or even in a tall building. A value also should be entered if you are at the same elevation as the horizon, but wish to know when light will reach a tall object, such as sunrise on a nearby mountain peak. It is important to recognize that the appropriate value is the difference between your elevation and that of the horizon; for example, if you are on a 14,000-foot mountain rising above a 4,000-foot plateau, the height is 10,000 feet.

The elevation of the horizon is not always the same as that for nearby terrain. For example, suppose you are in Colorado Springs, Colorado, and wish to know when morning sunlight will first reach nearby Pikes Peak, elevation 14,110 ft. Ideally, you would set the location to Pikes Peak, possibly getting the coordinates from the USGS GNIS or GeoNames, but the Elevation should be set to that of Pikes Peak in any event. Colorado Springs is at a nominal elevation of 6008 ft; however, the visible horizon from Pikes Peak is more than 130 miles to the east, at elevations from about 3800 ft to 4200 ft, so a height of 10,000 ft would be a reasonable nominal value. This is an extreme example; in many situations, the elevation of the horizon may be taken as that of nearby terrain. For example, if you were on Mount Davidson (elevation 928 ft) in San Francisco (nominal elevation 63 ft) and facing east, you could reasonably set the Elevation to 928 ft and the Height above Horizon to 865 ft.

Height can be specified in either fixed or scientific (e.g., 6.5e3) notation. With fixed notation, a comma may be used to group digits; heights greater than 9999 ft are automatically reformatted with a comma as a digit-group separator. Height can be given in either feet or meters, depending on the unit selected under User Preferences; the appropriate unit is indicated after the text box.

The allowable range of values is 0 to the location’s elevation; values of a few feet or less have no significant effect on rise or set times, so that even a 7-foot observer can safely use the location’s elevation and the default height of zero.

Weather
Select the appropriate site and click Go to get a weather forecast from that site for the selected location (either a location from the database or a user-specified location). The US National Weather Service cover only the United States and its territories; the Weather Underground and the BBC Weather page provide worldwide coverage.

Rise and Set Times

Check the “Rise and Set Times” radio button to show Sun and Moon rise and set times for one or more dates.

Start Date
Select the day and month for the first date for which to show rise and set times. Enter the year; one- or two-digit values are added to 1900, e.g., an entry of 7 is interpreted as 1907. The earliest allowable date is 15 October 1582.
Date Offset
Select “Date Offset” to specify the end date as an offset to the start date; in many cases, this is faster and easier than entering an end date. The offset may be in days, weeks, months (30 day), months (1/12 year), or years. You can limit the calculations to one day by entering a value of zero.

A date offset in days is rounded to the nearest integer upon entry; with other units, the offset may be given as a decimal, though it is rounded down to the nearest integral number of days when performing the calculations. A value of 3.5 days is automatically changed to 4 days; an offset of 3.5 weeks is retained, but is rounded down to 24 days.

Date Interval
Like the date offset, the date interval may be in days, weeks, months (30 day), months (1/12 year), or years. The maximum number of calculations is a somewhat arbitrary 7320 (20 years at an interval of one day). Performing the maximum number of calculations may require more than a minute, and may prompt a warning from the browser that the script is running slowly; if this happens, simply click the appropriate button to continue. Specifying the maximum number of calculations makes sense only when one or more Rise/Set Criteria also have been specified. Clicking a continue button in response to a browser warning is a nuisance if you frequently perform searches using Rise/Set Criteria; such warnings can usually be eliminated by changing browser settings as described under Script Timeout in the tutorial.

A date interval in days is rounded to the nearest integer upon entry; with other units, the interval may be given as a decimal. A value of 1.732 days is automatically changed to 2 days, but an interval of 1.732 weeks is acceptable (if silly). When the calculations are performed, each date calculated from the interval is rounded to the nearest integral date, so that specifying a non-integral date interval can result in uneven steps; this happens necessarily when the interval is in months (1/12 year) but usually makes little sense otherwise.

Rise/Set Criteria...
Opens the Sun/Moon Rise/Set Criteria form. With some browsers, if the Use tabs for all pages preference is selected, and the Sun/Moon Rise/Set Criteria tab already exists, it may be necessary to manually select that tab.

Sun and Moon Positions

Check the “Sun and Moon Positions” radio button to show Sun and Moon azimuths and altitudes between the two specified times. Rise and set times also will be shown for the specified date.

Date
Select the day and month for the date for which to show Sun and Moon positions. Enter the year; one- and two-digit values are added to 1900, e.g., an entry of 32 is interpreted as 1932. The earliest allowable date is 15 October 1582.
− 1 day
Decrement the calculation Date by one day.
+ 1 day
Increment the calculation Date by one day. This can be useful when calculating and printing positions for several successive days.
Start Time
Use the radio buttons either to select a Sun or Moon event from the drop-down box or to specify a start time. Available events are Dawn, Sunrise, Sun Transit, Sunset, Dusk, Moonrise, Moon Transit, and Moonset.

The start time can be an offset to the time of a selected event by entering a value, in minutes, in the text box to the left of the event box. The before/after drop-down box determines whether the start time is before or after the event. The allowable range of values for the offset is ±480 minutes; a decimal value is rounded to the nearest minute upon entry.

An explicit start time may be entered as hh:mm or in decimal hours; see the section on DMS and HM Input for additional information. Allowable values are from 0 to 24 hours.

End Time
End time is given in the same manner as start time, either selecting an event or specifying a time. It therefore is possible to show Sun and Moon positions between two events; by default, these events are Sunrise and Sunset, but could be changed, for example, to Moonrise and Dusk to show twilight Moon positions on the night of a full moon. Additional control is possible by specifying time offsets. For example, entering 5 and selecting before and Moonrise for the start time, and entering 20 and selecting after and Sunset for the end time would show positions between 5 minutes before moonrise and 20 minutes after sunset.

If a nonzero altitude has been specified for a rise or set event, the time of that event is the time the Sun or Moon crosses the specified altitude; if you want to show positions beginning slightly before and ending slightly after that altitude crossing, select that event for both start and end times, and also specify appropriate time offsets. For example, entering 5 and selecting before and Moonrise for the start time, and entering 5 and selecting after and Moonrise the end time would show positions between 5 minutes before and 5 minutes after the Moon crosses the specified altitude. Alternatively, you could note the time of altitude crossing and manually specify appropriate start and end times. In either case, you probably would want to select a time interval of 1 minute.

If a specified end time is less than the start time, it is assumed to apply to the next day.

Time Offset
If desired, the end time may be given as an offset to the start time; in many cases, this is faster and easier than entering an end time. The time offset may be given in decimal hours or minutes; the units are selected using the drop-down box. Allowable values are from 0 to 48 hours, so that the calculations can continue past midnight on the selected day; this can be useful for showing positions when the Moon rises on one day and sets on the following day. Regardless of the specified time offset, calculations will not extend past midnight on the following day. A time offset in minutes is rounded to the nearest minute upon entry; a decimal value in hours may be given to any precision but is rounded to the nearest minute at the time of calculation.
Time Interval
Select the time interval (1 minute, 5 minutes, 10 minutes, 15 minutes, 20 minutes, 30 minutes, or 1 hour), between successive calculations. The calculation may require several seconds if a 1-minute interval is selected, and may even prompt a warning from the browser that the script is running slowly; if this happens, simply click the appropriate button to continue.

If the default events Sunrise and Sunset are selected and neither occurs (as happens in polar regions in summer or winter), positions are shown hourly between 0:00 hours and 24:00 hours local time. Otherwise, if a specified start or end event does not occur, positions are not displayed. The behavior in either situation can be overridden by entering explicit start and end times and selecting a time interval.

Context-Sensitive Help

Positioning the cursor over the label for any of the inputs displays a brief description of what the input is; with some browsers, the description also is displayed on the status line. Clicking on the label brings up the appropriate section on this page. Positioning the cursor over a major heading (e.g., “Location”) displays a similar message and link.

Bottom-of-Form Buttons

Display
Calculate rise and set times or positions and format the output for display on the screen. The font size is adjustable within the range allowed by the browser.
Print
Calculate rise and set times or positions and format the output for printing; the “Close,” “Print,” and “Help” buttons are omitted. buttons are omitted. In most cases, the browser’s Print dialog also is opened. If a font size has been specified in the User Preferences form, that font size is used. Otherwise, the font size is adjustable within the range allowed by the browser.
Reset
Reset the form to default values. With Internet Explorer, the start and end dates are reset to the current date, and the Sun/Moon Rise/Set Criteria form is reset to default values.
Set Current Date
Set the start and end dates to the current date.
Preferences...
Opens the User Preferences form.
Help
Displays this page.
Tutorial
Displays a tutorial on using the Sun/Moon Calculator.

With some browsers, if the Use tabs for all pages preference is selected, and there is an existing tab for the page that a button opens, it may be necessary to manually select that tab.

Rise/Set Criteria

With the default settings, the Sun/Moon Calculator will generate a table of Sun and Moon rise and set times that correspond to official values. In many cases, this is all that is needed. However, there are situations for which these values may not be what is wanted. For a location in a valley bounded on the east and west by mountains, the Sun and Moon will appear above the eastern horizon later than the official time of rise, and will disappear below the western horizon earlier than the official times of set. In such situations, it may be more useful to know the times when the Sun and Moon cross the visible horizons.

Sometimes it also is desirable to find dates on which Sun or Moon rises or sets meet certain criteria, such as rising or setting near a landmark, the Moon having a certain phase at rise or set, or the Moon rising or setting within a specified time of sunrise or sunset.

Altitude

Single Altitude

By convention, rise and set indicate times when the Sun’s or Moon’s upper limb is on a level horizon (i.e., the altitude of the top of the Sun’s or Moon’s disk is zero). If the local horizon is not level (e.g., near mountains), the times when the Sun or Moon will rise above or set below those features can be substantially different from the standard times of rise and set. Specifying a nonzero altitude for rise or set can give the times when the Sun or Moon actually will appear or disappear. For example, if the western horizon is a mountain ridge at an altitude of 9°, specifying set altitudes of 9° will give the times when the Sun or Moon disappear below that ridge. Strictly speaking, when a nonzero altitude is specified, the event is an altitude crossing rather than a rise or set; nonetheless, in the interest of simplicity, this document refers to such an event as a rise or set.

Altitude Range

Sometimes it is desired to find dates on which the Moon or Sun passes through a region near certain natural or man-made features; the easiest way to do this usually is to specify a range of altitudes for Sun or Moon rise or set, in combination with an azimuth or range of azimuths.

Specifying an Altitude or Altitude Range

The Altitude section contains two text boxes: the first indicates the minimum altitude and the second indicates the maximum altitude. Enter the desired altitude in the first text box, either as dd:mm:ss or in decimal degrees (see the section on DMS and HM Input for additional information). If the maximum altitude is zero and a value greater than zero is entered for the minimum altitude, the maximum altitude is set to the minimum altitude. If desired, enter a greater value in the second text box; if the minimum and maximum altitudes are the same, the reported time of rise or set is the time that the body crosses that altitude. Different altitudes or ranges of altitudes may be given for sunrise, sunset, moonrise, and moonset. Allowable values for Sun altitude are from −90° to 90°; values for Moon altitude are from −3° to 90°, although the minimum altitude for the Moon must also be at or above the visible horizon. The Sun isn’t visible when its altitude is below the horizon, but its position still influences the brightness and color of the sky, and affects the visibility of other celestial bodies. Specifying a negative altitude for Sun rise or set in combination with a positive altitude for Moon rise or set can be useful in finding dates for sighting or photographing a thin lunar crescent.

To the right of each maximum-altitude text box are two radio buttons, marked “Top” and “Ctr”. By default, the “Top” button is checked, indicating that rise and set are when the Sun’s or Moon’s upper limb crosses the specified altitude. To show the times for the center of the Sun or Moon, select the Ctr button.

To the left of each minimum-altitude box is a checkbox; if it is not checked, the altitude values are ignored; this allows a nonzero altitude or an altitude range to be toggled on and off without re-entering the values.

When an altitude range is specified, it usually is most useful to have it apply to the center of the Sun or Moon; in that case, the “Ctr” radio button is automatically checked; this can be overridden if desired by selecting the Top button. If an altitude range is given without other criteria (an altitude range for the same body, or a Moon event–Sun event time difference), its only effect is make the altitude crossing the average of the minimum and maximum altitudes.

For a Sun altitude less than zero, it seldom makes sense to refer to the Sun’s upper limb (one possible exception is when you are above the horizon and the Sun is visible at negative altitudes). When a Sun rise or set altitude of less than zero is specified, the “Ctr” radio button automatically is checked; this can be overridden if desired by selecting the Top button.

The displayed value of Day Length is the time the Sun is above the specified rise and set altitudes; consequently, when the Sun rise or set altitude or both differ significantly from zero, the Day Length usually is not meaningful.

Limitations

The implementation of altitude range finds an altitude crossing at the average of the minimum and maximum altitudes. Because of this, very large altitude ranges may not work as expected if that altitude crossing does not occur. For example, if it is desired that the Sun be at least 10° below the horizon and the altitude range is given as −90° to −10°, a search will not select days on which the Sun’s minimum altitude is greater than −40°.

When an altitude range is given, the time difference between Sun and Moon events is the difference between the times of crossings of the average altitudes for each body. For example, if it is desired to have the Moon between 3° and 4° when the Sun is between −4° and −2°, the time difference is that between the time when the Moon is at 3.5° and the time when the Sun is at −3°.

When an altitude range is given in combination with a time difference, the tolerance on the time range is approximate; although accuracy is very good with small altitude ranges, it degrades with very large altitude ranges.

A specified altitude refers to the apparent altitude when the body is visible; if a specified altitude for the Sun is below the visible horizon, it refers to the true altitude. Because the apparent altitude includes atmospheric refraction, the reported altitude undergoes a step change as the body crosses the visible horizon. Because of the step change, there is a range of reported altitudes that do not occur. For the Sun, specifying a rise or set altitude within that range (or a range of rise or set altitudes whose midpoint is within that range) results in an error message when attempting to show times or positions.

Although the Sun/Moon Rise/Set Criteria form allows a minimum altitude of −3° for the Moon, the Sun/Moon Calculator also requires that the minimum altitude for the Moon be at or above the visible horizon. Specifying an altitude that is below the visible horizon results in an error message when attempting to show times or positions.

Azimuth
Show only dates on which Sun or Moon rise or set is within the specified azimuth ranges. This feature is useful for finding dates on which the Moon or Sun passes near certain natural or man-made features, especially in combination with an altitude range.

Enter the desired minimum and maximum values in the appropriate text boxes. If a range of altitudes also is given, the dates selected are those on which the Sun or Moon passes through the specified region of altitude and azimuth; if a single nonzero altitude is given, the azimuth range applies at the time of altitude crossing. The allowable range for rise and set azimuth is 0° to 360°, although rise usually occurs between 0° and 180°, and set usually occurs between 180° and 360°. At extreme latitudes, rise and set do not always straddle transit; the azimuth of rise can be greater than 180°, and the azimuth of set can be less than 180°. If the box is not checked, the azimuth values are ignored, and no azimuth checking is done; this allows an azimuth range to be toggled on and off without re-entering the values.

The maximum and minimum azimuths can have the same value, but this makes little sense unless a range of altitudes is also given.

Specifying an azimuth or azimuth range makes little sense unless a range of dates also is given. In most cases, it also makes little sense to specify an azimuth range for more than one Sun event and Moon event, and even specifying a Sun event and a Moon event may be unduly restrictive.

A specified azimuth range is relative to either true north or magnetic north, depending on which is selected for display. The conversion between magnetic north and true north is based on the magnetic declination at the middle of the search period. Because magnetic declinations are not constant, it usually is better to select azimuths relative to true north when performing a search that extends over several years, especially if the search period is far outside the period for which the magnetic model is valid. Stated succinctly: for best results, select azimuths relative to true north when rise/set criteria include azimuth ranges.

Moon Phase
Show only dates on which the Moon’s phase at rise or set is within the specified range. Enter the desired minimum and maximum values in the appropriate text boxes. Allowable values are 0–1.0. If the box is not checked, the values for phase range are ignored, and no phase checking is done; this allows a phase range to be toggled on and off without re-entering the values.

It usually makes no sense to specify values for both rise and set.

Moon Rise/Set Time
Show only dates on which the Moon rises or sets within a specified time of sunrise or sunset. This can be useful for planning photographs in which the twilight sky color is most prominent, and for which the brightness of the Moon is in reasonable balance with that of the sky and foreground. It also can be used to plan photographs of a thin lunar crescent. This approach often is more useful than simply finding dates of full or new moons.

Enter the desired minimum and maximum values in the appropriate text boxes. Use the radio buttons to the right of each text box, marked “before” and “after,” determine whether each specified time is before or after the Sun event. Use the radio buttons at the far right, marked “Sunrise” and “Sunset,” to determine the Sun event to which the time difference applies. For example, the default values for moonrise indicate a moonrise that occurs between 15 minutes before sunset and 10 minutes after sunset. Allowable values for the minimum and maximum time difference are ±1440 minutes (±1 day), although giving a value equivalent to more than an hour or so usually serves no useful purpose.

If the box is not checked, the values are ignored, and no time range checking is done; this allows a time range to be toggled on and off without re-entering the values.

If nonzero rise or set altitudes have been specified for Sun or Moon events (or the average values of altitude ranges are nonzero), the time difference applies to those altitude crossings rather than conventional rise or set.

Strictly speaking, the brightness and nature of the twilight sky is determined by the Sun’s altitude rather than the time after sunset. The pink “Belt of Venus” appears in the eastern sky at or shortly before sunset, and the blue Earth shadow becomes prominent shortly thereafter, perhaps peaking at a solar altitude of −2° to −3°. At lower altitudes, the pink fades, and the boundary between the blue and pink becomes less distinct. At a solar altitude of −4° to −5°, the boundary usually is gone, and the sky is completely blue (as well as quite dark).

The time required for the Sun to reach an altitude (positive or negative) varies with the angle of the Sun’s path with the horizon, and consequently, with geographic latitude. For a given moderate latitude, however, the seasonal variation of this time is fairly minor, so that specifying a time relative to sunrise or sunset is roughly equivalent to the more rigorous approach of specifying a solar altitude. For sighting or photographing a thin lunar crescent, the brightness of the sky is more critical, so the rigorous approach often is preferred.

If you want the Moon event near the time when the Sun is at a particular altitude, specify that altitude for Sun rise or set, and a nominal time difference of zero. For example, to find dates on which the center of a setting new Moon is at 2° within ±5 minutes of when the Sun is at −4.5°, specify 2° and “Ctr” for Moon set altitude, −4.5° and “Ctr” for Sun set altitude, and a Moon Rise/Set Time of 5 minutes before to 5 minutes after Sunset.

All specified criteria are applied simultaneously, so that if more criteria than necessary are given, there may be very few results. It usually is better to begin with fairly broad criteria, and then refine the search by narrowing the appropriate criteria. Specifying Rise/Set Criteria other than altitude usually makes sense only when the calculation interval is one day.

When any criteria other than rise or set altitudes are specified for an event, dates on which that event does not occur automatically fail to meet the criteria, and are not displayed.

A blank entry or one that contains only spaces is replaced with the default value; if the default is wanted for only one field, this is much more convenient than resetting the entire form.

All criteria involve ranges of values; if a valid minimum value greater than the current maximum value is entered, the maximum value is set to the new minimum. Similarly, if a valid maximum value less than the current minimum value is entered, the minimum is set to the new maximum.

Context-Sensitive help for Rise/Set Criteria

Positioning the cursor over any row label or column heading displays a brief description of what the option does. Clicking on the label or heading brings up the appropriate section on this page.

Sun/Moon Rise/Set Criteria Buttons

Apply Settings
Applies the values in the form to future calculations.
Close
Closes the Sun/Moon Rise/Set Criteria form. If changes to the settings have been made but not applied, a warning is given. To apply the changes, click “Cancel” and then “Apply Settings”. To close the form without saving the changes, click “OK”.
Reset
Resets all values in the Sun/Moon Rise/Set Criteria form to their defaults.
Help
Displays this page.

User Preferences

Window Behavior

Use separate windows for rise/set times and positions
Show Sun and Moon rise and set times in a separate window from Sun and Moon positions. If this option is not selected, all results are sent to the same window, overwriting the results from the previous calculation. This option can be helpful when Rise/Set Criteria have been given and you wish to show Sun and Moon positions on one of the matching dates, and do not want to be bothered with remembering the matching dates.
Use popup windows for results, Help, and Tutorial
With a browser that supports tabs, such as Internet Explorer 7 and Firefox 1.5 and 2.0, and which is set to allow the browser to choose how to open new windows, this selection usually causes Help and times/positions Results to open in new windows rather than new tabs.

Tabbed browsing can be convenient when it is necessary to frequently switch among different pages; this usually is much easier than moving different windows around. For example, searching for dates that meet certain criteria and then examining the positions on the resulting dates to find the best possibilities can involve frequent switching among the main, Sun/Moon Times, and Sun/Moon Positions windows. However, there also are cases in which a new window (“popup”) may be preferable, as with dialogs such as the Rise/Set Criteria and User Preferences. The default is to allow these dialogs to open in new windows and to allow Times or Positions results and Help windows to open in tabs when the browser is set to choose how windows are opened. Sometimes it also is helpful to have the Help in a separate window so that it can be placed over the input form or results that it is describing; checking this preference allows that to be done. However, if the Help or Tutorial pages must be consulted frequently, it may be easier to have them in tabs.

When performing searches that may result in examining Sun or Moon positions on several different dates, it may be preferable to have the results in tabs, and have the times and positions results in separate tabs. This facilitates rapid switching between the main, times, and positions windows, and also usually preserves each times and positions result in the browser’s history, making it easy to compare different results by using the back and forward buttons. In that case, Use tabs for all pages should be selected, which will automatically deselect this option.

Internet Explorer 7 chooses how to open windows when the selection for When a pop-up is encountered: under Tools|Internet Options|Tabbed Browser Settings is set to Let Internet Explorer decide how pop-ups should open.

With Firefox 1.5 or 2.0, the selection for New pages should be opened in: under Tools|Options|Tabs is set to a new tab. There is one slight additional complication: in the URL about:config, the preference browser.link.open_newwindow.restriction must be set to the default value of 2.

Selecting this preference with a browser that does not support tabs causes new windows to be opened at a specific size; this can be convenient when the main window is maximized.

When this preference is not selected with a browser that supports tabs (and the browser is set to choose the manner of opening), behavior when opening Help is not always intuitive. With Firefox 2.0, if a Help tab is already open, no new tab is created, but the Help window is not brought to the front, and there is no indication that anything has happened. When clicking a label for which context-sensitive help is available, that section is positioned at the topo of the Help window, but again, there is no indication that anything has happened. Behavior is similar with Internet Explorer 7, but the tab for the Help window flashes.

When Help is opened from the Rise/Set Criteria or User Preferences dialogs, behavior also varies depending on whether a Help window is already open. With Firefox 2.0, if a Help window is not open, a new tab is opened in the popup window; with Internet Explorer 7, a new small popup window is opened.

Internet Explorer and Firefox also allow the user to force all windows to open either in new windows or in new tabs. If the browser is set to force opening new windows, this preference should be checked.

If this preference is changed, any existing tabs for results, Help, or Tutorial pages should be closed to avoid unexpected behavior.

Use tabs for all pages
With a browser that supports tabs and which is set to choose how to open new windows, this preference usually causes all pages, including the Rise/Set Criteria and User Preferences dialogs, to open in new tabs rather than windows. If a search may involve frequent adjustment of search criteria to get acceptable results, it may be easier to have the Rise/Set Criteria dialog in a tab.

If a browser that supports tabs is set to force opening in new tabs, this preference usually should be checked.

If this preference is changed, any existing windows for results, Help, or Tutorial pages should be closed to avoid unexpected behavior.

Location Search

Show location search
Allow searching the location database for a location matching a pattern rather than selecting from a list. This feature is enabled by default.
Allow regular expressions in location searches
Allow Perl-style regular expressions in patterns for location searches; when this option is not selected, patterns must be ordinary text. This option has no effect unless the location search feature is enabled.

List Locations Report

Show magnetic declinations with List Locations report
Show the magnetic declination of each location. clicked. The values are shown for the Start Date if “Rise and Set Times” is selected, or for the Date if the “Sun and Moon Positions” is selected.

A caution is given if the Start Date (or the Date when calculating positions) is outside the magnetic model’s range; results are usually reasonable if the date is close to the period for which the model is valid, but even so, errors for some locations can be considerable. Accuracy degrades as the date moves further from this period, and the indicated magnetic declinations eventually have little relation to reality.

Show DST rules with List Locations report
Show the rules (e.g., “1st Sun of Apr”) for the start and end of daylight saving time for each location in the database when the “List Locations” button is clicked. The rules are shown for the year specified by the Start Date if “Rise and Set Times” is selected, or the Date if the “Sun and Moon Positions” is selected. The only year-dependent rule currently implemented is the change in United States rules in 2007. An error message is displayed if a DST rule is missing.

Current DST rules are used regardless of the date. Because the dates of rule changes have been different for almost every country, no attempt is made to determine the ranges of valid dates. Although the report will indicate that the DST rules are for the specified year, if that year differs substantially from the present, the rules may be meaningless.

Show DST start and end dates with List Locations report
Show the dates (e.g., “2 Apr”) for the start and end of daylight saving time for each location in the database when the “List Locations” button is clicked. The dates are shown for the year specified by the Start Date if “Rise and Set Times” is selected, or the Date if the “Sun and Moon Positions” is selected. An error message is displayed if a DST rule is missing.

Current DST rules are used regardless of the date. Because the dates of rule changes have been different for almost every country, no attempt is made to determine the ranges of valid dates. Although the report will indicate that the DST start and end dates are for the specified year, if that year differs substantially from the present, the dates may be meaningless.

Showing magnetic declinations and daylight saving time rules and dates requires extra calculations, and, accordingly, requires additional time to generate the location listing. Unless you need this information, it probably is best to leave these boxes unchecked.

Time Display

24 hour
Show local time in 24-hour format (e.g., 0:25, 19:21).
AM/PM
Show local time as AM or PM (e.g., 12:25 am, 7:21 pm). For compactness, Sun and Moon event times simply have an appended ‘a’ or ‘p’ (e.g., 12:25a, 7:21p).
Universal time (UT)
Show time in Universal Time (UT) rather than local time. This is not the same as selecting a time zone of 0 (GMT). With a time zone of 0, Sun and Moon events shown are those occurring between 0h and 24h GMT; when the time format is UT, the events shown are those occurring between 0h and 24h local time, with the times shown as UT rather than local time.

Universal Time is incompatible with daylight saving time; if “Universal time (UT)” is selected, “Show daylight saving time” is deselected.

When switching between UT and a local-time format, the labels for the start and end times on the main form change between “UT” and “local time,” and the times are possibly reformatted, but the time values are not converted. For example, if the calculator is set to show Sun and Moon positions for times between 06:00 and 20:00 UT, and the time format is changed to “AM/PM,” the times will be shown on the form as 06:00 am and 08:00 pm and the positions shown for times between 6:00 AM and 8:00 PM local time.

Show daylight saving time
Select this option to show daylight saving time if the location uses daylight saving time in the summer, or leave it unchecked to show all times as standard time. This option has no effect if the location does not use daylight saving time. Beginning and ending dates for daylight saving time are computed automatically; see the section on Daylight Saving Time for additional information on the implementation and its limitations.

Daylight saving time and Universal time are incompatible; if “Show daylight saving Time” is selected, and the time format is “Universal time (UT),” the format is changed to “24 hour.”

Azimuth Display

True north
Show azimuths relative to true north; this is usually more convenient for reference to a map.
Magnetic north
Show azimuths relative to magnetic north (e.g., a compass reading); this may be more convenient when using a compass without a magnetic declination adjustment.

The location’s magnetic declination is shown at the top of the page; the value is for the Date if “Sun and Moon Positions” is selected, or for the Start Date if “Rise and Set Times” is selected. If rise and set times are calculated for more than one date, magnetic declination is recalculated every 30 days, and the value shown at the top of the page is for the middle of the calculation period. If the date is more than one year outside the range of time for which the magnetic model is valid, the magnetic declination is not shown unless azimuths are shown relative to magnetic north or conversions between true and magnetic north are shown.

The data for the magnetic model used to calculate magnetic declinations are valid for a limited time range, usually five years. If azimuth display relative to magnetic north is selected and either the Start Date or End Date (or the Date when calculating positions) is outside the model’s range, a caution is given. If the caution is ignored, the calculator will dutifully calculate magnetic declinations, but the values may be significantly in error for dates substantially outside the model’s range. The best response to such a caution is to display azimuths relative to true north by deselecting this option. A caution is included in the output if either the Start Date or End Date (or the Date when calculating positions) is outside magnetic model’s range.

Generally, showing azimuths relative to magnetic north makes little sense if the calculation period extends over many years. This is especially true if azimuths are given as Rise/Set Criteria, because magnetic declinations change over time, while the azimuths given as rise and set criteria are static.

Elevation and Height Units

Feet
Use feet for elevation and height; selected by default.
Meters
Use meters for elevation and height.

Any user-specified values for elevation or height are converted if the units are changed.

Miscellaneous Options

Enable inactive inputs in active area
Enable inactive inputs in the active calculation-type area (Rise and Set Times or Sun and Moon Positions) on the main form and unchecked ranges on the Rise/Set Criteria form.

Some pairs of inputs on the main form are mutually exclusive; when one is selected, the other is inactive. For example, when calculating Sun and Moon rise and set times, if End Date is selected, Date Offset is deselected and inactive. Similarly, when calculating Sun and Moon positions, if a time value is selected, giving the start or end time relative to a Sun or Moon event is deselected and inactive. The disabled inputs make it more obvious which inputs are active in the calculation but require that the appropriate radio button be clicked to reactivate a disabled input or change its value; when inactive inputs are enabled, the value of an inactive input can be changed and the input made active simply by clicking on the input.

On the Criteria for Sun and Moon Rise and Set form, criteria for rise and set azimuth, phase, and Sun event–Moon event time difference are not applied when the box preceding the range specifiers is not checked. By default, the box must be checked to allow changing any of the values; when inactive inputs are enabled, any field can be changed simply by clicking in it, and the appropriate box is automatically checked.

This option has no effect on the inactive area of the main form, for which all inputs are always disabled.

Show Copy ... Date buttons
Display “Copy Positions Date” and “Copy Start Date” buttons (under “Rise and Set Times”) and a “Copy Start Date” button (under “Sun and Moon Positions”) on the main form. This feature can be helpful in transferring dates without the need to re-enter values in all fields. The same effects of the latter two buttons can be accomplished by other means, so this feature is disabled by default.
Show Check Locations button
Display a “Check Locations” button on the main form. This feature can be useful if the location database has been edited. It is of little value otherwise.
Show conversions between True and Magnetic North
Shows the adjustment required to convert from true north to magnetic north and vice versa in the results for rise/set times or Sun and Moon positions. This can be useful when viewing a printed report showing azimuths relative to true north while working in the field with a compass, and vice versa. The conversion shown is from the values in the results to the other values. For example, if azimuths are shown relative to true north for a location with a magnetic declination of 14°E, the azimuths indicated by a compass will be 14° less than those relative to true north; the output will display “Azimuths relative to True North (subtract 14° for Magnetic North).” No conversion is shown if the magnetic declination is zero.

When rise and set calculations extend over a range of dates, the conversion shown is for the middle of the calculation period; because the Sun/Moon Calculator recalculates magnetic declination every 30 days, the actual conversions used at the beginning and end of the calculation period may differ from the value shown.

A caution is given if the date for which the conversion is shown is outside the magnetic model’s range. Although results are usually reasonable if the date is only slightly out of range, errors for some locations can still be considerable. Accuracy degrades as the date moves further out of range, and eventually the indicated conversion has little relation to reality.

Show program running times
Show the running times for rise/set and position calculations and the List Locations report; the time is shown after the copyright notice. The primary value is for the program developer to evaluate the effects of additional features or different algorithms. For others who insist on setting this option, it will quantify the observation that searches extending over several years are quite slow.
Use a Font Size of nn pt for Printed Output
Use the specified font size for the calculation results and the List Locations report. By default, the font size is not specified, so that the user can adjust it for optimum on-screen viewing. This does not always give the best results when printing, however.

With some browsers, the range of adjustment is limited, and even the smallest adjustable size may not fit on a printed page, and better printed output is obtained by setting a fixed font size, typically 9–10 pt. If Rise/Set Criteria restricting the time difference between a Sun rise or set and a Moon rise or set have been given, an extra column is displayed, and the smaller font size may be needed.

With other browsers (e.g., Firefox) better results are obtained by leaving the font size unspecified and allowing the browser to shrink the output to fit the page. See the section on Printing and Saving Results for additional information.

User Preferences Buttons

Apply Settings
Applies the values in the form to future calculations.
Close
Closes the User Preferences form. If changes to the settings have been made but not applied, a warning is given. To apply the changes, click “Cancel” and then “Apply Settings”. To close the form without saving the changes, click “OK”.
Reset
Resets all values in the User Preferences form to their defaults.
Help
Displays this page.

Context-Sensitive help for User Preferences

Positioning the cursor over the description after any checkbox displays a brief description of what the option does. Clicking on the description brings up the appropriate section on this page.

Output

Rise and Set Times

Date
The date(s) for which the times have been calculated. If the cursor is passed over the date, it changes to a pointer and the tooltip

Set Sun and Moon Positions Date to date

is displayed. Clicking on the date sets the positions Date to that date, and gives focus to the main form. An asterisk (‘*’) appended to the year indicates daylight saving time. See the section on Daylight Saving Time for additional information on the implementation and its limitations.

Dawn
The beginning of morning civil twilight.
Rise
Time of Sun or Moon rise. If a nonzero rise altitude has been specified, the altitude is shown below the column title. If the time refers to the Sun’s or Moon’s center rather than the upper limb, an asterisk (‘*’) is appended to the column title.
Transit
The time at which the Sun or Moon is due south (in the northern hemisphere) or due north (in the southern hemisphere).
Set
Time of Sun or Moon set. If a nonzero set altitude has been specified, the altitude is shown below the column title. If the time refers to the Sun’s or Moon’s center rather than the upper limb, an asterisk (‘*’) is appended to the column title.
Dusk
The end of evening civil twilight.
Day Length
The time, in hours and minutes, that the Sun is above the horizon between midnight and the following midnight. Usually, this is the time between sunrise and sunset; however, at extreme latitudes, there are days on which set precedes rise. On such days, the day length displayed comprises two discontinuous periods.
Time Diff
If Rise/Set Criteria restricting the time of Moon rise or set relative to Sun rise or set have been given, this shows the time difference, in hours and minutes (hh:mm), between the Moon event and the Sun event. The value is negative when the Moon event occurs before the Sun event. This column is not displayed if no time difference restrictions have been given, or if restrictions have been given for both Moon rise and set. To force display of this column, specify the greatest allowable time differences for either moonrise or moonset. Dates on which the Moon does not rise or does not set do not meet the time difference criteria, and those dates do not appear in the results.
Rise Azimuth
The Sun’s or Moon’s azimuth, in degrees, at rise. An appended asterisk (‘*’) in the column header indicates magnetic north rather than true north.
Set Azimuth
The Sun’s or Moon’s azimuth, in degrees, at set.
Max Alt
The altitude of the center of the Sun or Moon at transit, in degrees. Except for the Moon at extreme latitudes, the value displayed is very close to the actual maximum altitude. The value includes allowance for atmospheric refraction, and in the case of the Moon, correction for parallax.
Phase
The Moon’s phase. By default, the value at transit is shown. If Rise/Set Criteria restricting azimuth, phase, or time of rise or set relative to Sun rise or set have been given, the Sun/Moon Calculator assumes that you are primarily interested in that Moon event, and accordingly, shows the phase at rise or set. If Rise/Set Criteria restricting characteristics of both Moon rise and set have been given, the Sun/Moon Calculator cannot determine what you want, and shows the phase at transit. The Moon event to which the value applies is indicated in the column header. The display of phase at Moon rise or set can be forced by checking the appropriate box on the Criteria for Sun and Moon Rise and Set form without changing the default range of 0 to 1.

If Rise/Set Criteria restricting phase at rise or set have been given, a trailing plus sign (‘+’) indicates a waxing Moon, and a trailing minus sign (‘−’) indicates a waning Moon.

SD
The Moon’s semidiameter, in degrees. The value shown applies to the same Moon event as that for phase.
Special Symbols
North of the Arctic Circle, and south of the Antarctic Circle, there is at least one day per year on which the Sun does not rise, and another on which the Sun does not set. At less extreme latitudes, there are days on which civil twilight never ends; further north, there are days on which civil twilight never begins during the winter. The Moon exhibits similar behavior, but the timing varies monthly rather than yearly. Additionally, the latitudes at which this behavior appears for the Moon vary over an 18.6-year cycle. These conditions are indicated with the following symbols in place of times:

**** The Sun or Moon never sets
----- The Sun or Moon never rises
///// Civil twilight never ends; the Sun’s altitude is always greater than −6°
=== Civil twilight never begins; the Sun’s altitude is always less than −6°
No value for azimuth or time of rise, set, or beginning or end of civil twilight, because the event does not occur.

Because of the Moon’s orbit around the Earth, the Moon rises, on average, 49 minutes later each day. Consequently, at any latitude, there is one day each month on which the Moon does not rise, another on which the Moon does not transit, and another on which the Moon does not set. Such events are indicated by a dash (‘—’). At extreme latitudes, there may be many days on which the Moon neither rises nor sets; such events are indicated in the same manner as for the Sun.

A minus sign (‘−’) appended to a time indicates that the event occurs on the previous day; an appended plus sign (‘+’) indicates that the event occurs on the next day. This happens only when times are shown in Universal Time (UT).

An asterisk appended to Azimuth in the column heading indicates that rise and set azimuths are relative to magnetic north rather than true north.

Sun and Moon Positions

Time
The time for which the Sun’s position has been calculated. A minus sign (“−”) appended to a time indicates the previous day; this happens only when times are shown in Universal Time (UT). An appended plus sign (“+”) indicates the next day.
Azimuth
The Sun’s or Moon’s azimuth, in degrees. By default, azimuths are relative to true north; an appended asterisk in the column heading indicates azimuths relative to magnetic north.
Altitude
The apparent altitude of the center of the Sun or Moon, in degrees. Apparent altitudes greater than or equal to zero include an allowance for atmospheric refraction; for apparent altitudes less than zero, the true altitude is shown. Because of this, there is a jump in apparent altitude, equal to the refraction, near the horizon; however, the actual motion of the Sun or Moon is uniform. The value for the Moon includes a correction for parallax in all cases.
Path Angle
The angle of the Sun’s or Moon’s path with a parallel of altitude. A trailing minus sign (‘−’) indicates that path is inclined to the north.
Shadow Length
The length of a shadow for an object of unity height. For example, if the shadow length is 3, an object 6 feet in height will cast an 18-foot shadow. For the sake of alignment, all values are given to two decimal places, but the actual precision is considerably less than this implies, especially at low altitudes where variations in atmospheric conditions have significant effect. Shadow lengths greater than 100 are indicated as “ > 100,” though any values greater than about 30 are of little practical significance.
Phase
The Moon’s phase.
SD
The Moon’s semidiameter, in degrees.

If the default events Sunrise and Sunset are selected and neither occurs (as happens in polar regions in summer or winter), positions are shown hourly between 0:00 hours and 24:00 hours local time. Otherwise, if a specified start or end event does not occur, positions are not displayed. The behavior in either situation can be overridden by entering explicit start and end times and selecting a time interval.

Times and Positions: Context-Sensitive Help

When the cursor is positioned over the column heading for any of the outputs, the cursor changes to a pointer. Clicking on the column heading brings up the appropriate section on this page.

List Locations

When the cursor is positioned over the location name, the cursor changes to a pointer. Clicking on the location name sets that location as the selected location.

Bottom-of-Page Buttons

The following buttons appear at the bottom of the page when displaying the results of rise and set times, Sun and Moon positions, or location lists:
Close
Closes the output window. Doing so is not necessary, however; results of subsequent calculations overwrite the previous window contents.
Print
Reformats the output so as to be suitable for printing; the “Close,” “Print,” and “Help” buttons are omitted. In most cases, the browser’s Print dialog also is opened. If a font size has been specified in the User Preferences form, that font size is used. Otherwise, the font size is adjustable within the range allowed by the browser.
Help
Displays this page.

Printing and Saving Results

When printing rise and set times, either portrait or landscape orientation usually is suitable, although portrait orientation obviously will fit more results on a single page. When printing Sun and Moon positions calculated at the default 30-minute interval, portrait orientation usually is required to fit the results on a single page; however, fitting the output to the page width may require adjustment of the font size. By default, the output font size is not fixed, so the user can adjust it to the extent that the browser allows, but the range of adjustment may not be sufficient for the output to fit the page width in portrait mode.

With Internet Explorer 6, best results usually are obtained by setting a fixed font size on the User Preferences form before running the calculations. In most cases, a font size of 10 point will fit, but slight adjustments of the default page margins on the browser’s Page Setup dialog may be required.

With Firefox 1.5, best results usually are obtained by not specifying a font size, and checking the Shrink To Fit Page Width box on the Page Setup dialog.

With some browsers, saving with the browser’s “Save” or “Save As” command will save the main form rather than the results. To save the results, select “View Source,” “View Page Source,” or the equivalent, either by right clicking or by selection from the appropriate pull-down menu. Use the resulting window’s “Save” or “Save As” command to save the results to a file.

Glossary

Altitude
The vertical angle between the horizon and the Sun or Moon (negative values indicate that the Sun or Moon is below the horizon); values are between 0° and ±90°. Altitude normally is measured with a clinometer. Refraction by the atmosphere causes a body to appear slightly higher than its true position; the effect is greatest when the body is near the horizon. All displayed values include the effects of atmospheric refraction (and for the Moon, correction for parallax), so they correspond to what one actually would observe.
Atmospheric Refraction
Because the density of Earth’s atmosphere decreases with elevation, its index of refraction also decreases with elevation. When light from a celestial body passes through layers of different densities at an angle to the zenith, the layers act as prisms, and the light is refracted slightly. Because of this refraction, the body’s apparent altitude is slightly greater than its true altitude. Refraction is greatest at the horizon, where light from a body passes through the most atmosphere, and is zero when the body is at zenith (i.e., directly overhead). The standard value of refraction at the horizon at sea level is 34 minutes of arc, or 0.57°; the actual value varies slightly with temperature and atmospheric pressure. By convention, the refraction is included when a body is visible, i.e., its apparent altitude is greater than or equal to zero; when the body is not visible, the true altitude is reported. Because of this, the body’s reported altitude shows a step change as the body crosses the horizon; however, the body’s actual motion is uniform. Because of the step change in altitude, there is a range of reported altitudes that do not occur. For example, at sea level, the refraction at the horizon is approximately 0.57°; when a rising Sun or Moon crosses the horizon, its reported altitude immediately increases from −0.57° to 0°, so that it never has an altitude between −0.57° and 0°.

For a location well above sea level, light from a celestial body passes through less atmosphere, and the refraction is slightly less than that at sea level. The difference is greatest at the horizon, and decreases with the body’s altitude. Even at the horizon, the difference is slight, on the order of 0.15° at an elevation of 10,000 ft, and rise and set times change by a minute at most.

Elevated Observer

For an observer at a height substantially above the surrounding terrain, the visible horizon has a negative apparent altitude. When displaying Sun or Moon positions for an elevated observer, the refraction is included if it would put the center of the body above the visible horizon. Because of this, the body’s reported altitude shows a step change as the body crosses the visible horizon; again, however, the body’s actual motion is uniform. Because of the step change, there is a range of reported altitudes that do not occur; the range is wider for an elevated observer than for an observer at ground level. For example, with a location at an elevation of 4000 ft and an observer at 10,000 ft above that location, the visible horizon is at an apparent altitude of −1.64°; when a rising Sun or Moon crosses the visible horizon, its reported altitude immediately increases from −2.42° to −1.64°, so that it never has an altitude between −2.42° and −1.64°.

In calculating refraction, the Sun/Moon Calculator assumes a sea-level temperature of 10°C and a sea-level atmospheric pressure of 1010 mbar; when the location’s elevation is known, these values are adjusted for elevation.

Azimuth
The horizontal angle between north and the Sun or Moon; values are between 0° and 360°. Equivalent to compass bearing. Because the magnetic and geographic poles do not coincide, a compass needle generally does not point to true north. The difference between true north and magnetic north is the magnetic declination. Some compasses include a provision to adjust for the magnetic declination so that they can indicate relative to true north.
Declination
The angle between a celestial body and the plane of the celestial equator, measured along a great circle passing through the north and south celestial poles; the maximum possible range is ±90°. Declinations of stars are relatively fixed, but declinations of the Sun, Moon, and planets vary because of their motions relative to Earth and the inclination of Earth’s axis. The range of the Sun’s declination is approximately ±23.5°, and the Sun’s declination goes through this range in the course of a tropical year. The Moon’s declination goes through its range in course of a tropical month; however, that range varies over an 18.6-year cycle, from a minimum of approximately ±18.1° to a maximum of ±28.9°. Changes in the Sun’s declination are responsible for varying day lengths and seasons; changes in both the Sun’s and Moon’s declinations are responsible for changes in rise and set azimuths. “Declination” in this context has no relation to the magnetic declination of a compass.
Dip of the Horizon
The apparent negative altitude of the visible horizon for an observer at a height above the surrounding terrain. The astronomical or sensible horizon at 0° is always perpendicular to the local vertical. The dip is the angle by which the visible horizon appears to be lower than the astronomical horizon; though it corresponds to a negative altitude, it is usually given as a positive value. A body such as the Sun or Moon is visible when it is above the apparent horizon, and consequently can be visible to an elevated observer at negative apparent altitudes. The maximum dip from any terrestrial location is slightly greater than two degrees; if a feature has a greater negative altitude (e.g., Yosemite’s Half Dome from Clouds Rest, at about −4.2°), it will appear lower than the distant horizon.

When a nonzero observer’s height is specified, the dip of the horizon is shown in the output.

Geocentric
Referring to an observer at the center of the Earth. Compare with topocentric.
Magnetic Declination
The angular difference between true north and magnetic north. A positive (E) value means that a compass needle will point east of true north, and indicated azimuths will be less than azimuths relative to true north; true azimuths are obtained by adding the magnetic declination to compass readings. A negative (W) value means that a compass needle will point west of true north, and indicated azimuths will be greater than those relative to true north; true azimuths are obtained by subtracting the magnetic declination from compass readings. Some compasses can be adjusted for magnetic declination so that they indicate azimuths relative to true north.

Magnetic declinations change slowly over time; using a value from an old topographic map can lead to significant errors. Even with a current value, it is important to be aware of the limitations of the magnetic model used to calculate magnetic declinations. The accuracy typically is ½°, but it does not account for local variations, which sometimes can be several degrees.

When calculating rise and set times, the Sun/Moon Calculator recalculates the magnetic declination every thirty days. The value shown at the top of the results page is determined for a date in the middle of the calculation period; if the period is greater than six months, the date for which the magnetic declination has been calculated is displayed. Magnetic declination is not displayed if the middle of the calculation period is more than one year outside the model’s valid range unless azimuths are shown relative to magnetic north or conversions between true and magnetic north are shown; a caution is given if that date is outside the model’s range.

Parallax
The difference in apparent direction to a celestial body from two observers in different locations. Mathematical considerations dictate that calculations of positions of celestial bodies involve the centers of those bodies, including Earth. However, a typical observer is on Earth’s surface rather than at its center. When a body is on the horizon, a topocentric observer is displaced from a geocentric observer by the distance of Earth’s radius, and the body’s parallax is at its maximum. Parallax is inversely proportional to a body’s distance from Earth; the Sun’s parallax is so slight that it usually may be neglected, but because of the Moon’s proximity to Earth, its mean horizontal parallax is approximately 0.95°, nearly twice the Moon’s angular diameter. Parallax decreases with altitude, and is zero when a body is at zenith, where the center of the Earth, the observer, and the body are in a straight line.
Path Angle
The angle, often indicated by the symbol ψ, between the Sun’s or Moon’s path and a parallel of altitude. Conventionally, the range is between 0° and 180°; values less than 90° indicate that the path is inclined toward the south, and values greater than 90° indicate that the path is inclined toward the north. At north latitudes greater than the Sun’s or Moon’s greatest declination (approximately 23.5° for the Sun and 28.6° for the Moon), the path always is inclined toward the south; at south latitudes less than the least declination (approximately ±23.5° and ±28.6° for the Sun and Moon), the path always is inclined toward the north. At latitudes between the extremes of declination, the path angle can be either less than or greater than 90°. To assist in visualizing the Sun’s or Moon’s motion, the Sun/Moon Calculator displays path angles greater than 90° as their complement with respect to 180°, i.e., 180° − ψ, with an appended minus sign (‘−’), so that a path angle of 102.53° would be displayed as ‘77.47−’. The values displayed are for a topocentric observer, and include the effects of atmospheric refraction.
Phase
The illuminated fraction of the Moon’s disk; 0 = new moon, 0.5 = quarter moon, 1.0 = full moon. Unlike most sources, the Sun/Moon Calculator gives the topocentric phase rather than the geocentric phase. In theory, this should better correspond to what would be observed, but in most cases the difference between geocentric and topocentric phase is slight, on the order of a fraction of a percent.
Rise and Set
The point at which the Sun’s or Moon’s upper limb (i.e., the top of the Sun’s or Moon’s disk) is on a level horizon (i.e., altitude is zero). Because of refraction by the atmosphere, the Sun appears slightly higher than its actual position. Calculations include a nominal allowance to account for this difference, but actual atmospheric refraction can vary due to temperature and barometric pressure. Accordingly, actual times of rise and set can differ from nominal times by several minutes.
Semidiameter
Half of the Moon’s angular diameter. Semidiameter increases with altitude because the observer gets slightly closer to the body, and at zenith, the Earth–body distance is decreased by Earth’s radius. The Earth–Sun distance is so great a change by the amount of Earth’radius is insignificant. For the Moon, however, the increase in apparent semidiameter is slightly more than 1.5% at mean Earth–Moon distance. Consequently, the Moon’s angular diameter is slightly greater when directly overhead than when on the horizon, appearances to the contrary notwithstanding.
Topocentric
Referring to an observer on the surface of the Earth. The apparent position of a celestial body as seen by a topocentric observer differs from that seen by a geocentric observer because of the body’s parallax.
Twilight
A period during which the Sun is below the horizon but still provides illumination; it occurs in the morning before sunrise and in the evening after sunset. Three conditions of twilight are defined: civil, nautical, and astronomical, beginning and ending when the Sun’s center is 6°, 12°, and 18° below the horizon. At the end of civil twilight, activities such as reading a printed page are difficult, and activities such as driving or athletic events generally require artificial lighting. At the end of nautical twilight it is usually too dark to observe a horizon at sea; at the end of astronomical twilight, the Sun essentially does not contribute to the illumination of the sky.
Universal Time
The basis of civil timekeeping is the mean solar day, the rotation of the Earth relative to the Sun. The corresponding time observed on the Greenwich meridian (0° longitude) is Universal Time (UT).

Because Earth’s rotation is not perfectly uniform, UT is not a perfectly uniform time scale. International Atomic Time (Temps Atomique International, or TAI), determined from atomic clocks by the Bureau International de Poid et Measures in Sèvres, France, is as uniform is as currently possible. There actually are several versions of UT; one, Coordinated Universal Time (UTC), is derived from TAI but is adjusted by the periodic addition of leap seconds so that it differs from UT by no more than 0.9 seconds, and from TAI by an integral number of seconds. UTC is the official basis of civil timekeeping throughout the world. In the United Kingdom, Greenwich Mean Time (GMT) has meant UTC, but in navigation, the meaning has been slightly different. Accordingly, UTC is preferred for worldwide timekeeping.

For most practical purposes, including any times used or calculated by the Sun/Moon Calculator, UT, UTC, and GMT are interchangeable.

DMS and HM Input

Values for latitude, longitude, altitude, and azimuth may entered in DMS (degrees:minutes:seconds) format; values for times for which to determine positions may be entered in HM (hours:minutes) format.

The degrees, minutes, and seconds components of a DMS value are separated by a colon (‘:’) or one or more spaces; the hour and minute components of an HM value are separated by a colon. The last component may be a decimal number, so that values in almost any common format may be entered directly. An angle may be entered as degrees, minutes, and decimal seconds; degrees and decimal minutes; or decimal degrees. For example, a latitude of 37°46′30″ may be entered as 37:46:30, 37:46.5, or 37.775. Similarly, HM values may be entered in hours and minutes or decimal hours. For example, the time 10:15 may be entered as 10:15 or 10.25; decimal values are rounded to the nearest minute. Leading zeros are not required for nonzero minutes or seconds components, so that 106:7:8 is equivalent to 106:07:08. However, if a value less than one degree is given as DMS, or a value less than one hour is given as HM, a zero is required in the degrees (or hours) position (e.g., 0:25:17 rather than :25:17. A value less than one minute must include zeros in the degrees and minute positions (e.g., 0:0:17).

Only one decimal DMS or HM component is allowed, and it must be the last. For example, 37:46.5 and 37:46:30.2 are acceptable but 37.7:3.6 or 37.7:4 are not.

Several additional DMS formats are recognized, allowing direct copying and pasting from many geographical databases. Some characteristics of these formats are

  1. The degrees, minutes, and seconds components may be followed by symbols commonly used to indicate degrees, minutes, and seconds: the degree symbol (“°”) for degrees, the prime symbol (“”) or ASCII apostrophe (“'”) for minutes, and the double prime symbol (“”), ASCII double quote (“"”), or two ASCII apostrophes (“''”) for seconds. When these symbols are included, spaces between the degrees, minutes, and seconds components are optional. Thus a latitude may be entered as 37°46′30″N, 37° 46' 30" N, or N 37° 46' 30''.

    Because these symbols require extra typing, there hardly ever is any reason to use them for manual entry; they are permitted to allow easy copying and pasting from databases such as the US National Geospace Intelligence Agency or GeoNames.

    If seconds are given, degrees and minutes must also be given; e.g., 37°46′30″ is fine but 37°30″ is invalid.

  2. Values for latitude and longitude may be in the packed DMS format ([dd]dmmss[.ss...]) used in databases such as the US Geological Survey Geographic Names Information System. At least one digit for degrees is required, and values less than 10 for minutes and seconds must have leading zeros.
  3. Values for latitude and longitude in any format may include the prepended or appended hemisphere indicators N, S, E, or W (e.g., N37:46:30, 374630N, or N 37 46 30). When a hemisphere indicator is included, the hemisphere indicator following the text box on the Sun/Moon Calculator is automatically set to match.

Times may be given in either 24-hour (e.g., 19:21) or AM/PM (e.g., 7:21 pm) format, regardless of the output time display format. Either format can use HM or decimal hours. In AM/PM format the ‘m’ and the space between the time and the AM/PM specifier are optional; thus 7:21 pm, 7:21pm, 7:21 p, and 7:21p all have the same effect. A start time of 12 am is interpreted as midnight at the beginning of the specified date; an end time of 12 am is interpreted as midnight at the end of the specified date.

After entry, start and end times are reformatted in the style of the output time display format, so that if Show time as AM/PM is selected on the User Preferences form, a time value entered as 14.25 will be reformatted as 2:15 pm.

Daylight Saving Time

The Sun/Moon Calculator automatically switches between standard and daylight saving time (“Summer Time” in most locations outside the United States) if the selected location observes daylight saving time. The rules are current as of February 2009; for some countries, especially outside North America and Europe, the rules change frequently, and the rules used by the Sun/Moon Calculator are best estimates from several sources. When coordinates are specified by the user and no country is specified in the Name field, the beginning and end times for daylight time for all locations in the northern hemisphere use United States rules; for locations in the southern hemisphere, these times are reversed.

On the day of transition to daylight time, an asterisk is appended to the date, although the times for events occurring before the transition to daylight time are in standard time. On the day of transition from daylight time, the date is shown without an appended asterisk, although the times for events occurring before the transition are in daylight saving time. On the latter day, the times for events occurring between the transition time and one hour earlier are ambiguous, because these times occur twice. Should this be of concern, the ambiguity can be resolved by calculating positions between midnight and the transition time.

Limitations

At moderate latitudes, the rise and set times determined by the Sun/Moon Calculator are within a minute of the correct values, and azimuths and altitudes usually are within a tenth of a degree of the correct values. The results usually are more than sufficient for planning photography and other outdoor activity, and may suffice for many amateur astronomical observations. However, the accuracy may not be sufficient for navigation, precise surveying, or high-precision astronomical observations such as stellar occultations.

Results usually are reasonable for latitudes between approximately ±82° (e.g., including Canada’s Quttinirpaaq National Park in Nunavut), although the accuracy is slightly less than at lower latitudes. Accuracy degrades rapidly within a few degrees of the poles, however, and the values reported there should be used with caution.

North of the Arctic Circle or south of the Antarctic Circle, there is at least one day each year on which the Sun does not rise, and another on which it does not set. At extreme latitudes, there are extended periods of light and dark. For example, in Alert, Nunavut, the Sun does not rise between the middle of October and the end of February, and does not set between the first week of April and the first week of September. During the periods of transition between light and dark, the Sun’s path may be almost parallel to the horizon, and a very slight error in the Sun’s position can cause a significant error in the times of rise or set; the situation is similar for the Moon. During these periods, reported times for Sun rise or set, and particularly for Moon rise or set, can be substantially in error, and in some cases, the calculator may fail to detect a rise or set. Of course, it should be kept in mind that for days on which the Sun or Moon is almost on the horizon for the entire day, the concept of rise and set is somewhat different from what it is at moderate latitudes.

Because of variations in atmospheric conditions, the actual times of rise and set can differ from the nominal times by a minute or more, even at moderate latitudes. At extreme latitudes, the differences can be even greater. Consequently, calculating these times to a precision of less than a minute makes little sense.

Additional Resources

The United States Naval Observatory is the preeminent authority in the United States for the positions of the Sun, Moon, and other celestial bodies. The USNO Astronomical Applications pages include a wealth of information about astronomical phenomena, calendars, time, and other related subjects. The USNO offers a number of publications, including the Astronomical Almanac, and several software products. The site includes many links to other sources of astronomical and calendrical information.

The USNO AA Data Services include several that are useful to photographers:

Locations can be selected from a database of 22,000 cities and towns in the United States; location properties can be specified for locations not in the database. Obtaining the same basic data provided by the Sun/Moon Calculator requires several steps, but the USNO data are slightly more accurate and are unquestionably authoritative.

USNO AA Data Services can also provide the phases of the Moon, times of twilight, the beginnings of seasons, and many other astronomical data.

Technical Notes

Ecliptic Coordinates of the Sun and Moon

The Sun/Moon Calculator determines ecliptic coordinates of the Sun and Moon using the formulas of Van Flandern and Pulkkinen (1979), which are accurate to within one arc minute, and in many cases much better. For most non-scientific applications, this is more than sufficient. Essentially the same accuracy applies to Sun and Moon azimuths and to true (uncorrected for refraction) altitudes, but because of the variability in atmospheric refraction, not to apparent altitudes. The effect of refraction on apparent altitude is discussed further under the section below on refraction.

Rise and Set Times

Rise and set times are determined using an iterative algorithm similar to that of Yallop and Hohenkerk (1992, 487) and Meeus (1991, 97–99); accuracy degrades at extreme latitudes, and in some cases this method may fail to detect a rise or set. Other methods, such as described by Yallop and Hohenkerk (1992, 487), Sinnott (1989), and Montenbruck and Pfleger (1999, 46–56), largely avoid these problems but do so at the cost of increased computational overhead. As noted above, the calculator’s results for any location in its database are usually reasonable.

Formulas for positions of the Sun and Moon, especially the latter, involve many terms of trigonometric functions, and consequently require considerable computational overhead. When determining rise and set times, Sun and Moon positions are calculated at 0h, 12h, and 24h local time, and the positions for intermediate times determined from quadratic interpolation of the calculated positions. Interpolation significantly decreases program running time, with insignificant decrease in accuracy; the change in positions is usually less than 0.005°, and the change in rise and set times is usually less than a second. Because rise and set times are rounded to the nearest minute, however, a difference of a fraction of a second can occasionally change a displayed value by a minute.

Sinnott (1989) used essentially the same interpolation scheme but a different rise and set algorithm. Meeus (1999) used essentially the same rise and set algorithm but interpolated from positions calculated on three successive midnights rather than over a single day.

Sun and Moon Positions

When showing Sun and Moon positions, all positions, including those for rise and set times, are calculated. The time required to compute positions even at one-minute intervals is sufficiently short that there is little perceptible benefit from using interpolation. Rarely, results from a search or from a multi-day rise/set time calculation may differ very slightly from rise and set times shown at the top of the results for position calculations for one of those days; as mentioned, however, the differences are usually insignificant

Searches Using Rise/Set Criteria

Searches involving altitude ranges are implemented by finding the time that the body crosses the midpoint of the specified altitude range and extending the limits of azimuth (and for the Moon, the time relative to sunrise or sunset) assuming a constant declination. For almost any reasonable search, the Sun’s declination is nearly constant, changing at most about 1′ (1 arc minute) per hour; however, the Moon’s declination can change by almost 15′ per hour as it crosses the equator, so there is some loss of accuracy in a search that specifies a wide altitude range for the Moon. The time range is adjusted using the formula given by Yallop and Hohenkerk (1992, 489, eq. 9.333-1), which assumes a constant azimuth as well as a constant rate of change of hour angle, so there is some decrease in accuracy of the time limits when specifying a large altitude range. The potential inaccuracies could be largely avoided by examining Sun and Moon positions at very small time intervals (e.g., of a minute or less) at the cost of a tremendous increase in computational overhead. Even so, a grazing pass through a specified range of altitude and azimuth could be missed if it occurred between calculation intervals, so there might not be any real improvement in accuracy. In most cases of practical interest, the slight loss of accuracy is not an issue. Even with a wide range of altitude, potential problems can be avoided by specifying slightly wider ranges of azimuth and time than are actually needed.

For a search to succeed, the crossing of the midpoint of a specified altitude range must actually occur, and this requirement may not be obvious. For example, a search giving a solar altitude range of −90° to 0° would fail on a day on which the Sun’s minimum altitude was greater than −45°.

Refraction

By convention, rise and set times are calculated assuming atmospheric refraction at the horizon of 34′. But refraction decreases rapidly with altitude, so the standard value cannot be used when a nonzero altitude is specified. Rigorous calculation of refraction requires numerical integration, and the attendant computational overhead would be prohibitive for a scripted application. In addition, the calculations depend on a specific atmospheric temperature profile, such as that of the 1976 U.S. Standard Atmosphere. On average, this is a reasonable assumption, but deviations from this profile can cause refraction at the horizon to vary by as much as ±0.32° (Schaefer and Liller 1990), so the precision implied by rigorous calculations can be misleading.

The calculator uses the empirical formula of Bennett (1982, formula H for Rm) (described also in Meeus 1991, 102–103) to calculate atmospheric refraction when determining rise and set times for altitudes greater than or equal to zero. To provide a smooth transition between the standard rise and set altitude of zero and a user-specified altitude greater than zero, the calculator also uses Bennett’s formula at zero altitude. At sea level, this gives a value of 34.5′, which differs slightly from the standard value. Because variations in atmospheric conditions can cause the actual refraction at the horizon to vary by ±20′, the use of Bennett’s formula rather than the standard value has little practical significance.

Refraction is adjusted for the decrease of atmospheric density with elevation, using the 1976 US Standard Atmosphere as a model; because of this, rise and set times and Sun and Moon positions shown by the calculator may differ slightly from those given by other programs that do not take atmospheric density into account. If comparison with another program is desired, the adjustment for atmospheric density can be eliminated by selecting “Specify:,” clicking the Copy Selected Location button, and entering an elevation of zero.

Bennett’s formula gives the refraction when the apparent altitude is known; Sæmundsson (1986) made empirical adjustments to the coefficients in Bennett’s formula to give refraction from true altitude, which is what is needed when displaying Sun and Moon positions. At sea level the results of the two formulas are essentially interchangeable (i.e., when Sæmundsson’s formula is used with a true altitude determined with Bennett’s formula, the result is very nearly the same apparent altitude that was initially used with Bennett’s formula). When adjustment is made for atmospheric density, the interchangeability is slightly less good at low altitudes. To avoid this problem, the calculator uses an iterative application of Bennett’s formula for altitudes between 0° and 5° if the observer’s elevation is not zero. At greater altitudes, the difference between the two formulas is insignificant regardless of elevation; for altitudes greater than 5°, the calculator uses Sæmundsson’s formula to minimize computational overhead.

Refraction for an Elevated Observer

For an observer at a height above the location’s nominal elevation, the calculator treats the curvature of a light ray as constant, in a manner similar to that described in Young and Kattawar (1998, 3786–3787), when determining the dip of the horizon and the true altitude of rise and set. Actual ray curvature varies with elevation; the calculator uses the curvature for an elevation 1/3 of the way between the low and high elevations involved, and results are generally in good agreement with results of more rigorous calculations using methods of Sweer (1938) and Auer and Standish (2000). The methods of Auer and Standish are also described by Hohenkerk and Sinclair (1985). Sweer’s methods are the basis for many of the tabular values in Woolard and Clemence (1966, 215), whose work in turn is cited in Yallop and Hohenkerk (1992, 488). For determining negative apparent altitudes after rise (or before set), the calculator uses an approach similar to that of Cameron et. al. (1963) (discussed also in Woolard and Clemence 1966, 219). For positive apparent altitudes, the refraction is determined using Bennett’s and Sæmundsson’s formulas, and is based on the air density at the observer’s elevation.

References

Auer, Lawrence H., and E. Myles Standish. 2000. Astronomical Refraction: Computation for All Zenith Angles. Astronomical Journal 119, no. 5 (May):2472–2474.

Bennett, G.G. 1982. The Calculation of Astronomical Refraction in Marine Navigation. Journal of Navigation 35:255–259.

Cameron, Winifred S., John H. Glenn, M. Scott Carpenter, and John A. O’Keefe. 1963. Effect of Refraction on the Setting Sun as Seen from Space in Theory and Observation. Astronomical Journal 68, no. 5 (June):348–351.

Hohenkerk, C.Y., and A.T. Sinclair. 1985. The Computation of Angular Atmospheric Refraction at Large Zenith Angles. HM Nautical Almanac Office Technical Note No. 63.

Meeus, Jean. 1991. Astronomical Algorithms. Richmond, VA: Willmann-Bell.

Montenbruck, Oliver, and Thomas Pfleger. 1999. Astronomy on the Personal Computer, 4th ed. Berlin: Springer-Verlag.

Sæmundsson, Þorsteinn. 1986. Astronomical Refraction. Sky and Telescope 72 (July):70.

Schaefer, Bradley E., and William Liller. 1990. Refraction Near the Horizon. Publications of the Astronomical Society of the Pacific 102, no. 653 (July):796–805.

Sinnott, Roger W. 1989. Ups and Downs of the Moon. Sky and Telescope. July 1989, 78–80.

Sweer, John. 1938. The Path of a Ray of Light Tangent to the Surface of the Earth. Journal of the Optical Society of America 28 (September):327–329.

Van Flandern, T.C., and K.F. Pulkkinen. 1979. Low-Precision Formulae for Planetary Positions. Astrophysical Journal Supplement Series 41 (November):391–411.

Woolard, Edgar W., and Gerald M. Clemence. 1966. Spherical Astronomy. New York: Academic Press.

Yallop, B.D., and C.Y. Hohenkerk. 1992. Astronomical Phenomena in Explanatory Supplement to the Astronomical Almanac, rev. ed. Ed. P. Kenneth Seidelmann. Mill Valley, CA: University Science Books.

Young, Andrew T., and George W. Kattawar. 1998. Sunset Science. II. A Useful Diagram. Applied Optics 37, No. 18 (June):3785–3792.

The Sun/Moon Calculator is copyright Jeff Conrad, and all rights remain with the author. There are no restrictions on personal use; however, any commercial use or posting on a web site requires express permission of the author. You are free to redistribute the Sun/Moon Calculator, provided that all files are included without modification, including this paragraph. For personal use, you may revise any of the files in whatever manner you choose, though you may not claim copyright in any such revisions; when you modify any files, you are, of course, on your own. For convenience, all files, including a commented version of the main script, are available for download in a single zipped file.

The Sun/Moon Calculator is provided in the hope that it may be useful, but without any warranty of any kind, express or implied, and you assume all risk of use.