Package org.shredzone.commons.suncalc
Enum SunTimes.Twilight
- All Implemented Interfaces:
Serializable
,Comparable<SunTimes.Twilight>
,java.lang.constant.Constable
- Enclosing class:
- SunTimes
Enumeration of predefined twilights.
The twilight angles use a geocentric reference, by definition. However,
VISUAL
and VISUAL_LOWER
are topocentric, and take the spectator's
elevation and the atmospheric refraction into account.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAstronomical twilight (-18°).Blue hour (-4°).Civil twilight (-6°).Golden hour (6°).The moment when the center of the sun crosses the horizon (0°).Nautical twilight (-12°).End of Blue hour (-8°).The moment when the visual upper edge of the sun crosses the horizon.The moment when the visual lower edge of the sun crosses the horizon. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getAngle()
Returns the sun's angle at the twilight position, in degrees.double
Returns the sun's angle at the twilight position, in radians.boolean
Returnstrue
if this twilight position is topocentric.static SunTimes.Twilight
Returns the enum constant of this type with the specified name.static SunTimes.Twilight[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
VISUAL
The moment when the visual upper edge of the sun crosses the horizon. This is commonly referred to as "sunrise" and "sunset". Atmospheric refraction is taken into account.This is the default.
-
VISUAL_LOWER
The moment when the visual lower edge of the sun crosses the horizon. This is the ending of the sunrise and the starting of the sunset. Atmospheric refraction is taken into account. -
HORIZON
The moment when the center of the sun crosses the horizon (0°). -
CIVIL
Civil twilight (-6°). -
NAUTICAL
Nautical twilight (-12°). -
ASTRONOMICAL
Astronomical twilight (-18°). -
GOLDEN_HOUR
Golden hour (6°). The Golden hour is betweenGOLDEN_HOUR
andBLUE_HOUR
. The Magic hour is betweenGOLDEN_HOUR
andCIVIL
.- See Also:
-
BLUE_HOUR
Blue hour (-4°). The Blue hour is betweenNIGHT_HOUR
andBLUE_HOUR
.- See Also:
-
NIGHT_HOUR
End of Blue hour (-8°)."Night Hour" is not an official term, but just a name that is marking the beginning/end of the Blue hour.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getAngle
Returns the sun's angle at the twilight position, in degrees. -
getAngleRad
Returns the sun's angle at the twilight position, in radians. -
isTopocentric
Returnstrue
if this twilight position is topocentric. Then the parallax and the atmospheric refraction is taken into account.
-