Skip to content
53 changes: 27 additions & 26 deletions src/main/java/com/kosherjava/zmanim/AstronomicalCalendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ public class AstronomicalCalendar implements Cloneable {
private AstronomicalCalculator astronomicalCalculator;

/**
* The method returns an <code>Instant</code> representing the {@link AstronomicalCalculator getElevationAdjustment(double)
* elevation adjusted} sunrise time. The zenith used for the calculation uses {@link GEOMETRIC_ZENITH geometric zenith} of
* 90&deg; plus {@link AstronomicalCalculator#getElevationAdjustment(double)}. This is adjusted by the {@link
* AstronomicalCalculator} to add approximately 50/60 of a degree to account for 34 archminutes of refraction and 16 archminutes
* for the sun's radius for a total of {@link AstronomicalCalculator#adjustZenith 90.83333&deg;}. See documentation for the
* specific implementation of the {@link AstronomicalCalculator} that you are using.
* The getSunrise method returns a <code>Instant</code> representing the {@link AstronomicalCalculator
* #getElevationAdjustment(double) elevation adjusted} sunrise time. The zenith used for the calculation uses {@link
* GEOMETRIC_ZENITH geometric zenith} of 90&deg; plus {@link AstronomicalCalculator#getElevationAdjustment(double)}. This is
* adjusted by the {@link AstronomicalCalculator} to add approximately 50/60 of a degree to account for 34 archminutes of
* refraction and 16 archminutes for the sun's radius for a total of {@link AstronomicalCalculator#adjustZenith 90.83333&deg;}.
* See documentation for the specific implementation of the {@link AstronomicalCalculator} that you are using.
*
* @return the <code>Instant</code> representing the exact sunrise time. If the calculation can't be computed such as in the
* Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does not set, a
Expand All @@ -124,14 +124,14 @@ public class AstronomicalCalendar implements Cloneable {
* @see getSeaLevelSunrise()
* @see getUTCSunrise(double)
*/
public Instant getSunrise() {
double sunrise = getUTCSunrise(GEOMETRIC_ZENITH);
if (Double.isNaN(sunrise)) {
public Instant getSunrise() {
double sunrise = getUTCSunrise(GEOMETRIC_ZENITH);
if (Double.isNaN(sunrise)) {
return null;
} else {
return getInstantFromTime(sunrise, SolarEvent.SUNRISE);
}
}
}

/**
* A method that returns the sunrise without {@link AstronomicalCalculator#getElevationAdjustment(double) elevation
Expand Down Expand Up @@ -187,14 +187,15 @@ public Instant getBeginNauticalTwilight() {
public Instant getBeginAstronomicalTwilight() {
return getSunriseOffsetByDegrees(ASTRONOMICAL_ZENITH);
}

/**
* The method returns an <code>Instant</code> representing the {@link AstronomicalCalculator#getElevationAdjustment(double)
* elevation adjusted} sunset time. The zenith used for the calculation uses {@link GEOMETRIC_ZENITH geometric zenith} of
* 90&deg; plus {@link AstronomicalCalculator #getElevationAdjustment(double)}. This is adjusted by the {@link
* AstronomicalCalculator} to add approximately 50/60 of a degree to account for 34 archminutes of refraction and 16 archminutes
* for the sun's radius for a total of {@link AstronomicalCalculator#adjustZenith(double, double) 90.83333&deg;}. See
* documentation for the specific implementation of the {@link AstronomicalCalculator} that you are using.
* The getSunset method returns an <code>Instant</code> representing the
* {@link AstronomicalCalculator#getElevationAdjustment(double) elevation adjusted} sunset time. The zenith used for the
* calculation uses {@link GEOMETRIC_ZENITH geometric zenith} of 90&deg; plus {@link AstronomicalCalculator
* #getElevationAdjustment(double)}. This is adjusted by the {@link AstronomicalCalculator} to add approximately 50/60 of a
* degree to account for 34 archminutes of refraction and 16 archminutes for the sun's radius for a total of {@link
* AstronomicalCalculator#adjustZenith(double, double) 90.83333&deg;}. See documentation for the specific implementation of the
* {@link AstronomicalCalculator} that you are using.
* Note: In certain cases the calculates sunset will occur before sunrise. This will typically happen when a time zone other than
* the local timezone is used (calculating Los Angeles sunset using a GMT time zone for example). In this case the sunset date
* will be incremented to the following date.
Expand All @@ -206,15 +207,15 @@ public Instant getBeginAstronomicalTwilight() {
* @see getSeaLevelSunset()
* @see getUTCSunset(double)
*/
public Instant getSunset() {
double sunset = getUTCSunset(GEOMETRIC_ZENITH);
if (Double.isNaN(sunset)) {
return null;
} else {
return getInstantFromTime(sunset, SolarEvent.SUNSET);
}
}

public Instant getSunset() {
double sunset = getUTCSunset(GEOMETRIC_ZENITH);
if (Double.isNaN(sunset)) {
return null;
} else {
return getInstantFromTime(sunset, SolarEvent.SUNSET);
}
}
/**
* A method that returns the sunset without {@link AstronomicalCalculator#getElevationAdjustment(double) elevation adjustment}.
* Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light, something that is not
Expand Down
Loading
Loading