KosherJava Zmanim Homepage
Includes a dynamic Zmanim calendar generator

net.sourceforge.zmanim.util
Class ZmanimCalculator

java.lang.Object
  extended bynet.sourceforge.zmanim.util.AstronomicalCalculator
      extended bynet.sourceforge.zmanim.util.ZmanimCalculator

public class ZmanimCalculator
extends AstronomicalCalculator

Implementation of sunrise and sunset methods to calculate astronomical times. This implementation is a port of the C++ algorithm written by Ken Bloom for the sourceforge.net Zmanim project. Ken's algorithm is based on the US Naval Almanac algorithm. Added to Ken's code is adjustment of the zenith to account for elevation.

Version:
1.1
Author:
© Ken Bloom 2003 - 2004, © Eliyahu Hershfeld 2004 - 2007

Constructor Summary
ZmanimCalculator()
           
 
Method Summary
 String getCalculatorName()
           
 double getUTCSunrise(AstronomicalCalendar astronomicalCalendar, double zenith, boolean adjustForElevation)
          A method that calculates UTC sunrise as well as any time based on an angle above or below sunrise.
 double getUTCSunset(AstronomicalCalendar astronomicalCalendar, double zenith, boolean adjustForElevation)
          A method that calculates UTC sunset as well as any time based on an angle above or below sunset.
 
Methods inherited from class net.sourceforge.zmanim.util.AstronomicalCalculator
adjustZenith, getDefault, getElevationAdjustment, getRefraction, getSolarRadius, setRefraction, setSolarRadius
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZmanimCalculator

public ZmanimCalculator()
Method Detail

getCalculatorName

public String getCalculatorName()
Specified by:
getCalculatorName in class AstronomicalCalculator
Returns:
the descriptive name of the algorithm.

getUTCSunrise

public double getUTCSunrise(AstronomicalCalendar astronomicalCalendar,
                            double zenith,
                            boolean adjustForElevation)
Description copied from class: AstronomicalCalculator
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.

Specified by:
getUTCSunrise in class AstronomicalCalculator
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.
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.
See Also:
AstronomicalCalculator.getUTCSunrise(AstronomicalCalendar, double, boolean)

getUTCSunset

public double getUTCSunset(AstronomicalCalendar astronomicalCalendar,
                           double zenith,
                           boolean adjustForElevation)
Description copied from class: AstronomicalCalculator
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.

Specified by:
getUTCSunset in class AstronomicalCalculator
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.
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, Double.NaN will be returned.
See Also:
AstronomicalCalculator.getUTCSunset(AstronomicalCalendar, double, boolean)

KosherJava Zmanim Homepage
Includes a dynamic Zmanim calendar generator

Copyright © 2004 - 2007 Eliyahu Hershfeld. All Rights Reserved.