public enum StdSolarCalculator extends Enum<StdSolarCalculator> implements SolarTime.Calculator
Enumeration of some standard calculators for solar time.
| Enum Constant and Description |
|---|
CC
Follows closely the algorithms published by Dershowitz/Reingold in their book
"Calendrical Calculations" (third edition).
|
NOAA
Follows closely the algorithms published by NOAA (National Oceanic and Atmospheric Administration).
|
SIMPLE
Simple and relatively fast but rather imprecise calculator.
|
TIME4J
Based mainly on the astronomical calculations published by Jean Meeus in his book
"Astronomical Algorithms" (second edition).
|
| Modifier and Type | Method and Description |
|---|---|
double |
declination(double jde)
Determines the declination of sun.
|
double |
getFeature(double jde,
String nameOfFeature)
Supported features are at least "declination" and "right-ascension".
|
double |
rightAscension(double jde)
Determines the right ascension of sun.
|
static StdSolarCalculator |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static StdSolarCalculator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOfequationOfTime, getGeodeticAngle, getZenithAngle, name, sunrise, sunsetpublic static final StdSolarCalculator SIMPLE
This calculator was once published in "Almanac for Computers, 1990 by Nautical Almanac Office in United States Naval Observatory (USNO)".
Ed Williams has used this book as the source for
his algorithmic proposal. Mike
Reedell has then used the proposal of Williams to realize his popular sunrise/sunset-library written
in Java. Leaving aside general precision requirements, this method cannot be recommended for the
polar regions. So the scope of this method is constrained to the latitudes in range
-65.0 <= latitude <= +65.0 otherwise the results are expected to be unusable.
However, if users only use this method for actual years and non-polar regions, then the precision of sunrise or sunset events remain within two minutes (and the equation of time within one minute).
public static final StdSolarCalculator NOAA
Introduction
The website of NOAA also links to the calculation details. This is a calculator with reasonably good precision. But the altitude of the observer is not taken into account.
Although the precision is theoretically often better than one minute (for non-polar regions, beyond +/-72 degrees latitude rather in range of ten minutes), users should consider the fact that local topology or the actual weather conditions are not taken into account. Therefore truncating the results to minute precision should be considered.
Example
PlainDate date = PlainDate.of(2009, 9, 6);
SolarTime atlanta = SolarTime.ofLocation(33.766667, -84.416667, 0, StdSolarCalculator.NOAA);
TZID tzid = () -> "America/New_York";
assertThat(
date.get(atlanta.sunrise())
.get()
.toZonalTimestamp(tzid)
.with(PlainTime.PRECISION, ClockUnit.MINUTES),
is(PlainTimestamp.of(2009, 9, 6, 7, 15)));
public static final StdSolarCalculator CC
The altitude of the observer is taken into account by an approximated geodetic model.
Supported features (in degrees)
public static final StdSolarCalculator TIME4J
Introduction
This calculation offers high precision with the general limitation that the local topology or special weather conditions cannot be calculated.
The altitude of the observer is taken into account using a spheroid (WGS84) and the assumption of a standard atmosphere (for the refraction).
Supported features (in degrees)
public static StdSolarCalculator[] values()
for (StdSolarCalculator c : StdSolarCalculator.values()) System.out.println(c);
public static StdSolarCalculator valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic double declination(double jde)
Determines the declination of sun.
jde - julian day in ephemeris timerightAscension(double)public double rightAscension(double jde)
Determines the right ascension of sun.
jde - julian day in ephemeris timedeclination(double)public double getFeature(double jde,
String nameOfFeature)
Supported features are at least "declination" and "right-ascension".
getFeature in interface SolarTime.Calculatorjde - julian day in ephemeris timenameOfFeature - describes what kind of value shall be calculatedDouble.NaN if the feature is not supportedCopyright © 2014–2021. All rights reserved.