Repository navigation
Expand file tree
/
Copy pathComprehensiveZmanimCalendar.java
More file actions
4078 lines (3867 loc) · 266 KB
/
Copy pathComprehensiveZmanimCalendar.java
File metadata and controls
4078 lines (3867 loc) · 266 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Zmanim Java API
* Copyright (C) 2004-2026 Eliyahu Hershfeld
*
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA,
* or connect to: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
*/
package com.kosherjava.zmanim;
import java.time.Instant;
import java.time.LocalTime;
import com.kosherjava.zmanim.util.AstronomicalCalculator;
import com.kosherjava.zmanim.util.GeoLocation;
import com.kosherjava.zmanim.hebrewcalendar.JewishCalendar;
/**
* <p>This class extends ZmanimCalendar and provides many more <em>zmanim</em> than available in the ZmanimCalendar. The basis
* for most <em>zmanim</em> in this class are from the <em>sefer</em> <b><a href="https://hebrewbooks.org/9765">Yisroel
* Vehazmanim</a></b> by <b><a href="https://en.wikipedia.org/wiki/Yisroel_Dovid_Harfenes">Rabbi Yisrael Dovid Harfenes</a></b>.
* As an example of the number of different <em>zmanim</em> made available by this class, there are methods to return 18
* different calculations for <em>alos</em> (dawn), 18 for <em>plag hamincha</em> and 29 for <em>tzais</em> available in this
* API. The real power of this API is the ease in calculating <em>zmanim</em> that are not part of the library. The methods for
* <em>zmanim</em> calculations not present in this class or it's superclass {@link ZmanimCalendar} are contained in the
* {@link AstronomicalCalendar}, the base class of the calendars in our API since they are generic methods for calculating
* time based on degrees or time before or after {@link #getSunset() sunrise} and {@link #getSunset()
* sunset} and are of interest for calculation beyond <em>zmanim</em> calculations. Here are some examples.
* <p>First create the Calendar for the location you would like to calculate:
*
* <pre style="background: #FEF0C9; display: inline-block;">
* String locationName = "Lakewood, NJ";
* double latitude = 40.0828; // Lakewood, NJ
* double longitude = -74.222; // Lakewood, NJ
* double elevation = 20; // optional elevation correction in Meters
* // the String parameter in getZoneId() has to be a valid ZoneId listed in {@link java.time.ZoneId#getAvailableZoneIds()}
* ZoneId zoneId = ZoneId.of("America/New_York");
* GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, zoneId);
* ComprehensiveZmanimCalendar czc = new ComprehensiveZmanimCalendar(location);
* // Optionally set the date or it will default to today's date
* ZonedDateTime dateTime = ZonedDateTime.of(1969, Month.FEBRUARY.getValue(), 8, 0, 0, 0, 0, location.getZoneId());
* czc.setZonedDateTime(dateTime);</pre>
* <p>
* <b>Note:</b> For locations such as Israel where the beginning and end of daylight savings time can fluctuate from
* year to year, if your version of Java does not have an <a href=
* "https://www.oracle.com/java/technologies/tzdata-versions.html">up to date time zone database</a>, create a
* {@link java.util.SimpleTimeZone} with the known start and end of DST.
* To get <em>alos</em> calculated as 14° below the horizon (as calculated in the calendars published in Montreal),
* add {@link GEOMETRIC_ZENITH} (90) to the 14° offset to get the desired time:
* <br><br>
* <pre style="background: #FEF0C9; display: inline-block;">
* Instant alos14 = czc.getSunriseOffsetByDegrees({@link GEOMETRIC_ZENITH} + 14);</pre>
* <p>
* To get <em>mincha gedola</em> calculated based on the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner"
* >Magen Avraham (MGA)</a> using a <em>shaah zmanis</em> based on the day starting
* 16.1° below the horizon (and ending 16.1° after sunset) the following calculation can be used:
*
* <pre style="background: #FEF0C9; display: inline-block;">
* Instant minchaGedola = czc.getTimeOffset(czc.getAlos16point1Degrees(), czc.getShaahZmanis16Point1Degrees() * 6.5);</pre>
* <p>
* or even simpler using the included convenience methods
* <pre style="background: #FEF0C9; display: inline-block;">
* Instant minchaGedola = czc.getMinchaGedola(czc.getAlos16point1Degrees(), czc.getShaahZmanis16Point1Degrees());</pre>
* <p>
* A little more complex example would be calculating <em>zmanim</em> that rely on a <em>shaah zmanis</em> that is
* not present in this library. While a drop more complex, it is still rather easy. An example would be to calculate
* the <a href="https://en.wikipedia.org/wiki/Israel_Isserlein">Trumas Hadeshen</a>'s <em>alos</em> to
* <em>tzais</em> based <em>plag hamincha</em> as calculated in the Machzikei Hadass calendar in Manchester, England.
* A number of this calendar's <em>zmanim</em> are calculated based on a day starting at <em>alos</em> of 12° before
* sunrise and ending at <em>tzais</em> of 7.083° after sunset. Be aware that since the <em>alos</em> and <em>tzais</em>
* do not use identical degree-based offsets, this leads to <em>chatzos</em> being at a time other than the
* {@link #getSunTransit() solar transit} (solar midday). To calculate this <em>zman</em>, use the following steps. Note
* that <em>plag hamincha</em> is 10.75 hours after the start of the day, and the following steps are all that it takes.
* <br>
* <pre style="background: #FEF0C9; display: inline-block;">
* Instant plag = czc.getPlagHamincha(czc.getSunriseOffsetByDegrees({@link GEOMETRIC_ZENITH} + 12),
* czc.getSunsetOffsetByDegrees({@link GEOMETRIC_ZENITH} + ZENITH_7_POINT_083));</pre>
* <p>
* Something a drop more challenging, but still simple, would be calculating a <em>zman</em> using the same "complex"
* offset day used in the above-mentioned Manchester calendar, but for a <em>shaos zmaniyos</em> based <em>zman</em> not
* supported by this library, such as calculating the point that one should be <em>makpid</em>
* not to eat on <em>erev Shabbos</em> or <em>erev Yom Tov</em>. This is 9 <em>shaos zmaniyos</em> into the day.
* <ol>
* <li>Calculate the <em>shaah zmanis</em> in milliseconds for this day</li>
* <li>Add 9 of these <em>shaos zmaniyos</em> to <em>alos</em> starting at 12°</li>
* </ol>
* <br>
* <pre style="background: #FEF0C9; display: inline-block;">
* long shaahZmanis = czc.getTemporalHour(czc.getSunriseOffsetByDegrees({@link GEOMETRIC_ZENITH} + 12),
* czc.getSunsetOffsetByDegrees({@link GEOMETRIC_ZENITH} + ZENITH_7_POINT_083));
* Instant sofZmanAchila = getTimeOffset(czc.getSunriseOffsetByDegrees({@link GEOMETRIC_ZENITH} + 12),
* shaahZmanis * 9);</pre>
* <p>
* Calculating this <em>sof zman achila</em> according to the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a>
* is simplicity itself.
* <pre style="background: #FEF0C9; display: inline-block;">
* Instant sofZmanAchila = czc.getTimeOffset(czc.getSunrise(), czc.getShaahZmanisGRA() * 9);</pre>
*
* <h2>See documentation from the {@link ZmanimCalendar} parent class</h2>
*
* @author © Eliyahu Hershfeld 2004 - 2026
*/
public class ComprehensiveZmanimCalendar extends ZmanimCalendar {
/**
* The zenith of 3.7° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getTzaisGeonim3Point7Degrees()
*/
protected static final double ZENITH_3_POINT_7 = GEOMETRIC_ZENITH + 3.7;
/**
* The zenith of 3.8° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getTzaisGeonim3Point8Degrees()
*/
protected static final double ZENITH_3_POINT_8 = GEOMETRIC_ZENITH + 3.8;
/**
* The zenith of 5.95° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getTzaisGeonim5Point95Degrees()
*/
protected static final double ZENITH_5_POINT_95 = GEOMETRIC_ZENITH + 5.95;
/**
* The zenith of 7.083° below {@link GEOMETRIC_ZENITH geometric zenith} (90°). This is often referred to as
* 7°5' (7° and 5 minutes).
*
* @see #getTzaisGeonim7Point083Degrees()
* @see #getBainHashmashosRT13Point5MinutesBefore7Point083Degrees()
*/
protected static final double ZENITH_7_POINT_083 = GEOMETRIC_ZENITH + 7 + (5.0 / 60);
/**
* The zenith of 10.2° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getMisheyakir10Point2Degrees()
*/
protected static final double ZENITH_10_POINT_2 = GEOMETRIC_ZENITH + 10.2;
/**
* The zenith of 11° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getMisheyakir11Degrees()
*/
protected static final double ZENITH_11_DEGREES = GEOMETRIC_ZENITH + 11;
/**
* The zenith of 11.5° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getMisheyakir11Point5Degrees()
*/
protected static final double ZENITH_11_POINT_5 = GEOMETRIC_ZENITH + 11.5;
/**
* The zenith of 12.85° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getMisheyakir12Point85Degrees()
*/
protected static final double ZENITH_12_POINT_85 = GEOMETRIC_ZENITH + 12.85;
/**
* The zenith of 13.24° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getBainHashmashosRT13Point24Degrees
*/
protected static final double ZENITH_13_POINT_24 = GEOMETRIC_ZENITH + 13.24;
/**
* The zenith of 19° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getAlos19Degrees()
* @see ZENITH_19_POINT_8
*/
protected static final double ZENITH_19_DEGREES = GEOMETRIC_ZENITH + 19;
/**
* The zenith of 19.8° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getTzais19Point8Degrees()
* @see #getAlos19Point8Degrees()
* @see ZENITH_19_DEGREES
*/
protected static final double ZENITH_19_POINT_8 = GEOMETRIC_ZENITH + 19.8;
/**
* The zenith of 26° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getAlos26Degrees()
* @see #getTzais26Degrees()
* @see #getAlos120Minutes()
* @see #getTzais120Minutes()
*/
protected static final double ZENITH_26_DEGREES = GEOMETRIC_ZENITH + 26.0;
/**
* The zenith of 4.42° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getTzaisGeonim4Point42Degrees()
*/
protected static final double ZENITH_4_POINT_42 = GEOMETRIC_ZENITH + 4.42;
/**
* The zenith of 4.66° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getTzaisGeonim4Point66Degrees()
*/
protected static final double ZENITH_4_POINT_66 = GEOMETRIC_ZENITH + 4.66;
/**
* The zenith of 4.8° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getTzaisGeonim4Point8Degrees()
*/
protected static final double ZENITH_4_POINT_8 = GEOMETRIC_ZENITH + 4.8;
/**
* The zenith of 16.9° below geometric zenith (90°).
*
* @see #getAlosBaalHatanya()
*/
protected static final double ZENITH_16_POINT_9 = GEOMETRIC_ZENITH + 16.9;
/**
* The zenith of 6° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getTzaisBaalHatanya()
*/
protected static final double ZENITH_6_DEGREES = GEOMETRIC_ZENITH + 6;
/**
* The zenith of 6.45° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getTzaisGeonim6Point45Degrees()
*/
protected static final double ZENITH_6_POINT_45 = GEOMETRIC_ZENITH + 6.45;
/**
* The zenith of 7.65° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getMisheyakir7Point65Degrees()
*/
protected static final double ZENITH_7_POINT_65 = GEOMETRIC_ZENITH + 7.65;
/**
* The zenith of 7.67° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getTzaisGeonim7Point67Degrees()
*/
protected static final double ZENITH_7_POINT_67 = GEOMETRIC_ZENITH + 7.67;
/**
* The zenith of 9.3° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getTzaisGeonim9Point3Degrees()
*/
protected static final double ZENITH_9_POINT_3 = GEOMETRIC_ZENITH + 9.3;
/**
* The zenith of 9.5° below {@link GEOMETRIC_ZENITH geometric zenith} (90°).
* @see #getMisheyakir9Point5Degrees()
*/
protected static final double ZENITH_9_POINT_5 = GEOMETRIC_ZENITH + 9.5;
/**
* The zenith of 9.75° below {@link GEOMETRIC_ZENITH geometric zenith} (90°). This calculation is used for
* calculating <em>alos</em> (dawn) and <em>tzais</em> (nightfall) according to some opinions.
*
* @see #getTzaisGeonim9Point75Degrees()
*/
protected static final double ZENITH_9_POINT_75 = GEOMETRIC_ZENITH + 9.75;
/**
* The zenith of 2.1° <b>above</b> {@link GEOMETRIC_ZENITH geometric zenith} (90°). This calculation is used for
* calculating the start of <em>bain hashmashos</em> (twilight) of 13.5 minutes before sunset converted to degrees
* according to the Yereim. As is traditional with degrees below the horizon, this is calculated without refraction
* and from the center of the sun. It would be 0.833° less without this.
*
* @see #getBainHashmashosYereim2Point1Degrees()
*/
protected static final double ZENITH_MINUS_2_POINT_1 = GEOMETRIC_ZENITH - 2.1;
/**
* The zenith of 2.8° above {@link GEOMETRIC_ZENITH geometric zenith} (90°). This calculation is used for
* calculating the start of <em>bain hashmashos</em> (twilight) of 16.875 minutes before sunset converted to degrees
* according to the Yereim. As is traditional with degrees below the horizon, this is calculated without refraction
* and from the center of the sun. It would be 0.833° less without this.
*
* @see #getBainHashmashosYereim2Point8Degrees()
*/
protected static final double ZENITH_MINUS_2_POINT_8 = GEOMETRIC_ZENITH - 2.8;
/**
* The zenith of 3.05° above {@link GEOMETRIC_ZENITH geometric zenith} (90°). This calculation is used for
* calculating the start of <em>bain hashmashos</em> (twilight) of 18 minutes before sunset converted to degrees
* according to the Yereim. As is traditional with degrees below the horizon, this is calculated without refraction
* and from the center of the sun. It would be 0.833° less without this.
*
* @see #getBainHashmashosYereim3Point05Degrees()
*/
protected static final double ZENITH_MINUS_3_POINT_05 = GEOMETRIC_ZENITH - 3.05;
/**
* The offset in minutes (defaults to 40) after sunset used for <em>tzeit</em> based on calculations of
* <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah.
* @see #getTzaisAteretTorah()
* @see #getAteretTorahSunsetOffset()
* @see #setAteretTorahSunsetOffset(double)
*/
private double ateretTorahSunsetOffset = 40;
/**
* A constructor that takes a {@link GeoLocation} as a parameter.
*
* @param location
* the location
*
* @see ZmanimCalendar#ZmanimCalendar(GeoLocation)
*/
public ComprehensiveZmanimCalendar(GeoLocation location) {
super(location);
}
/**
* Default constructor will set a default {@link GeoLocation#GeoLocation()}, a default
* {@link AstronomicalCalculator#getDefault() AstronomicalCalculator} and default the calendar to the current date.
*
* @see AstronomicalCalendar#AstronomicalCalendar()
* @see ComprehensiveZmanimCalendar(GeoLocation)
*/
public ComprehensiveZmanimCalendar() {
super();
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a 19.8° dip. This calculation
* divides the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen
* Avraham (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is when the sun is 19.8°
* below the eastern geometric horizon before sunrise. Dusk for this is when the sun is 19.8° below the western
* geometric horizon after sunset. This day is split into 12 equal parts with each part being a <em>shaah zmanis</em>.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
* such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
* where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
* will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
public long getShaahZmanis19Point8Degrees() {
return getTemporalHour(getAlos19Point8Degrees(), getTzais19Point8Degrees());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a 18° dip. This calculation divides
* the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham
* (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is when the sun is 18° below the
* eastern geometric horizon before sunrise. Dusk for this is when the sun is 18° below the western geometric
* horizon after sunset. This day is split into 12 equal parts with each part being a <em>shaah zmanis</em>.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
* such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
* where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
* will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
public long getShaahZmanis18Degrees() {
return getTemporalHour(getAlos18Degrees(), getTzais18Degrees());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a dip of 26°. This calculation
* divides the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen
* Avraham (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is when the sun is
* {@link #getAlos26Degrees() 26°} below the eastern geometric horizon before sunrise. Dusk for this is when
* the sun is {@link #getTzais26Degrees() 26°} below the western geometric horizon after sunset. This day is
* split into 12 equal parts with each part being a <em>shaah zmanis</em>. Since <em>zmanim</em> that use this
* method are extremely late or early and at a point when the sky is a long time past the 18° point where the
* darkest point is reached, <em>zmanim</em> that use this should only be used <em>lechumra</em>, such as
* delaying the start of nighttime <em>mitzvos</em>.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
* such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
* where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
* will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
* @see #getShaahZmanis120Minutes()
*/
public long getShaahZmanis26Degrees() {
return getTemporalHour(getAlos26Degrees(), getTzais26Degrees());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a dip of 16.1°. This calculation
* divides the day based on the opinion that the day runs from dawn to dusk. Dawn for this calculation is when the
* sun is 16.1° below the eastern geometric horizon before sunrise and dusk is when the sun is 16.1° below
* the western geometric horizon after sunset. This day is split into 12 equal parts with each part being a
* <em>shaah zmanis</em>.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. If the calculation can't be computed
* such as northern and southern locations even south of the Arctic Circle and north of the Antarctic Circle
* where the sun may not reach low enough below the horizon for this calculation, a {@link Long#MIN_VALUE}
* will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*
* @see #getAlos16Point1Degrees()
* @see #getTzais16Point1Degrees()
* @see #getSofZmanShmaMGA16Point1Degrees()
* @see #getSofZmanTfilaMGA16Point1Degrees()
* @see #getMinchaGedola16Point1Degrees()
* @see #getMinchaKetana16Point1Degrees()
* @see #getPlagHamincha16Point1Degrees()
*/
public long getShaahZmanis16Point1Degrees() {
return getTemporalHour(getAlos16Point1Degrees(), getTzais16Point1Degrees());
}
/**
* Method to return a <em>shaah zmanis</em> (solar hour) according to the opinion of the <a href=
* "https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a>. This calculation
* divides the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is
* 60 minutes before sunrise and dusk is 60 minutes after sunset. This day is split into 12 equal parts with each
* part being a <em>shaah zmanis</em>. Alternate methods of calculating a <em>shaah zmanis</em> are available in the
* subclass {@link ComprehensiveZmanimCalendar}.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. 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 {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*
* @see #getAlos60Minutes()
* @see #getTzais60Minutes()
* @see #getPlagHamincha60Minutes()
*/
public long getShaahZmanis60Minutes() {
return getTemporalHour(getAlos60Minutes(), getTzais60Minutes());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) according to the opinion of the <a href=
* "https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em> being
* {@link #getAlos72Zmanis() 72} minutes <em>zmaniyos</em> before {@link #getSunset() sunrise}. This calculation
* divides the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation
* is 72 minutes <em>zmaniyos</em> before sunrise and dusk is 72 minutes <em>zmaniyos</em> after sunset. This day
* is split into 12 equal parts with each part being a <em>shaah zmanis</em>. This is identical to 1/10th of the day
* from {@link #getSunset() sunrise} to {@link #getSunset() sunset}.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. 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 {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
* @see #getAlos72Zmanis()
* @see #getTzais72Zmanis()
*/
public long getShaahZmanis72MinutesZmanis() {
return getTemporalHour(getAlos72Zmanis(), getTzais72Zmanis());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a dip of 90 minutes. This calculation
* divides the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen
* Avraham (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is 90 minutes before sunrise
* and dusk is 90 minutes after sunset. This day is split into 12 equal parts with each part being a <em>shaah zmanis</em>.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. 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 {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
public long getShaahZmanis90Minutes() {
return getTemporalHour(getAlos90Minutes(), getTzais90Minutes());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) according to the opinion of the <a href=
* "https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em> being {@link
* #getAlos90Zmanis() 90} minutes <em>zmaniyos</em> before {@link #getSunset() sunrise}. This calculation divides
* the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is 90 minutes
* <em>zmaniyos</em> before sunrise and dusk is 90 minutes <em>zmaniyos</em> after sunset. This day is split into 12 equal
* parts with each part being a <em>shaah zmanis</em>. This is 1/8th of the day from {@link #getSunset() sunrise}
* to {@link #getSunset() sunset}.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. 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 {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
* @see #getAlos90Zmanis()
* @see #getTzais90Zmanis()
*/
public long getShaahZmanis90MinutesZmanis() {
return getTemporalHour(getAlos90Zmanis(), getTzais90Zmanis());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) according to the opinion of the <a href=
* "https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em> being {@link
* #getAlos96Zmanis() 96} minutes <em>zmaniyos</em> before {@link #getSunset() sunrise}. This calculation divides
* the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is 96 minutes
* <em>zmaniyos</em> before sunrise and dusk is 96 minutes <em>zmaniyos</em> after sunset. This day is split into 12 equal
* parts with each part being a <em>shaah zmanis</em>. This is identical to 1/7.5th of the day from {@link
* #getSunset() sunrise} to {@link #getSunset() sunset}.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. 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 {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
* @see #getAlos96Zmanis()
* @see #getTzais96Zmanis()
*/
public long getShaahZmanis96MinutesZmanis() {
return getTemporalHour(getAlos96Zmanis(), getTzais96Zmanis());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) according to the opinion of the
* <em>Chacham</em> Yosef Harari-Raful of Yeshivat Ateret Torah calculated with <em>alos</em> being 1/10th
* of sunrise to sunset day, or {@link #getAlos72Zmanis() 72} minutes <em>zmaniyos</em> of such a day before
* {@link #getSunset() sunrise}, and <em>tzais</em> is usually calculated as {@link #getTzaisAteretTorah() 40
* minutes} (configurable to any offset via {@link #setAteretTorahSunsetOffset(double)}) after {@link #getSunset()
* sunset}. This day is split into 12 equal parts with each part being a <em>shaah zmanis</em>. Note that with this
* system, <em>chatzos</em> (midday) will not be the point that the sun is {@link #getSunTransit() halfway across
* the sky}.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. 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 {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
* @see #getAlos72Zmanis()
* @see #getTzaisAteretTorah()
* @see #getAteretTorahSunsetOffset()
* @see #setAteretTorahSunsetOffset(double)
*/
public long getShaahZmanisAteretTorah() {
return getTemporalHour(getAlos72Zmanis(), getTzaisAteretTorah());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) used by some <em>zmanim</em> according to the opinion of
* <a href="https://en.wikipedia.org/wiki/Yaakov_Moshe_Hillel">Rabbi Yaakov Moshe Hillel</a> as published in the
* <em>luach</em> of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that is based on a day starting 72 minutes before
* sunrise in degrees {@link #getAlos16Point1Degrees() <em>alos</em> 16.1°} and ending 14 minutes after sunset in
* degrees {@link #getTzaisGeonim3Point8Degrees() <em>tzais</em> 3.8°}. This day is split into 12 equal parts with
* each part being a <em>shaah zmanis</em>. Note that with this system, <em>chatzos</em> (midday) will not be the point
* that the sun is {@link #getSunTransit() halfway across the sky}. These <em>shaos zmaniyos</em> are used for <em>Mincha
* Ketana</em> and <em>Plag Hamincha</em>. The 14 minutes are based on 3/4 of an 18 minute <a href=
* "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement" >mil</a>, with half a minute added for
* Rav Yosi.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. 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 {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*
* @see #getMinchaKetanaAhavatShalom()
* @see #getPlagAhavatShalom()
*/
public long getShaahZmanisAlos16Point1ToTzais3Point8() {
return getTemporalHour(getAlos16Point1Degrees(), getTzaisGeonim3Point8Degrees());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) used by some <em>zmanim</em> according to the opinion of
* <a href="https://en.wikipedia.org/wiki/Yaakov_Moshe_Hillel">Rabbi Yaakov Moshe Hillel</a> as published in the
* <em>luach</em> of the Bais Horaah of Yeshivat Chevrat Ahavat Shalom that is based on a day starting 72 minutes before
* sunrise in degrees {@link #getAlos16Point1Degrees() <em>alos</em> 16.1°} and ending 13.5 minutes after sunset in
* degrees {@link #getTzaisGeonim3Point7Degrees() <em>tzais</em> 3.7°}. This day is split into 12 equal parts with
* each part being a <em>shaah zmanis</em>. Note that with this system, <em>chatzos</em> (midday) will not be the point
* that the sun is {@link #getSunTransit() halfway across the sky}. These <em>shaos zmaniyos</em> are used for <em>Mincha
* Gedola</em> calculation.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. 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 {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*
* @see #getMinchaGedolaAhavatShalom()
*/
public long getShaahZmanisAlos16Point1ToTzais3Point7() {
return getTemporalHour(getAlos16Point1Degrees(), getTzaisGeonim3Point7Degrees());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a dip of 96 minutes. This calculation
* divides the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen
* Avraham (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is 96 minutes before sunrise
* and dusk is 96 minutes after sunset. This day is split into 12 equal parts with each part being a <em>shaah
* zmanis</em>.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. 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 {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
public long getShaahZmanis96Minutes() {
return getTemporalHour(getAlos96Minutes(), getTzais96Minutes());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) calculated using a dip of 120 minutes. This calculation
* divides the day based on the opinion of the <a href="https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen
* Avraham (MGA)</a> that the day runs from dawn to dusk. Dawn for this calculation is 120 minutes before sunrise and
* dusk is 120 minutes after sunset. This day is split into 12 equal parts with each part being a <em>shaah zmanis</em>.
* Since <em>zmanim</em> that use this method are extremely late or early and at a point when the sky is a long time
* past the 18° point where the darkest point is reached, <em>zmanim</em> that use this should only be used
* <em>lechumra</em> only, such as delaying the start of nighttime <em>mitzvos</em>.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. 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 {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
* @see #getShaahZmanis26Degrees()
*/
public long getShaahZmanis120Minutes() {
return getTemporalHour(getAlos120Minutes(), getTzais120Minutes());
}
/**
* Method to return a <em>shaah zmanis</em> (temporal hour) according to the opinion of the <a href=
* "https://en.wikipedia.org/wiki/Avraham_Gombiner">Magen Avraham (MGA)</a> based on <em>alos</em> being {@link
* #getAlos120Zmanis() 120} minutes <em>zmaniyos</em> before {@link #getSunset() sunrise}. This calculation divides
* the day based on the opinion of the MGA that the day runs from dawn to dusk. Dawn for this calculation is 120 minutes
* <em>zmaniyos</em> before sunrise and dusk is 120 minutes <em>zmaniyos</em> after sunset. This day is split into 12 equal
* parts with each part being a <em>shaah zmanis</em>. This is identical to 1/6th of the day from {@link
* #getSunset() sunrise} to {@link #getSunset() sunset}. Since <em>zmanim</em> that use this method are
* extremely late or early and at a point when the sky is a long time past the 18° point where the darkest point is reached,
* <em>zmanim</em> that use this should only be used <em>lechumra</em> such as delaying the start of nighttime <em>mitzvos</em>.
*
* @return the <code>long</code> millisecond length of a <em>shaah zmanis</em>. 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 {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
* @see #getAlos120Zmanis()
* @see #getTzais120Zmanis()
*/
public long getShaahZmanis120MinutesZmanis() {
return getTemporalHour(getAlos120Zmanis(), getTzais120Zmanis());
}
/**
* This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> based on sunrise
* being 120 minutes <em>zmaniyos</em> or 1/6th of the day before sunrise. This is calculated as 10.75 hours after
* {@link #getAlos120Zmanis() dawn}. The formula used is 10.75 * {@link #getShaahZmanis120MinutesZmanis()} after
* {@link #getAlos120Zmanis() dawn}. Since the <em>zman</em> based on an extremely early <em>alos</em> and a very
* late <em>tzais</em>, it should only be used <em>lechumra</em>.
*
* @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
* <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
* current plan to remove this method from the API, and this deprecation is intended to alert developers
* of the danger of using it.
*
* @return the <code>Instant</code> of the time of <em>plag hamincha</em>. 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 <code>null</code> will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*
* @see #getShaahZmanis120MinutesZmanis()
* @see #getAlos120Minutes()
* @see #getTzais120Minutes()
* @see #getPlagHamincha26Degrees()
* @see #getPlagHamincha120Minutes()
*/
@Deprecated (forRemoval=false)
public Instant getPlagHamincha120MinutesZmanis() {
return getPlagHamincha(getAlos120Zmanis(), getTzais120Zmanis(), true);
}
/**
* This method should be used <em>lechumra</em> only and returns the time of <em>plag hamincha</em> according to the
* Magen Avraham with the day starting 120 minutes before sunrise and ending 120 minutes after sunset. This is
* calculated as 10.75 hours after {@link #getAlos120Minutes() dawn 120 minutes}. The formula used is 10.75 {@link
* #getShaahZmanis120Minutes()} after {@link #getAlos120Minutes()}. Since the <em>zman</em> based on an extremely early
* <em>alos</em> and a very late <em>tzais</em>, it should only be used <em>lechumra</em>.
*
* @deprecated This method should be used <em>lechumra</em> only since it returns a very late time (often after
* <em>shkiah</em>), and if used <em>lekula</em> can result in <em>chillul Shabbos</em> etc. There is no
* current plan to remove this method from the API, and this deprecation is intended to alert developers
* of the danger of using it.
*
* @return the <code>Instant</code> of the time of <em>plag hamincha</em>. 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 <code>null</code> will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*
* @see #getShaahZmanis120Minutes()
* @see #getPlagHamincha26Degrees()
*/
@Deprecated (forRemoval=false)
public Instant getPlagHamincha120Minutes() {
return getPlagHamincha(getAlos120Minutes(), getTzais120Minutes(), true);
}
/**
* Method to return <em>alos</em> (dawn) calculated as 60 minutes before {@link #getSunset() sunrise} or
* {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()} setting). This is the
* time to walk the distance of 4 <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement"
* >mil</a> at 15 minutes a mil. This seems to be the opinion of the <a href="https://en.wikipedia.org/wiki/Yair_Bacharach"
* >Chavas Yair</a> in the Mekor Chaim, Orach Chaim Ch. 90, though the Mekor Chaim in Ch. 58 and in the <a href=
* "https://hebrewbooks.org/pdfpager.aspx?req=45193&pgnum=214">Chut Hashani Ch. 97</a> states that a person walks 3 and a
* 1/3 mil in an hour, or an 18-minute mil. Also see the <a href=
* "https://he.wikipedia.org/wiki/%D7%9E%D7%9C%D7%9B%D7%99%D7%90%D7%9C_%D7%A6%D7%91%D7%99_%D7%98%D7%A0%D7%A0%D7%91%D7%95%D7%99%D7%9D"
* >Divrei Malkiel</a> <a href="https://hebrewbooks.org/pdfpager.aspx?req=803&pgnum=33">Vol. 4, Ch. 20, page 34</a>) who mentions the
* 15 minute mil <em>lechumra</em> by baking matzos. Also see the <a href="https://en.wikipedia.org/wiki/Joseph_Colon_Trabotto"
* >Maharik</a> <a href="https://hebrewbooks.org/pdfpager.aspx?req=1142&pgnum=216">Ch. 173</a> where the questioner quoting
* the <a href="https://en.wikipedia.org/wiki/Eliezer_ben_Nathan">Ra'avan</a> is of the opinion that the time to walk a mil is
* 15 minutes (5 mil in a little over an hour). There are many who believe that there is a <em>ta'us sofer</em> (scribe's
* error) in the Ra'avan, and it should 4 mil in a little over an hour, or an 18-minute mil. Time based offset calculations are
* based on the opinion of the <em><a href="https://en.wikipedia.org/wiki/Rishonim">Rishonim</a></em> who stated that the time
* of the <em>neshef</em> (time between dawn and sunrise) does not vary by the time of year or location but purely depends on
* the time it takes to walk the distance of 4* mil. {@link #getTzaisGeonim9Point75Degrees()} is a related <em>zman</em> that
* is a degree-based calculation based on 60 minutes.
*
* @return the <code>Instant</code> representing the 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 <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}.
* documentation.
*
* @see #getTzais60Minutes()
* @see #getPlagHamincha60Minutes()
* @see #getShaahZmanis60Minutes()
*/
public Instant getAlos60Minutes() {
return getTimeOffset(getSunriseBasedOnElevationSetting(), -60 * MINUTE_MILLIS);
}
/**
* Method to return <em>alos</em> (dawn) calculated using 72 minutes <em>zmaniyos</em> or 1/10th of the day before
* sunrise. This is based on an 18-minute <a href=
* "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> so the time for 4 mil is
* 72 minutes which is 1/10th of a day (12 * 60 = 720) based on the day being from {@link #getSeaLevelSunrise() sea
* level sunrise} to {@link #getSeaLevelSunset() sea level sunset} or {@link #getSunset() sunrise} to {@link
* #getSunset() sunset} (depending on the {@link #isUseElevation()} setting). The actual calculation is {@link
* #getSunriseBasedOnElevationSetting()} - ({@link #getShaahZmanisGRA()} * 1.2). This calculation is used in the calendars
* published by the <a href="https://en.wikipedia.org/wiki/Central_Rabbinical_Congress">Hisachdus Harabanim D'Artzos Habris
* Ve'Canada</a>.
*
* @return the <code>Instant</code> representing the 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 <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
* @see #getShaahZmanisGRA()
*/
public Instant getAlos72Zmanis() {
return getZmanisBasedOffset(-1.2);
}
/**
* Method to return <em>alos</em> (dawn) calculated using 96 minutes before {@link #getSunset() sunrise} or
* {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()} setting) that is based
* on the time to walk the distance of 4 <a href=
* "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> at 24 minutes a mil.
* Time based offset calculations for <em>alos</em> are based on the opinion of the <em><a href=
* "https://en.wikipedia.org/wiki/Rishonim">Rishonim</a></em> who stated that the time of the <em>Neshef</em> (time between
* dawn and sunrise) does not vary by the time of year or location but purely depends on the time it takes to walk the
* distance of 4 mil.
*
* @return the <code>Instant</code> representing the 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 <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
*/
public Instant getAlos96Minutes() {
return getTimeOffset(getSunriseBasedOnElevationSetting(), -96 * MINUTE_MILLIS);
}
/**
* Method to return <em>alos</em> (dawn) calculated using 90 minutes <em>zmaniyos</em> or 1/8th of the day before
* {@link #getSunset() sunrise} or {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link
* #isUseElevation()} setting). This is based on a 22.5-minute <a href=
* "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> so the time for 4 mil is 90 minutes
* which is 1/8th of a day (12 * 60) / 8 = 90. The day is calculated from {@link #getSeaLevelSunrise() sea level sunrise}
* to {@link #getSeaLevelSunset() sea level sunset} or {@link #getSunset() sunrise} to {@link
* #getSunset() sunset} (depending on the {@link #isUseElevation()}. The actual calculation used is
* {@link #getSunriseBasedOnElevationSetting()} - ({@link #getShaahZmanisGRA()} * 1.5).
*
* @return the <code>Instant</code> representing the 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 <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
* @see #getShaahZmanisGRA()
*/
public Instant getAlos90Zmanis() {
return getZmanisBasedOffset(-1.5);
}
/**
* This method returns <em>alos</em> (dawn) calculated using 96 minutes <em>zmaniyos</em> or 1/7.5th of the day before
* {@link #getSunset() sunrise} or {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link
* #isUseElevation()} setting). This is based on a 24-minute <a href=
* "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> so the time for 4 mil is 96 minutes
* which is 1/7.5th of a day (12 * 60 / 7.5 = 96). The day is calculated from {@link #getSeaLevelSunrise() sea level sunrise}
* to {@link #getSeaLevelSunset() sea level sunset} or {@link #getSunset() sunrise} to {@link
* getSunset() sunset} (depending on the {@link #isUseElevation()}. The actual calculation used is {@link
* getSunriseBasedOnElevationSetting()} - ({@link #getShaahZmanisGRA()} * 1.6).
*
* @return the <code>Instant</code> representing the 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 <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
* @see #getShaahZmanisGRA()
*/
public Instant getAlos96Zmanis() {
return getZmanisBasedOffset(-1.6);
}
/**
* Method to return <em>alos</em> (dawn) calculated using 90 minutes before {@link #getSunset() sunrise} or
* {@link #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()} setting) based on the time
* to walk the distance of 4 <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> at
* 22.5 minutes a mil. Time-based offset calculations for <em>alos</em> are based on the opinion of the <em><a href=
* "https://en.wikipedia.org/wiki/Rishonim">Rishonim</a></em> who stated that the time of the <em>Neshef</em> (time between
* dawn and sunrise) does not vary by the time of year or location but purely depends on the time it takes to walk the
* distance of 4 mil.
*
* @return the <code>Instant</code> representing the 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 <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
*/
public Instant getAlos90Minutes() {
return getTimeOffset(getSunriseBasedOnElevationSetting(), -90 * MINUTE_MILLIS);
}
/**
* This method should be used <em>lechumra</em> only and returns <em>alos</em> (dawn) calculated using 120 minutes
* before {@link #getSunset() sunrise} or {@link #getSeaLevelSunrise() sea level sunrise} (depending on the
* {@link #isUseElevation()} setting) based on the time to walk the distance of 5 <a href=
* "https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> (<em>Ula</em>) at 24 minutes a
* mil. Time based offset calculations for <em>alos</em> are based on the* opinion of the <em><a href=
* "https://en.wikipedia.org/wiki/Rishonim">Rishonim</a></em> who stated that the time of the <em>neshef</em> (time
* between dawn and sunrise) does not vary by the time of year or location but purely depends on the time it takes to
* walk the distance of 5 mil (<em>Ula</em>). Since this time is extremely early, it should only be used <em>lechumra</em>,
* such as not eating after this time on a fast day, and not as the start time for <em>mitzvos</em> that can only be
* performed during the day.
*
* @deprecated This method should be used <em>lechumra</em> only (such as stopping to eat at this time on a fast day),
* since it returns a very early time, and if used <em>lekula</em> can result in doing <em>mitzvos hayom</em>
* too early according to most opinions. There is no current plan to remove this method from the API, and this
* deprecation is intended to alert developers of the danger of using it.
*
* @return the <code>Instant</code> representing the 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 <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
*
* @see #getTzais120Minutes()
* @see #getAlos26Degrees()
*/
@Deprecated (forRemoval=false)
public Instant getAlos120Minutes() {
return getTimeOffset(getSunriseBasedOnElevationSetting(), -120 * MINUTE_MILLIS);
}
/**
* This method should be used <em>lechumra</em> only and method returns <em>alos</em> (dawn) calculated using
* 120 minutes <em>zmaniyos</em> or 1/6th of the day before {@link #getSunset() sunrise} or {@link
* #getSeaLevelSunrise() sea level sunrise} (depending on the {@link #isUseElevation()} setting). This is based
* on a 24-minute <a href="https://en.wikipedia.org/wiki/Biblical_and_Talmudic_units_of_measurement">mil</a> so
* the time for 5 mil is 120 minutes which is 1/6th of a day (12 * 60 / 6 = 120). The day is calculated from
* {@link #getSeaLevelSunrise() sea level sunrise} to {@link #getSeaLevelSunset() sea level sunset} or {@link
* #getSunset() sunrise} to {@link #getSunset() sunset} (depending on the {@link
* #isUseElevation()}. The actual calculation used is {@link #getSunset()} - ({@link #getShaahZmanisGRA()}
* * 2). Since this time is extremely early, it should only be used <em>lechumra</em>, such as not eating after this time
* on a fast day, and not as the start time for <em>mitzvos</em> that can only be performed during the day.
*
* @deprecated This method should be used <em>lechumra</em> only (such as stopping to eat at this time on a fast day),
* since it returns a very early time, and if used <em>lekula</em> can result in doing <em>mitzvos hayom</em>
* too early according to most opinions. There is no current plan to remove this method from the API, and this
* deprecation is intended to alert developers of the danger of using it.
*
* @return the <code>Instant</code> representing the 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 <code>null</code> will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
* @see #getAlos120Minutes()
* @see #getAlos26Degrees()
*/
@Deprecated (forRemoval=false)
public Instant getAlos120Zmanis() {
return getZmanisBasedOffset(-2.0);
}
/**
* This method should be used <em>lechumra</em> only and returns <em>alos</em> (dawn) calculated when the sun is {@link
* ZENITH_26_DEGREES 26°} below the eastern geometric horizon before sunrise. This calculation is based on the same
* calculation of {@link #getAlos120Minutes() 120 minutes} but uses a degree-based calculation instead of 120 exact minutes.
* This calculation is based on the position of the sun 120 minutes before sunrise in Jerusalem <a href=
* "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, which
* calculates to 26° below {@link GEOMETRIC_ZENITH geometric zenith}. Since this time is extremely early, it should
* only be used <em>lechumra</em> only, such as not eating after this time on a fast day, and not as the start time for
* <em>mitzvos</em> that can only be performed during the day.
*
* @deprecated This method should be used <em>lechumra</em> only (such as stopping to eat at this time on a fast day),
* since it returns a very early time, and if used <em>lekula</em> can result in doing <em>mitzvos hayom</em>
* too early according to most opinions. There is no current plan to remove this method from the API, and this
* deprecation is intended to alert developers of the danger of using it.
*
* @return the <code>Instant</code> representing <em>alos</em>. If the calculation can't be computed such as northern
* and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
* may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
* detailed explanation on top of the {@link AstronomicalCalendar} documentation.
* @see #getAlos120Minutes()
* @see #getTzais120Minutes()
* @see #getTzais26Degrees()
*/
@Deprecated (forRemoval=false)
public Instant getAlos26Degrees() {
return getSunriseOffsetByDegrees(ZENITH_26_DEGREES);
}
/**
* A method to return <em>alos</em> (dawn) calculated when the sun is {@link ASTRONOMICAL_ZENITH 18°} below the
* eastern geometric horizon before sunrise.
*
* @return the <code>Instant</code> representing <em>alos</em>. If the calculation can't be computed such as northern
* and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
* may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
* See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
* @see ASTRONOMICAL_ZENITH
*/
public Instant getAlos18Degrees() {
return getSunriseOffsetByDegrees(ASTRONOMICAL_ZENITH);
}
/**
* A method to return <em>alos</em> (dawn) calculated when the sun is {@link ZENITH_19_DEGREES 19°} below the
* eastern geometric horizon before sunrise. This is the <a href="https://en.wikipedia.org/wiki/Maimonides"
* >Rambam</a>'s <em>alos</em> according to Rabbi Moshe Kosower's <a href=
* "https://www.worldcat.org/oclc/145454098">Maaglei Tzedek</a>, page 88, <a href=
* "https://hebrewbooks.org/pdfpager.aspx?req=33464&pgnum=13">Ayeles Hashachar Vol. I, page 12</a>, <a href=
* "https://hebrewbooks.org/pdfpager.aspx?req=55960&pgnum=258">Yom Valayla Shel Torah, Ch. 34, p. 222</a> and
* Rabbi Yaakov Shakow's <a href="https://www.worldcat.org/oclc/1043573513">Luach Ikvei Hayom</a>.
*
* @return the <code>Instant</code> representing <em>alos</em>. If the calculation can't be computed such as northern
* and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
* may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned.
* See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
public Instant getAlos19Degrees() {
return getSunriseOffsetByDegrees(ZENITH_19_DEGREES);
}
/**
* Method to return <em>alos</em> (dawn) calculated when the sun is {@link ZENITH_19_POINT_8 19.8°} below the
* eastern geometric horizon before sunrise. This calculation is based on the same calculation of
* {@link #getAlos90Minutes() 90 minutes} before sunrise, but uses a degree-based calculation instead of 90 exact minutes.
* This calculation is based on the position of the sun 90 minutes before sunrise in Jerusalem <a href=
* "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>, which
* calculates to 19.8° below {@link GEOMETRIC_ZENITH geometric zenith}.
*
* @return the <code>Instant</code> representing <em>alos</em>. If the calculation can't be computed such as northern
* and southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun
* may not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
* detailed explanation on top of the {@link AstronomicalCalendar} documentation.
* @see #getAlos90Minutes()
* @see #getTzais19Point8Degrees()
*/
public Instant getAlos19Point8Degrees() {
return getSunriseOffsetByDegrees(ZENITH_19_POINT_8);
}
/**
* This method returns <em>misheyakir</em> based on the position of the sun {@link ZENITH_12_POINT_85 12.85°}
* below {@link GEOMETRIC_ZENITH geometric zenith} (90°). This is based on the position of the sun slightly
* later than 57 minutes before {@link #getSunset() sunrise} in Jerusalem <a href=
* "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>. This
* <em>zman</em> is mentioned for use <b><em>bish'as hadchak</em></b> in the Birur Halacha <a href=
* "https://hebrewbooks.org/pdfpager.aspx?req=50535&st=&pgnum=88">Tinyana</a> and <a href=
* "https://hebrewbooks.org/pdfpager.aspx?req=50537&st=&pgnum=31">Tlisa'ah</a> in Orach Chaim siman 18 as 12.85°.
* Actual calculations show it to be slightly more than 12.9°, but the Birur Halacha indicates that 12.85° is a
* slight <em>chumra</em> (on a <em>bedieved</em> time) VS the 12.9° that 57 minutes calculates as (a difference of
* about 14 seconds at the equinox/equilux in Jerusalem). The <em>zman</em> of 12.9° is also mentioned in the Piskei
* Tshuvos siman 18, page 190 (where a typo indicates that this is the degree equivalent to 60 minutes before sunrise,
* when in fact at that point the sun is about 13.5° below the horizon). The 57 minute based time is mentioned by the
* Minchas Yitzchak <a href="https://hebrewbooks.org/pdfpager.aspx?req=1601&st=&pgnum=21">vol. 9, siman 9</a> as 15 minutes
* before <em>alos hashachar</em> (though he is not clear what location he refers to, and does not mention a degree-based
* conversion). The Kaf Hachaim <a href="https://hebrewbooks.org/pdfpager.aspx?req=8140&st=&pgnum=81">vol.1 siman 18, no.
* 18</a> states that in Yerushalayim 60 fixed minutes are used year round. Calculations show that 60 fixed minutes in
* Yerushalayim ranges from 13.5° at the spring equinox to 11.5° at the summer solstice. 57-minute
* <em>misheyakir</em> range from 12.9° at the winter equinox to 11° at the summer solstice.
* Analysis of the difference between 12.85° and 12.9°, shows that the maximum difference occurs at the summer
* solstice. In Lakewood, NJ at a latitude of 40.096°, the maximum difference throughout the year is 23 seconds.
* In the winter where there is the greatest need for very early <em>misheyakir</em> times, the difference is in the 16
* second range. Going north to Montreal at latitude 45.5°, the maximum is 29 seconds and is about 18 seconds in the
* winter. Moving farther north to the latitude of Vilnius at a latitude of 54.68°, things change. Firstly, around the
* summer solstice it will not reach that far below the horizon. On the dates that both can be calculated, the maximum
* difference can be pretty high on one or two days of the year (around Jul 8), with about a week having over a two minute
* difference between the two. Even at the latitude of Vilna, from Dec - March, the difference is about 22 seconds.
*
* @deprecated This method returns a very early <em>misheyakir</em> time that should only be used <b><em>bish'as
* hadchak</em></b>. <em>Lechatchila</em>, a later <em>zman</em> should be used. There is no current plan to remove
* this method from the API, and this deprecation is intended to notify developers to add an alert to users of
* the risk of using it.
*
* @return The <code>Instant</code> of <em>misheyakir</em>. If the calculation can't be computed such as northern and
* southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
* not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
* detailed explanation on top of the {@link AstronomicalCalendar} documentation.
* @see ZENITH_12_POINT_85
*/
@Deprecated (forRemoval=false)
public Instant getMisheyakir12Point85Degrees() {
return getSunriseOffsetByDegrees(ZENITH_12_POINT_85);
}
/**
* This method returns <em>misheyakir</em> based on the position of the sun when it is {@link ZENITH_11_DEGREES
* 11.5°} below {@link GEOMETRIC_ZENITH geometric zenith} (90°). This calculation is used for calculating
* <em>misheyakir</em> according to some opinions. This calculation is based on the position of the sun 52 minutes
* before {@link #getSunset() sunrise} in Jerusalem <a href=
* "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a>,
* which calculates to 11.5° below {@link GEOMETRIC_ZENITH geometric zenith}.
* @todo recalculate.
*
* @return the <code>Instant</code> of <em>misheyakir</em>. If the calculation can't be computed such as northern and
* southern locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may
* not reach low enough below the horizon for this calculation, a <code>null</code> will be returned. See
* detailed explanation on top of the {@link AstronomicalCalendar} documentation.