KosherJava Zmanim Homepage

net.sourceforge.zmanim.util
Class NOAACalculator

java.lang.Object
  extended by net.sourceforge.zmanim.util.AstronomicalCalculator
      extended by net.sourceforge.zmanim.util.NOAACalculator
All Implemented Interfaces:
Cloneable

public class NOAACalculator
extends AstronomicalCalculator

Implementation of sunrise and sunset methods to calculate astronomical times based on the NOAA algorithm. This calculator uses the Java algorithm based on the implementation by NOAA - National Oceanic and Atmospheric Administration's Surface Radiation Research Branch. NOAA's implementation is based on equations from Astronomical Algorithms by Jean Meeus. Added to the algorithm is an adjustment of the zenith to account for elevation.

Version:
0.1
Author:
© Eliyahu Hershfeld 2008

Constructor Summary
NOAACalculator()
           
 
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, clone, getDefault, getElevationAdjustment, getRefraction, getSolarRadius, setRefraction, setSolarRadius
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NOAACalculator

public NOAACalculator()
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.
Throws:
ZmanimException - if the year entered < 2001. This calculator can't properly deal with the year 2000. It can properly calculate times for years <> 2000.
See Also:
AstronomicalCalculator.getUTCSunset(AstronomicalCalendar, double, boolean)

KosherJava Zmanim Homepage

Copyright © 2004 - 2009 Eliyahu Hershfeld. All Rights Reserved. Released under the GPL 2 license