Zmanim.Calculator.AstronomicalCalculator Class Reference

An abstract class that all sun time calculating classes extend. This allows the algorithm used to be changed at runtime, easily allowing comparison the results of using different algorithms. More...

Inheritance diagram for Zmanim.Calculator.AstronomicalCalculator:
Zmanim.Calculator.IAstronomicalCalculator Zmanim.Calculator.JSuntimeCalculator Zmanim.Calculator.NOAACalculator Zmanim.Calculator.SunTimesCalculator Zmanim.Calculator.ZmanimCalculator

List of all members.

Public Member Functions

object Clone ()
 Creates a new object that is a copy of the current instance.
abstract double GetUtcSunrise (IAstronomicalCalendar astronomicalCalendar, double zenith, bool adjustForElevation)
 A method that calculates UTC sunrise as well as any time based on an angle above or below sunrise. This abstract method is implemented by the classes that extend this class.
abstract double GetUtcSunset (IAstronomicalCalendar astronomicalCalendar, double zenith, bool adjustForElevation)
 A method that calculates UTC sunset as well as any time based on an angle above or below sunset. This abstract method is implemented by the classes that extend this class.

Static Public Member Functions

static AstronomicalCalculator GetDefault ()

Protected Member Functions

 AstronomicalCalculator ()
 Initializes a new instance of the AstronomicalCalculator class.

Properties

abstract string CalculatorName [get]
 A descriptive name of the algorithm.

Detailed Description

An abstract class that all sun time calculating classes extend. This allows the algorithm used to be changed at runtime, easily allowing comparison the results of using different algorithms.

<author>Eliyahu Hershfeld</author>


Constructor & Destructor Documentation

Zmanim.Calculator.AstronomicalCalculator.AstronomicalCalculator (  )  [protected]

Initializes a new instance of the AstronomicalCalculator class.


Member Function Documentation

object Zmanim.Calculator.AstronomicalCalculator.Clone (  ) 

Creates a new object that is a copy of the current instance.

Returns:
A new object that is a copy of this instance.

summary> getDefault method returns the default sun times calculation engine. /summary> returns> AstronomicalCalculator the default class for calculating sunrise and sunset. In the current implementation the default calculator returned is the SunTimesCalculator.

static AstronomicalCalculator Zmanim.Calculator.AstronomicalCalculator.GetDefault (  )  [static]

summary> Method to return the adjustment to the zenith required to account for the elevation. Since a person at a higher elevation can see farther below the horizon, the calculation for sunrise / sunset is calculated below the horizon used at sea level. This is only used for sunrise and sunset and not times above or below it such as nautical twilight since those calculations are based on the level of available light at the given dip below the horizon, something that is not affected by elevation, the adjustment should only made if the zenith == 90°; adjusted for refraction and solar radius.
The algorithm used is:

               elevationAdjustment = MathExtensions.ToDegree(Math.acos(earthRadiusInMeters
               / (earthRadiusInMeters + elevationMeters)));

The source of this algorthitm is Calendrical Calculations by Edward M. Reingold and Nachum Dershowitz. An alternate algorithm that produces an almost identical (but not accurate) result found in Ma'aglay Tzedek by Moishe Kosower and other sources is:

               elevationAdjustment = 0.0347 * Math.sqrt(elevationMeters);

/summary> param name = "elevation"> elevation in Meters.

returns> the adjusted zenith

abstract double Zmanim.Calculator.AstronomicalCalculator.GetUtcSunrise ( IAstronomicalCalendar  astronomicalCalendar,
double  zenith,
bool  adjustForElevation 
) [pure virtual]

A method that calculates UTC sunrise as well as any time based on an angle above or below sunrise. This abstract method is implemented by the classes that extend this class.

Parameters:
astronomicalCalendar Used to calculate day of year.
zenith the azimuth below the vertical zenith of 90 degrees. for sunrise typically the zenith used for the calculation uses geometric zenith of 90°; and adjusts this slightly to account for solar refraction and the sun's radius. Another example would be AstronomicalCalendar.GetBeginNauticalTwilight that passes AstronomicalCalendar.NAUTICAL_ZENITH to this method.
adjustForElevation if set to true [adjust for elevation].
Returns:
The UTC time of sunrise in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in the calculation (expected behavior for some locations such as near the poles, Double.NaN will be returned.

Implements Zmanim.Calculator.IAstronomicalCalculator.

Implemented in Zmanim.Calculator.JSuntimeCalculator, Zmanim.Calculator.NOAACalculator, Zmanim.Calculator.SunTimesCalculator, and Zmanim.Calculator.ZmanimCalculator.

abstract double Zmanim.Calculator.AstronomicalCalculator.GetUtcSunset ( IAstronomicalCalendar  astronomicalCalendar,
double  zenith,
bool  adjustForElevation 
) [pure virtual]

A method that calculates UTC sunset as well as any time based on an angle above or below sunset. This abstract method is implemented by the classes that extend this class.

Parameters:
astronomicalCalendar Used to calculate day of year.
zenith the azimuth below the vertical zenith of 90°;. For sunset typically the zenith used for the calculation uses geometric zenith of 90°; and adjusts this slightly to account for solar refraction and the sun's radius. Another example would be AstronomicalCalendar.GetEndNauticalTwilight that passes AstronomicalCalendar.NAUTICAL_ZENITH to this method.
adjustForElevation if set to true [adjust for elevation].
Returns:
The UTC time of sunset in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in the calculation (expected behavior for some locations such as near the poles,
See also:
Double.NaN
will be returned.

Implements Zmanim.Calculator.IAstronomicalCalculator.

Implemented in Zmanim.Calculator.JSuntimeCalculator, Zmanim.Calculator.NOAACalculator, Zmanim.Calculator.SunTimesCalculator, and Zmanim.Calculator.ZmanimCalculator.


Property Documentation

abstract string Zmanim.Calculator.AstronomicalCalculator.CalculatorName [get]

The documentation for this class was generated from the following file:
Generated on Mon May 31 12:33:42 2010 for Zmanim Project by  doxygen 1.6.3