Skip to content

Commit 06bd124

Browse files
authored
ComprehensiveZmanimCalendar - Only Return Ben Ish Chai Polar zmanim when there is no rise/set
- Rename getSunsetOrWesternmostSolarAzimuth -> getPolarSunsetBenIshChai and getSunriseOrEasternmostSolarAzimuth -> getPolarSunriseBenIshChai
1 parent d061832 commit 06bd124

1 file changed

Lines changed: 33 additions & 28 deletions

File tree

‎src/main/java/com/kosherjava/zmanim/ComprehensiveZmanimCalendar.java‎

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3830,39 +3830,44 @@ public Instant getSamuchLeMinchaKetana72Minutes() {
38303830
}
38313831

38323832
/**
3833-
* {@summary A method that returns {@link #getSunsetBasedOnElevationSetting() sunset} if it occurs, or the time that the sun
3834-
* is at its westernmost position (azimuth of 270°), if sunset will not occur that day. In Polar regions (the Arctic or Antarctic
3835-
* circles), there are days of no sunrise or sunset, and there are opinions that during these periods, the day-night boundary is
3836-
* when the sun is at its westernmost position}. Sunrise in this opinion is when the sun is at {@link
3837-
* #getSunriseOrEasternmostSolarAzimuth() azimuth 90°, its easternmost position}. This is the opinion of <a href=
3838-
* "https://en.wikipedia.org/wiki/Joseph_Schwarz_(geographer)">Rabbi Yehosef Schwarz</a> in his <a href=
3839-
* "https://hebrewbooks.org/pdfpager.aspx?req=31703&pgnum=134">דברי יוסף – דרך מבוא השמש</a> and <a href=
3833+
* A method that returns sunset calculated as the the time when the sun is directly due west (azimuth 270°) in <a href=
3834+
* "https://en.wikipedia.org/wiki/Polar_regions_of_Earth">Polar regions</a> on days that there are no {@link
3835+
* #getSunsetBasedOnElevationSetting() sunset}. If there is sunset that day, a {@code null} will be returned.
3836+
* <p>In Polar regions (the <a href="https://en.wikipedia.org/wiki/Arctic">Arctic</a> or <a href=
3837+
* "https://en.wikipedia.org/wiki/Antarctic">Antarctic</a> circles), there are days of no sunrise or sunset, and there are
3838+
* <em>halachic</em> opinions that during these periods, sunset (the day-night boundary) is reached when the sun is directly due
3839+
* west (azimuth 270°). Sunrise in this opinion os when the sun is directly due eat (azimuth 90°) returned by {@link
3840+
* #getPolarSunriseBenIshChai()}. This is the opinion of <a href="https://en.wikipedia.org/wiki/Joseph_Schwarz_(geographer)">Rabbi Yehosef
3841+
* Schwarz</a> in his <a href="https://hebrewbooks.org/pdfpager.aspx?req=31703&pgnum=134">דברי יוסף – דרך מבוא השמש</a> and <a href=
38403842
* "https://hebrewbooks.org/pdfpager.aspx?req=159&pgnum=83">דברי יוסף – תשובות, שאלה ח׳</a>. This is brought down <em>lehalacha</em>
38413843
* by The <a href="https://en.wikipedia.org/wiki/Yosef_Hayyim">Ben Ish Chai</a> in the <a href=
38423844
* "https://hebrewbooks.org/pdfpager.aspx?req=1401&pgnum=461">רב פעלים – חלק ב׳, סוד ישרים ס׳ ד׳</a>. This time is close to six hours
38433845
* after {@link #getSunTransit() astronomical <em>chatzos hayom</em>}, but depending on the time of year and location in the
38443846
* Arctic / Antarctic, it can be up to 46 minutes before or after this time.
38453847
*
3846-
* @return sunset if it occurs, or the time that the sun will reach its westernmost position (azimuth 270°), if sunset will not
3847-
* occur that day. If there is no sunset this day, and the azimuth 270° will not occur, a {@code null} will be returned.
3848-
* @see #getSunriseOrEasternmostSolarAzimuth()
3848+
* @return Sunset calculated as the time the sun is directly due west (azimuth 270°) in Polar regions on days that there is no
3849+
* sunset. If there is sunrise that day, a {@code null} will be returned. While unlikely, it is theoretically possible
3850+
* for a {@code null} to be returned by the code even in Polar regions.
3851+
* @see #getPolarSunsetBenIshChai()
38493852
* @see #getTimeAtAzimuth90Or270(double)
38503853
* @see com.kosherjava.zmanim.util.AstronomicalCalculator#getTimeAtAzimuth(LocalDate, GeoLocation, double)
38513854
*/
3852-
public Instant getSunsetOrWesternmostSolarAzimuth() {
3853-
Instant sunset = getSunsetBasedOnElevationSetting();
3854-
if(sunset != null) {
3855-
return sunset;
3855+
public Instant getPolarSunsetBenIshChai() {
3856+
if(getSunsetBasedOnElevationSetting() == null) {
3857+
return getTimeAtAzimuth90Or270(270);
38563858
}
3857-
return getTimeAtAzimuth90Or270(270);
3859+
return null;
38583860
}
38593861

38603862
/**
3861-
* {@summary A method that returns {@link #getSunriseBasedOnElevationSetting() sunrise} if it occurs, or the time that the sun
3862-
* is at its easternmost position (azimuth of 90°), if sunrise will not occur that day. In Polar regions (the Arctic or Antarctic
3863-
* circles), there are days of no sunrise or sunset, and there are opinions that during these periods, the day-night boundary is
3864-
* when the sun is at its westernmost position}. Sunset in this opinion is when the sun is at {@link
3865-
* #getSunsetOrWesternmostSolarAzimuth() azimuth 270°, its westernmost position}. This is the opinion of <a href=
3863+
* A method that returns sunrise calculated as the the time when the sun is directly due east (azimuth 90°) in <a href=
3864+
* "https://en.wikipedia.org/wiki/Polar_regions_of_Earth">Polar regions</a> on days that there are no {@link
3865+
* #getSunriseBasedOnElevationSetting() sunrise}. If there is sunrise that day, a {@code null} will be returned.
3866+
* <p>In Polar regions (the <a href="https://en.wikipedia.org/wiki/Arctic">Arctic</a> or <a href=
3867+
* "https://en.wikipedia.org/wiki/Antarctic">Antarctic</a> circles), there are days of no sunrise or sunset, and there are
3868+
* <em>halachic</em> opinions that during these periods, sunrise is reached when the sun is directly due east (azimuth 90°).
3869+
* The day-night boundary (sunset) in these opinions is when the sun is directly due west (azimuth 270°) returned by
3870+
* {@link #getPolarSunriseBenIshChai()} This is the opinion of <a href=
38663871
* "https://en.wikipedia.org/wiki/Joseph_Schwarz_(geographer)">Rabbi Yehosef Schwarz</a> in his <a href=
38673872
* "https://hebrewbooks.org/pdfpager.aspx?req=31703&pgnum=134">דברי יוסף – דרך מבוא השמש</a> and <a href=
38683873
* "https://hebrewbooks.org/pdfpager.aspx?req=159&pgnum=83">דברי יוסף – תשובות, שאלה ח׳</a>. This is brought down <em>lehalacha</em>
@@ -3871,18 +3876,18 @@ public Instant getSunsetOrWesternmostSolarAzimuth() {
38713876
* before {@link #getSunTransit() astronomical <em>chatzos hayom</em>}, but depending on the time of year and location in the
38723877
* Arctic / Antarctic, it can be up to 46 minutes before or after this time.
38733878
*
3874-
* @return sunrise if it occurs, or the time that the sun will reach its easternmost position (azimuth 90°), if sunrise will not
3875-
* occur that day. If there is no sunrise this day, and the azimuth 90° will not occur, a {@code null} will be returned.
3876-
* @see #getSunsetOrWesternmostSolarAzimuth()
3879+
* @return Sunrise calculated as the easternmost solar position (azimuth 90°) in Polar regions on days that there is no rise. If
3880+
* there is sunrise that day, a {@code null} will be returned. While unlikely, it is theoretically possible for a
3881+
* {@code null} to be returned by the code even in Polar regions.
3882+
* @see #getPolarSunsetBenIshChai()
38773883
* @see #getTimeAtAzimuth90Or270(double)
38783884
* @see com.kosherjava.zmanim.util.AstronomicalCalculator#getTimeAtAzimuth(LocalDate, GeoLocation, double)
38793885
*/
3880-
public Instant getSunriseOrEasternmostSolarAzimuth() {
3881-
Instant sunrise = getSunriseBasedOnElevationSetting();
3882-
if(sunrise != null) {
3883-
return sunrise;
3886+
public Instant getPolarSunriseBenIshChai() {
3887+
if(getSunriseBasedOnElevationSetting() == null) {
3888+
return getTimeAtAzimuth90Or270(90);
38843889
}
3885-
return getTimeAtAzimuth90Or270(90);
3890+
return null;
38863891
}
38873892

38883893
/**

0 commit comments

Comments
 (0)