@hebcal/noaa 0.8.3 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,715 @@
1
+ import { Temporal } from 'temporal-polyfill';
2
+ /**
3
+ * A class that contains location information such as latitude and longitude required for astronomical calculations. The
4
+ * elevation field may not be used by some calculation engines and would be ignored if set. Check the documentation for
5
+ * specific implementations of the {@link AstronomicalCalculator} to see if elevation is calculated as part of the
6
+ * algorithm.
7
+ *
8
+ * @author © Eliyahu Hershfeld 2004 - 2016
9
+ * @version 1.1
10
+ */
11
+ export declare class GeoLocation {
12
+ /**
13
+ * @see #getLatitude()
14
+ * @see #setLatitude(double)
15
+ * @see #setLatitude(int, int, double, String)
16
+ */
17
+ private latitude;
18
+ /**
19
+ * @see #getLongitude()
20
+ * @see #setLongitude(double)
21
+ * @see #setLongitude(int, int, double, String)
22
+ */
23
+ private longitude;
24
+ /**
25
+ * @see #getLocationName()
26
+ * @see #setLocationName(String)
27
+ */
28
+ private locationName;
29
+ /**
30
+ * @see #getTimeZone()
31
+ * @see #setTimeZone(TimeZone)
32
+ */
33
+ private timeZoneId;
34
+ /**
35
+ * @see #getElevation()
36
+ * @see #setElevation(double)
37
+ */
38
+ private elevation;
39
+ /**
40
+ * Method to get the elevation in Meters.
41
+ *
42
+ * @return Returns the elevation in Meters.
43
+ */
44
+ getElevation(): number;
45
+ /**
46
+ * Method to set the elevation in Meters <b>above </b> sea level.
47
+ *
48
+ * @param elevation
49
+ * The elevation to set in Meters. An IllegalArgumentException will be thrown if the value is a negative.
50
+ */
51
+ setElevation(elevation: number): void;
52
+ /**
53
+ * GeoLocation constructor with parameters for all required fields.
54
+ *
55
+ * @param name
56
+ * The location name for display use such as &quot;Lakewood, NJ&quot;
57
+ * @param latitude
58
+ * the latitude in a double format such as 40.095965 for Lakewood, NJ.
59
+ * <b>Note: </b> For latitudes south of the equator, a negative value should be used.
60
+ * @param longitude
61
+ * double the longitude in a double format such as -74.222130 for Lakewood, NJ.
62
+ * <b>Note: </b> For longitudes east of the <a href="http://en.wikipedia.org/wiki/Prime_Meridian">Prime
63
+ * Meridian </a> (Greenwich), a negative value should be used.
64
+ * @param elevation
65
+ * the elevation above sea level in Meters. Elevation is not used in most algorithms used for calculating
66
+ * sunrise and set.
67
+ * @param timeZoneId
68
+ * the <code>TimeZone</code> for the location.
69
+ */
70
+ constructor(name: string | null, latitude: number, longitude: number, elevation: number, timeZoneId?: string);
71
+ constructor(name: string | null, latitude: number, longitude: number, timeZoneId: string);
72
+ constructor();
73
+ setLatitude(latitude: number): void;
74
+ /**
75
+ * @return Returns the latitude.
76
+ */
77
+ getLatitude(): number;
78
+ setLongitude(longitude: number): void;
79
+ /**
80
+ * @return Returns the longitude.
81
+ */
82
+ getLongitude(): number;
83
+ /**
84
+ * @return Returns the location name.
85
+ */
86
+ getLocationName(): string | null;
87
+ /**
88
+ * @param name
89
+ * The setter method for the display name.
90
+ */
91
+ setLocationName(name: string | null): void;
92
+ /**
93
+ * @return Returns the timeZone.
94
+ */
95
+ getTimeZone(): string;
96
+ /**
97
+ * Method to set the TimeZone. If this is ever set after the GeoLocation is set in the
98
+ * {@link AstronomicalCalendar}, it is critical that
99
+ * {@link AstronomicalCalendar#getCalendar()}.
100
+ * {@link java.util.Calendar#setTimeZone(TimeZone) setTimeZone(TimeZone)} be called in order for the
101
+ * AstronomicalCalendar to output times in the expected offset. This situation will arise if the
102
+ * AstronomicalCalendar is ever {@link AstronomicalCalendar#clone() cloned}.
103
+ *
104
+ * @param timeZone
105
+ * The timeZone to set.
106
+ */
107
+ setTimeZone(timeZoneId: string): void;
108
+ }
109
+ /**
110
+ * Implementation of sunrise and sunset methods to calculate astronomical times based on the <a
111
+ * href="http://noaa.gov">NOAA</a> algorithm. This calculator uses the Java algorithm based on the implementation by <a
112
+ * href="http://noaa.gov">NOAA - National Oceanic and Atmospheric Administration</a>'s <a href =
113
+ * "http://www.srrb.noaa.gov/highlights/sunrise/sunrise.html">Surface Radiation Research Branch</a>. NOAA's <a
114
+ * href="http://www.srrb.noaa.gov/highlights/sunrise/solareqns.PDF">implementation</a> is based on equations from <a
115
+ * href="http://www.willbell.com/math/mc1.htm">Astronomical Algorithms</a> by <a
116
+ * href="http://en.wikipedia.org/wiki/Jean_Meeus">Jean Meeus</a>. Added to the algorithm is an adjustment of the zenith
117
+ * to account for elevation. The algorithm can be found in the <a
118
+ * href="http://en.wikipedia.org/wiki/Sunrise_equation">Wikipedia Sunrise Equation</a> article.
119
+ *
120
+ * @author &copy; Eliyahu Hershfeld 2011 - 2019
121
+ */
122
+ export declare class NOAACalculator {
123
+ /**
124
+ * The zenith of astronomical sunrise and sunset. The sun is 90&deg; from the vertical 0&deg;
125
+ * @private
126
+ */
127
+ private static readonly GEOMETRIC_ZENITH;
128
+ /**
129
+ * Default value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle that the
130
+ * center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the Earth
131
+ * were without an atmosphere, true sunset and sunrise would correspond to a 90&deg; zenith. Because the Sun is not
132
+ * a point, and because the atmosphere refracts light, this 90&deg; zenith does not, in fact, correspond to true
133
+ * sunset or sunrise, instead the center of the Sun's disk must lie just below the horizon for the upper edge to be
134
+ * obscured. This means that a zenith of just above 90&deg; must be used. The Sun subtends an angle of 16 minutes of
135
+ * arc (this can be changed via the {@link #setSunRadius(double)} method , and atmospheric refraction accounts for
136
+ * 34 minutes or so (this can be changed via the {@link #setRefraction(double)} method), giving a total of 50
137
+ * arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333&deg; for true sunrise/sunset.
138
+ */
139
+ /** Sun's zenith at civil twilight (96&deg;). */
140
+ static readonly CIVIL_ZENITH: number;
141
+ /** Sun's zenith at nautical twilight (102&deg;). */
142
+ static readonly NAUTICAL_ZENITH: number;
143
+ /** Sun's zenith at astronomical twilight (108&deg;). */
144
+ static readonly ASTRONOMICAL_ZENITH: number;
145
+ /**
146
+ * The Java Calendar encapsulated by this class to track the current date used by the class
147
+ * @private
148
+ */
149
+ private date;
150
+ /**
151
+ * the {@link GeoLocation} used for calculations.
152
+ * @private
153
+ */
154
+ private geoLocation;
155
+ /**
156
+ * The getSunrise method Returns a <code>Date</code> representing the
157
+ * {@link AstronomicalCalculator#getElevationAdjustment(double) elevation adjusted} sunrise time. The zenith used
158
+ * for the calculation uses {@link #GEOMETRIC_ZENITH geometric zenith} of 90&deg; plus
159
+ * {@link AstronomicalCalculator#getElevationAdjustment(double)}. This is adjusted by the
160
+ * {@link AstronomicalCalculator} to add approximately 50/60 of a degree to account for 34 archminutes of refraction
161
+ * and 16 archminutes for the sun's radius for a total of {@link AstronomicalCalculator#adjustZenith 90.83333&deg;}.
162
+ * See documentation for the specific implementation of the {@link AstronomicalCalculator} that you are using.
163
+ *
164
+ * @return the <code>Date</code> representing the exact sunrise time. If the calculation can't be computed such as
165
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
166
+ * does not set, a null will be returned. See detailed explanation on top of the page.
167
+ * @see AstronomicalCalculator#adjustZenith
168
+ * @see #getSeaLevelSunrise()
169
+ * @see AstronomicalCalendar#getUTCSunrise
170
+ */
171
+ getSunrise(): Temporal.ZonedDateTime | null;
172
+ /**
173
+ * A method that returns the sunrise without {@link AstronomicalCalculator#getElevationAdjustment(double) elevation
174
+ * adjustment}. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,
175
+ * something that is not affected by elevation. This method returns sunrise calculated at sea level. This forms the
176
+ * base for dawn calculations that are calculated as a dip below the horizon before sunrise.
177
+ *
178
+ * @return the <code>Date</code> representing the exact sea-level sunrise time. If the calculation can't be computed
179
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
180
+ * where it does not set, a null will be returned. See detailed explanation on top of the page.
181
+ * @see AstronomicalCalendar#getSunrise
182
+ * @see AstronomicalCalendar#getUTCSeaLevelSunrise
183
+ * @see #getSeaLevelSunset()
184
+ */
185
+ getSeaLevelSunrise(): Temporal.ZonedDateTime | null;
186
+ /**
187
+ * A method that returns the beginning of civil twilight (dawn) using a zenith of {@link #CIVIL_ZENITH 96&deg;}.
188
+ *
189
+ * @return The <code>Date</code> of the beginning of civil twilight using a zenith of 96&deg;. If the calculation
190
+ * can't be computed, null will be returned. See detailed explanation on top of the page.
191
+ * @see #CIVIL_ZENITH
192
+ */
193
+ getBeginCivilTwilight(): Temporal.ZonedDateTime | null;
194
+ /**
195
+ * A method that returns the beginning of nautical twilight using a zenith of {@link #NAUTICAL_ZENITH 102&deg;}.
196
+ *
197
+ * @return The <code>Date</code> of the beginning of nautical twilight using a zenith of 102&deg;. If the
198
+ * calculation can't be computed null will be returned. See detailed explanation on top of the page.
199
+ * @see #NAUTICAL_ZENITH
200
+ */
201
+ getBeginNauticalTwilight(): Temporal.ZonedDateTime | null;
202
+ /**
203
+ * A method that returns the beginning of astronomical twilight using a zenith of {@link #ASTRONOMICAL_ZENITH
204
+ * 108&deg;}.
205
+ *
206
+ * @return The <code>Date</code> of the beginning of astronomical twilight using a zenith of 108&deg;. If the
207
+ * calculation can't be computed, null will be returned. See detailed explanation on top of the page.
208
+ * @see #ASTRONOMICAL_ZENITH
209
+ */
210
+ getBeginAstronomicalTwilight(): Temporal.ZonedDateTime | null;
211
+ /**
212
+ * The getSunset method Returns a <code>Date</code> representing the
213
+ * {@link AstronomicalCalculator#getElevationAdjustment(double) elevation adjusted} sunset time. The zenith used for
214
+ * the calculation uses {@link #GEOMETRIC_ZENITH geometric zenith} of 90&deg; plus
215
+ * {@link AstronomicalCalculator#getElevationAdjustment(double)}. This is adjusted by the
216
+ * {@link AstronomicalCalculator} to add approximately 50/60 of a degree to account for 34 archminutes of refraction
217
+ * and 16 archminutes for the sun's radius for a total of {@link AstronomicalCalculator#adjustZenith 90.83333&deg;}.
218
+ * See documentation for the specific implementation of the {@link AstronomicalCalculator} that you are using. Note:
219
+ * In certain cases the calculates sunset will occur before sunrise. This will typically happen when a timezone
220
+ * other than the local timezone is used (calculating Los Angeles sunset using a GMT timezone for example). In this
221
+ * case the sunset date will be incremented to the following date.
222
+ *
223
+ * @return the <code>Date</code> representing the exact sunset time. If the calculation can't be computed such as in
224
+ * the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
225
+ * does not set, a null will be returned. See detailed explanation on top of the page.
226
+ * @see AstronomicalCalculator#adjustZenith
227
+ * @see #getSeaLevelSunset()
228
+ * @see AstronomicalCalendar#getUTCSunset
229
+ */
230
+ getSunset(): Temporal.ZonedDateTime | null;
231
+ /**
232
+ * A method that returns the sunset without {@link AstronomicalCalculator#getElevationAdjustment(double) elevation
233
+ * adjustment}. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,
234
+ * something that is not affected by elevation. This method returns sunset calculated at sea level. This forms the
235
+ * base for dusk calculations that are calculated as a dip below the horizon after sunset.
236
+ *
237
+ * @return the <code>Date</code> representing the exact sea-level sunset time. If the calculation can't be computed
238
+ * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
239
+ * where it does not set, a null will be returned. See detailed explanation on top of the page.
240
+ * @see AstronomicalCalendar#getSunset
241
+ * @see AstronomicalCalendar#getUTCSeaLevelSunset 2see {@link #getSunset()}
242
+ */
243
+ getSeaLevelSunset(): Temporal.ZonedDateTime | null;
244
+ /**
245
+ * A method that returns the end of civil twilight using a zenith of {@link #CIVIL_ZENITH 96&deg;}.
246
+ *
247
+ * @return The <code>Date</code> of the end of civil twilight using a zenith of {@link #CIVIL_ZENITH 96&deg;}. If
248
+ * the calculation can't be computed, null will be returned. See detailed explanation on top of the page.
249
+ * @see #CIVIL_ZENITH
250
+ */
251
+ getEndCivilTwilight(): Temporal.ZonedDateTime | null;
252
+ /**
253
+ * A method that returns the end of nautical twilight using a zenith of {@link #NAUTICAL_ZENITH 102&deg;}.
254
+ *
255
+ * @return The <code>Date</code> of the end of nautical twilight using a zenith of {@link #NAUTICAL_ZENITH 102&deg;}
256
+ * . If the calculation can't be computed, null will be returned. See detailed explanation on top of the
257
+ * page.
258
+ * @see #NAUTICAL_ZENITH
259
+ */
260
+ getEndNauticalTwilight(): Temporal.ZonedDateTime | null;
261
+ /**
262
+ * A method that returns the end of astronomical twilight using a zenith of {@link #ASTRONOMICAL_ZENITH 108&deg;}.
263
+ *
264
+ * @return the <code>Date</code> of the end of astronomical twilight using a zenith of {@link #ASTRONOMICAL_ZENITH
265
+ * 108&deg;}. If the calculation can't be computed, null will be returned. See detailed explanation on top
266
+ * of the page.
267
+ * @see #ASTRONOMICAL_ZENITH
268
+ */
269
+ getEndAstronomicalTwilight(): Temporal.ZonedDateTime | null;
270
+ /**
271
+ * A utility method that returns a date offset by the offset time passed in. Please note that the level of light
272
+ * during twilight is not affected by elevation, so if this is being used to calculate an offset before sunrise or
273
+ * after sunset with the intent of getting a rough "level of light" calculation, the sunrise or sunset time passed
274
+ * to this method should be sea level sunrise and sunset.
275
+ *
276
+ * @param time
277
+ * the start time
278
+ * @param offset
279
+ * the offset in milliseconds to add to the time.
280
+ * @return the {@link java.util.Date} with the offset in milliseconds added to it
281
+ */
282
+ static getTimeOffset(time: Temporal.ZonedDateTime | null, offset: number): Temporal.ZonedDateTime | null;
283
+ /**
284
+ * A utility method that returns the time of an offset by degrees below or above the horizon of
285
+ * {@link #getSunrise() sunrise}. Note that the degree offset is from the vertical, so for a calculation of 14&deg;
286
+ * before sunrise, an offset of 14 + {@link #GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.
287
+ *
288
+ * @param offsetZenith
289
+ * the degrees before {@link #getSunrise()} to use in the calculation. For time after sunrise use
290
+ * negative numbers. Note that the degree offset is from the vertical, so for a calculation of 14&deg;
291
+ * before sunrise, an offset of 14 + {@link #GEOMETRIC_ZENITH} = 104 would have to be passed as a
292
+ * parameter.
293
+ * @return The {@link java.util.Date} of the offset after (or before) {@link #getSunrise()}. If the calculation
294
+ * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
295
+ * not rise, and one where it does not set, a null will be returned. See detailed explanation on top of the
296
+ * page.
297
+ */
298
+ getSunriseOffsetByDegrees(offsetZenith: number): Temporal.ZonedDateTime | null;
299
+ /**
300
+ * A utility method that returns the time of an offset by degrees below or above the horizon of {@link #getSunset()
301
+ * sunset}. Note that the degree offset is from the vertical, so for a calculation of 14&deg; after sunset, an
302
+ * offset of 14 + {@link #GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.
303
+ *
304
+ * @param offsetZenith
305
+ * the degrees after {@link #getSunset()} to use in the calculation. For time before sunset use negative
306
+ * numbers. Note that the degree offset is from the vertical, so for a calculation of 14&deg; after
307
+ * sunset, an offset of 14 + {@link #GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.
308
+ * @return The {@link java.util.Date}of the offset after (or before) {@link #getSunset()}. If the calculation can't
309
+ * be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
310
+ * rise, and one where it does not set, a null will be returned. See detailed explanation on top of the
311
+ * page.
312
+ */
313
+ getSunsetOffsetByDegrees(offsetZenith: number): Temporal.ZonedDateTime | null;
314
+ /**
315
+ * A constructor that takes in <a href="http://en.wikipedia.org/wiki/Geolocation">geolocation</a> information as a
316
+ * parameter. The default {@link AstronomicalCalculator#getDefault() AstronomicalCalculator} used for solar
317
+ * calculations is the the {@link NOAACalculator}.
318
+ *
319
+ * @param geoLocation
320
+ * The location information used for calculating astronomical sun times.
321
+ *
322
+ * @see #setAstronomicalCalculator(AstronomicalCalculator) for changing the calculator class.
323
+ */
324
+ constructor(geoLocation: GeoLocation, date: Temporal.PlainDate);
325
+ /**
326
+ * A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using
327
+ * daylight savings time.
328
+ *
329
+ * @param zenith
330
+ * the degrees below the horizon. For time after sunrise use negative numbers.
331
+ * @return The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
332
+ * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
333
+ * not set, {@link Double#NaN} will be returned. See detailed explanation on top of the page.
334
+ */
335
+ getUTCSunrise0(zenith: number): number;
336
+ /**
337
+ * A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using
338
+ * daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible
339
+ * light, something that is not affected by elevation. This method returns UTC sunrise calculated at sea level. This
340
+ * forms the base for dawn calculations that are calculated as a dip below the horizon before sunrise.
341
+ *
342
+ * @param zenith
343
+ * the degrees below the horizon. For time after sunrise use negative numbers.
344
+ * @return The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
345
+ * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
346
+ * not set, {@link Double#NaN} will be returned. See detailed explanation on top of the page.
347
+ * @see AstronomicalCalendar#getUTCSunrise
348
+ * @see AstronomicalCalendar#getUTCSeaLevelSunset
349
+ */
350
+ getUTCSeaLevelSunrise(zenith: number): number;
351
+ /**
352
+ * A method that returns the sunset in UTC time without correction for time zone offset from GMT and without using
353
+ * daylight savings time.
354
+ *
355
+ * @param zenith
356
+ * the degrees below the horizon. For time after sunset use negative numbers.
357
+ * @return The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
358
+ * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
359
+ * not set, {@link Double#NaN} will be returned. See detailed explanation on top of the page.
360
+ * @see AstronomicalCalendar#getUTCSeaLevelSunset
361
+ */
362
+ getUTCSunset0(zenith: number): number;
363
+ /**
364
+ * A method that returns the sunset in UTC time without correction for elevation, time zone offset from GMT and
365
+ * without using daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the
366
+ * amount of visible light, something that is not affected by elevation. This method returns UTC sunset calculated
367
+ * at sea level. This forms the base for dusk calculations that are calculated as a dip below the horizon after
368
+ * sunset.
369
+ *
370
+ * @param zenith
371
+ * the degrees below the horizon. For time before sunset use negative numbers.
372
+ * @return The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
373
+ * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
374
+ * not set, {@link Double#NaN} will be returned. See detailed explanation on top of the page.
375
+ * @see AstronomicalCalendar#getUTCSunset
376
+ * @see AstronomicalCalendar#getUTCSeaLevelSunrise
377
+ */
378
+ getUTCSeaLevelSunset(zenith: number): number;
379
+ /**
380
+ * Adjusts the <code>Calendar</code> to deal with edge cases where the location crosses the antimeridian.
381
+ * @private
382
+ * @see GeoLocation#getAntimeridianAdjustment()
383
+ * @return the adjusted Calendar
384
+ */
385
+ private getAdjustedDate;
386
+ /**
387
+ * Method to return the adjustment to the zenith required to account for the elevation. Since a person at a higher
388
+ * elevation can see farther below the horizon, the calculation for sunrise / sunset is calculated below the horizon
389
+ * used at sea level. This is only used for sunrise and sunset and not times before or after it such as
390
+ * {@link AstronomicalCalendar#getBeginNauticalTwilight() nautical twilight} since those
391
+ * calculations are based on the level of available light at the given dip below the horizon, something that is not
392
+ * affected by elevation, the adjustment should only made if the zenith == 90&deg; {@link #adjustZenith adjusted}
393
+ * for refraction and solar radius. The algorithm used is
394
+ *
395
+ * <pre>
396
+ * elevationAdjustment = Math.toDegrees(Math.acos(earthRadiusInMeters / (earthRadiusInMeters + elevationMeters)));
397
+ * </pre>
398
+ *
399
+ * The source of this algorithm is <a href="http://www.calendarists.com">Calendrical Calculations</a> by Edward M.
400
+ * Reingold and Nachum Dershowitz. An alternate algorithm that produces an almost identical (but not accurate)
401
+ * result found in Ma'aglay Tzedek by Moishe Kosower and other sources is:
402
+ *
403
+ * <pre>
404
+ * elevationAdjustment = 0.0347 * Math.sqrt(elevationMeters);
405
+ * </pre>
406
+ *
407
+ * @param elevation
408
+ * elevation in Meters.
409
+ * @return the adjusted zenith
410
+ */
411
+ getElevationAdjustment(elevation: number): number;
412
+ /**
413
+ * Adjusts the zenith of astronomical sunrise and sunset to account for solar refraction, solar radius and
414
+ * elevation. The value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle
415
+ * that the center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the
416
+ * Earth were without an atmosphere, true sunset and sunrise would correspond to a 90&deg; zenith. Because the Sun
417
+ * is not a point, and because the atmosphere refracts light, this 90&deg; zenith does not, in fact, correspond to
418
+ * true sunset or sunrise, instead the centre of the Sun's disk must lie just below the horizon for the upper edge
419
+ * to be obscured. This means that a zenith of just above 90&deg; must be used. The Sun subtends an angle of 16
420
+ * minutes of arc (this can be changed via the {@link #setSolarRadius(double)} method , and atmospheric refraction
421
+ * accounts for 34 minutes or so (this can be changed via the {@link #setRefraction(double)} method), giving a total
422
+ * of 50 arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333&deg; for true sunrise/sunset. Since a
423
+ * person at an elevation can see blow the horizon of a person at sea level, this will also adjust the zenith to
424
+ * account for elevation if available. Note that this will only adjust the value if the zenith is exactly 90 degrees.
425
+ * For values below and above this no correction is done. As an example, astronomical twilight is when the sun is
426
+ * 18&deg; below the horizon or {@link AstronomicalCalendar#ASTRONOMICAL_ZENITH 108&deg;
427
+ * below the zenith}. This is traditionally calculated with none of the above mentioned adjustments. The same goes
428
+ * for various <em>tzais</em> and <em>alos</em> times such as the
429
+ * {@link ZmanimCalendar#ZENITH_16_POINT_1 16.1&deg;} dip used in
430
+ * {@link ComplexZmanimCalendar#getAlos16Point1Degrees()}.
431
+ *
432
+ * @param zenith
433
+ * the azimuth below the vertical zenith of 90&deg;. For sunset typically the {@link #adjustZenith
434
+ * zenith} used for the calculation uses geometric zenith of 90&deg; and {@link #adjustZenith adjusts}
435
+ * this slightly to account for solar refraction and the sun's radius. Another example would be
436
+ * {@link AstronomicalCalendar#getEndNauticalTwilight()} that passes
437
+ * {@link AstronomicalCalendar#NAUTICAL_ZENITH} to this method.
438
+ * @param elevation
439
+ * elevation in Meters.
440
+ * @return The zenith adjusted to include the {@link #getSolarRadius sun's radius}, {@link #getRefraction
441
+ * refraction} and {@link #getElevationAdjustment elevation} adjustment. This will only be adjusted for
442
+ * sunrise and sunset (if the zenith == 90&deg;)
443
+ * @see #getElevationAdjustment(double)
444
+ */
445
+ adjustZenith(zenith: number, elevation: number): number;
446
+ /**
447
+ * The <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> of January 1, 2000
448
+ * @private
449
+ */
450
+ private static readonly JULIAN_DAY_JAN_1_2000;
451
+ /**
452
+ * Julian days per century
453
+ * @private
454
+ */
455
+ private static readonly JULIAN_DAYS_PER_CENTURY;
456
+ /**
457
+ * @see AstronomicalCalculator#getUTCSunrise(Calendar, GeoLocation, double, boolean)
458
+ */
459
+ getUTCSunrise(date: Temporal.PlainDate, geoLocation: GeoLocation, zenith: number, adjustForElevation: boolean): number;
460
+ /**
461
+ * @see AstronomicalCalculator#getUTCSunset(Calendar, GeoLocation, double, boolean)
462
+ */
463
+ getUTCSunset(date: Temporal.PlainDate, geoLocation: GeoLocation, zenith: number, adjustForElevation: boolean): number;
464
+ /**
465
+ * A utility method that will allow the calculation of a temporal (solar) hour based on the sunrise and sunset
466
+ * passed as parameters to this method. An example of the use of this method would be the calculation of a
467
+ * non-elevation adjusted temporal hour by passing in {@link #getSeaLevelSunrise() sea level sunrise} and
468
+ * {@link #getSeaLevelSunset() sea level sunset} as parameters.
469
+ *
470
+ * @param startOfday
471
+ * The start of the day.
472
+ * @param endOfDay
473
+ * The end of the day.
474
+ *
475
+ * @return the <code>long</code> millisecond length of the temporal hour. If the calculation can't be computed a
476
+ * {@link Long#MIN_VALUE} will be returned. See detailed explanation on top of the page.
477
+ *
478
+ * @see #getTemporalHour()
479
+ */
480
+ getTemporalHour(startOfday?: Temporal.ZonedDateTime | null, endOfDay?: Temporal.ZonedDateTime | null): number;
481
+ /**
482
+ * A method that returns sundial or solar noon. It occurs when the Sun is <a href
483
+ * ="http://en.wikipedia.org/wiki/Transit_%28astronomy%29">transiting</a> the <a
484
+ * href="http://en.wikipedia.org/wiki/Meridian_%28astronomy%29">celestial meridian</a>. In this class it is
485
+ * calculated as halfway between the sunrise and sunset passed to this method. This time can be slightly off the
486
+ * real transit time due to changes in declination (the lengthening or shortening day).
487
+ *
488
+ * @param startOfDay
489
+ * the start of day for calculating the sun's transit. This can be sea level sunrise, visual sunrise (or
490
+ * any arbitrary start of day) passed to this method.
491
+ * @param endOfDay
492
+ * the end of day for calculating the sun's transit. This can be sea level sunset, visual sunset (or any
493
+ * arbitrary end of day) passed to this method.
494
+ *
495
+ * @return the <code>Date</code> representing Sun's transit. If the calculation can't be computed such as in the
496
+ * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
497
+ * not set, null will be returned. See detailed explanation on top of the page.
498
+ */
499
+ getSunTransit(startOfDay?: Temporal.ZonedDateTime | null, endOfDay?: Temporal.ZonedDateTime | null): Temporal.ZonedDateTime | null;
500
+ /**
501
+ * A method that returns a <code>Date</code> from the time passed in as a parameter.
502
+ * @protected
503
+ * @param time
504
+ * The time to be set as the time for the <code>Date</code>. The time expected is in the format: 18.75
505
+ * for 6:45:00 PM.
506
+ * @param isSunrise true if the time is sunrise, and false if it is sunset
507
+ * @return The Date.
508
+ */
509
+ protected getDateFromTime(time: number, isSunrise: boolean): Temporal.ZonedDateTime | null;
510
+ /**
511
+ * Return the <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> from a Java Calendar
512
+ * @private
513
+ * @param calendar
514
+ * The Java Calendar
515
+ * @return the Julian day corresponding to the date Note: Number is returned for start of day. Fractional days
516
+ * should be added later.
517
+ */
518
+ private static getJulianDay;
519
+ /**
520
+ * Convert <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> to centuries since J2000.0.
521
+ * @private
522
+ * @param julianDay
523
+ * the Julian Day to convert
524
+ * @return the centuries since 2000 Julian corresponding to the Julian Day
525
+ */
526
+ private static getJulianCenturiesFromJulianDay;
527
+ /**
528
+ * Convert centuries since J2000.0 to <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a>.
529
+ * @private
530
+ * @param julianCenturies
531
+ * the number of Julian centuries since J2000.0
532
+ * @return the Julian Day corresponding to the Julian centuries passed in
533
+ */
534
+ private static getJulianDayFromJulianCenturies;
535
+ /**
536
+ * Returns the Geometric <a href="http://en.wikipedia.org/wiki/Mean_longitude">Mean Longitude</a> of the Sun.
537
+ * @private
538
+ * @param julianCenturies
539
+ * the number of Julian centuries since J2000.0
540
+ * @return the Geometric Mean Longitude of the Sun in degrees
541
+ */
542
+ private static getSunGeometricMeanLongitude;
543
+ /**
544
+ * Returns the Geometric <a href="http://en.wikipedia.org/wiki/Mean_anomaly">Mean Anomaly</a> of the Sun.
545
+ * @private
546
+ * @param julianCenturies
547
+ * the number of Julian centuries since J2000.0
548
+ * @return the Geometric Mean Anomaly of the Sun in degrees
549
+ */
550
+ private static getSunGeometricMeanAnomaly;
551
+ /**
552
+ * Return the <a href="http://en.wikipedia.org/wiki/Eccentricity_%28orbit%29">eccentricity of earth's orbit</a>.
553
+ * @private
554
+ * @param julianCenturies
555
+ * the number of Julian centuries since J2000.0
556
+ * @return the unitless eccentricity
557
+ */
558
+ private static getEarthOrbitEccentricity;
559
+ /**
560
+ * Returns the <a href="http://en.wikipedia.org/wiki/Equation_of_the_center">equation of center</a> for the sun.
561
+ * @private
562
+ * @param julianCenturies
563
+ * the number of Julian centuries since J2000.0
564
+ * @return the equation of center for the sun in degrees
565
+ */
566
+ private static getSunEquationOfCenter;
567
+ /**
568
+ * Return the true longitude of the sun
569
+ * @private
570
+ * @param julianCenturies
571
+ * the number of Julian centuries since J2000.0
572
+ * @return the sun's true longitude in degrees
573
+ */
574
+ private static getSunTrueLongitude;
575
+ /**
576
+ * Return the apparent longitude of the sun
577
+ * @private
578
+ * @param julianCenturies
579
+ * the number of Julian centuries since J2000.0
580
+ * @return sun's apparent longitude in degrees
581
+ */
582
+ private static getSunApparentLongitude;
583
+ /**
584
+ * Returns the mean <a href="http://en.wikipedia.org/wiki/Axial_tilt">obliquity of the ecliptic</a> (Axial tilt).
585
+ * @private
586
+ * @param julianCenturies
587
+ * the number of Julian centuries since J2000.0
588
+ * @return the mean obliquity in degrees
589
+ */
590
+ private static getMeanObliquityOfEcliptic;
591
+ /**
592
+ * Returns the corrected <a href="http://en.wikipedia.org/wiki/Axial_tilt">obliquity of the ecliptic</a> (Axial
593
+ * tilt).
594
+ * @private
595
+ * @param julianCenturies
596
+ * the number of Julian centuries since J2000.0
597
+ * @return the corrected obliquity in degrees
598
+ */
599
+ private static getObliquityCorrection;
600
+ /**
601
+ * Return the <a href="http://en.wikipedia.org/wiki/Declination">declination</a> of the sun.
602
+ * @private
603
+ * @param julianCenturies
604
+ * the number of Julian centuries since J2000.0
605
+ * @return
606
+ * the sun's declination in degrees
607
+ */
608
+ private static getSunDeclination;
609
+ /**
610
+ * Return the <a href="http://en.wikipedia.org/wiki/Equation_of_time">Equation of Time</a> - the difference between
611
+ * true solar time and mean solar time
612
+ * @private
613
+ * @param julianCenturies
614
+ * the number of Julian centuries since J2000.0
615
+ * @return equation of time in minutes of time
616
+ */
617
+ private static getEquationOfTime;
618
+ /**
619
+ * Return the <a href="http://en.wikipedia.org/wiki/Hour_angle">hour angle</a> of the sun at sunrise for the
620
+ * latitude.
621
+ * @private
622
+ * @param lat
623
+ * , the latitude of observer in degrees
624
+ * @param solarDec
625
+ * the declination angle of sun in degrees
626
+ * @param zenith
627
+ * the zenith
628
+ * @return hour angle of sunrise in radians
629
+ */
630
+ private static getSunHourAngleAtSunrise;
631
+ /**
632
+ * Returns the <a href="http://en.wikipedia.org/wiki/Hour_angle">hour angle</a> of the sun at sunset for the
633
+ * latitude. TODO: use - {@link #getSunHourAngleAtSunrise(double, double, double)} implementation to avoid
634
+ * duplication of code.
635
+ * @private
636
+ * @param lat
637
+ * the latitude of observer in degrees
638
+ * @param solarDec
639
+ * the declination angle of sun in degrees
640
+ * @param zenith
641
+ * the zenith
642
+ * @return the hour angle of sunset in radians
643
+ */
644
+ private static getSunHourAngleAtSunset;
645
+ /**
646
+ * Return the <a href="http://en.wikipedia.org/wiki/Celestial_coordinate_system">Solar Elevation</a> for the
647
+ * horizontal coordinate system at the given location at the given time. Can be negative if the sun is below the
648
+ * horizon. Not corrected for altitude.
649
+ *
650
+ * @param cal
651
+ * time of calculation
652
+ * @param lat
653
+ * latitude of location for calculation
654
+ * @param lon
655
+ * longitude of location for calculation
656
+ * @return solar elevation in degrees - horizon is 0 degrees, civil twilight is -6 degrees
657
+ */
658
+ static getSolarElevation(date: Temporal.ZonedDateTime, lat: number, lon: number): number;
659
+ /**
660
+ * Return the <a href="http://en.wikipedia.org/wiki/Celestial_coordinate_system">Solar Azimuth</a> for the
661
+ * horizontal coordinate system at the given location at the given time. Not corrected for altitude. True south is 0
662
+ * degrees.
663
+ *
664
+ * @param cal
665
+ * time of calculation
666
+ * @param latitude
667
+ * latitude of location for calculation
668
+ * @param lon
669
+ * longitude of location for calculation
670
+ * @return FIXME
671
+ */
672
+ static getSolarAzimuth(date: Temporal.ZonedDateTime, latitude: number, lon: number): number;
673
+ /**
674
+ * Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
675
+ * of sunrise for the given day at the given location on earth
676
+ * @private
677
+ * @param julianDay
678
+ * the Julian day
679
+ * @param latitude
680
+ * the latitude of observer in degrees
681
+ * @param longitude
682
+ * the longitude of observer in degrees
683
+ * @param zenith
684
+ * the zenith
685
+ * @return the time in minutes from zero UTC
686
+ */
687
+ private static getSunriseUTC;
688
+ /**
689
+ * Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
690
+ * of <a href="http://en.wikipedia.org/wiki/Noon#Solar_noon">solar noon</a> for the given day at the given location
691
+ * on earth.
692
+ * @private
693
+ * @param julianCenturies
694
+ * the number of Julian centuries since J2000.0
695
+ * @param longitude
696
+ * the longitude of observer in degrees
697
+ * @return the time in minutes from zero UTC
698
+ */
699
+ private static getSolarNoonUTC;
700
+ /**
701
+ * Return the <a href="http://en.wikipedia.org/wiki/Universal_Coordinated_Time">Universal Coordinated Time</a> (UTC)
702
+ * of sunset for the given day at the given location on earth
703
+ * @private
704
+ * @param julianDay
705
+ * the Julian day
706
+ * @param latitude
707
+ * the latitude of observer in degrees
708
+ * @param longitude
709
+ * : longitude of observer in degrees
710
+ * @param zenith
711
+ * the zenith
712
+ * @return the time in minutes from zero Universal Coordinated Time (UTC)
713
+ */
714
+ private static getSunsetUTC;
715
+ }