AstroUtilitiesEventTimes Method

Function that returns a list of rise and set events of a particular type that occur on a particular day at a given latitude, longitude and time zone

Definition

Namespace: ASCOM.Tools
Assembly: ASCOM.AstrometryTools (in ASCOM.AstrometryTools.dll) Version: 3.0.0-rc.1+86c25ce733aebb4d8b1b8a62e84770ea5e972bea
C#
public static RiseSetTimes EventTimes(
	EventType typeOfEvent,
	int dayOfWeek,
	int monthOfYear,
	int year,
	double siteLatitude,
	double siteLongitude,
	double siteTimeZone
)

Parameters

typeOfEvent  EventType
Type of event e.g. Sunrise or Astronomical twilight
dayOfWeek  Int32
Integer Day number
monthOfYear  Int32
Integer Month number
year  Int32
Integer Year number
siteLatitude  Double
Site latitude
siteLongitude  Double
Site longitude (West of Greenwich is negative)
siteTimeZone  Double
Site time zone offset (West of Greenwich is negative)

Return Value

RiseSetTimes
An RiseSetTimes class containing event information.

Remarks

The definitions of sunrise, sunset and the various twilights that are used in this method are taken from the US Naval Observatory Definitions.

The dynamics of the Sun, Earth and Moon can result at some latitudes in days where there may be no, 1 or 2 rise or set events during a 24 SI hour period.

Rise-set or start-end times are available for the following events:

  • Sun rise-set.
  • Moon rise-set.
  • Civil twilight start-end.
  • Nautical twilight start-end.
  • Amateur astronomical twilight start-end.
  • Astronomical twilight start-end.
  • Mercury rise-set.
  • Venus rise-set.
  • Mars rise-set.
  • Jupiter rise-set.
  • Saturn rise-set.
  • Uranus rise-set.
  • Neptune rise-set.
  • Pluto rise-set.

The returned RiseSetTimes class presents these members:

  • AboveHorizonAtMidnight - Boolean - True if the body is above the event limit at midnight (the beginning of the 24 hour day), false if it is below the event limit
  • RiseEvents - Generic List of double - List of rise times in this 24 hour period
  • SetEvents - Generic List of double - List of set times in this 24 hour period

The algorithm employed in this method is taken from Astronomy on the Personal Computer (Montenbruck and Pfleger) pp 46..56, Springer Fourth Edition 2000, Fourth Printing 2009. The day is divided into twelve two hour intervals and a quadratic equation is fitted to the altitudes at the beginning, middle and end of each interval. The resulting equation coefficients are then processed to determine the number of roots within the interval (each of which corresponds to a rise or set event) and their sense (rise or set). These results are then aggregated over the day and the resultant list of values returned as the function result.

High precision ephemerides for the Sun, Moon and Earth and other planets from the JPL DE421 series are employed as delivered by the ASCOM Novas component rather than using the lower precision ephemerides employed by Montenbruck and Pfleger.

Accuracy Whole year almanacs for Sunrise/Sunset, Moonrise/Moonset and the various twilights every 5 degrees from the North pole to the South Pole at a variety of longitudes, time-zones and dates have been compared to data from the US Naval Observatory Astronomical Data web site. Most returned event times are within 1 minute of the USNO values although some very infrequent grazing event times at latitudes from 67 to 90 degrees North and South can be up to 10 minutes different.

An Almanac program that creates a year's worth of information for a given event, latitude, longitude and time-zone is included in the developer code examples elsewhere in this help file. This creates an output file with an almost identical format to that used by the USNO web site and allows comprehensive checking of accuracy for a given set of parameters.

Exceptions

InvalidValueExceptionWhen the supplied combination of day, month and year is invalid e.g. 31st September.

Version Information

.NET Standard

Supported in: 2.0

See Also