public static RiseSetTimes EventTimes(
EventType typeOfEvent,
int dayOfWeek,
int monthOfYear,
int year,
double siteLatitude,
double siteLongitude,
double siteTimeZone
)Public Shared Function EventTimes (
typeOfEvent As EventType,
dayOfWeek As Integer,
monthOfYear As Integer,
year As Integer,
siteLatitude As Double,
siteLongitude As Double,
siteTimeZone As Double
) As RiseSetTimesThe 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:
The returned RiseSetTimes class presents these members:
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.
| InvalidValueException | When the supplied combination of day, month and year is invalid e.g. 31st September. |