@hebcal/noaa 0.8.8 → 0.8.10
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.
- package/README.md +108 -95
- package/dist/index.cjs +147 -117
- package/dist/index.d.ts +115 -126
- package/dist/index.js +147 -127
- package/package.json +5 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Temporal } from 'temporal-polyfill';
|
|
2
2
|
/**
|
|
3
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.
|
|
5
|
-
* specific implementations of the {@link AstronomicalCalculator} to see if elevation is calculated as part of the
|
|
6
|
-
* algorithm.
|
|
4
|
+
* elevation field may not be used by some calculation engines and would be ignored if set.
|
|
7
5
|
*
|
|
8
6
|
* @author © Eliyahu Hershfeld 2004 - 2016
|
|
9
7
|
* @version 1.1
|
|
@@ -27,53 +25,25 @@ export declare class GeoLocation {
|
|
|
27
25
|
* @param {string} timeZoneId
|
|
28
26
|
* the <code>TimeZone</code> for the location.
|
|
29
27
|
*/
|
|
30
|
-
constructor(name: string | null, latitude: number, longitude: number, elevation: number, timeZoneId
|
|
31
|
-
/**
|
|
32
|
-
* GeoLocation constructor with parameters for all required fields.
|
|
33
|
-
*
|
|
34
|
-
* @param {string} name
|
|
35
|
-
* The location name for display use such as "Lakewood, NJ"
|
|
36
|
-
* @param {number} latitude
|
|
37
|
-
* the latitude in a double format such as 40.095965 for Lakewood, NJ.
|
|
38
|
-
* <b>Note: </b> For latitudes south of the equator, a negative value should be used.
|
|
39
|
-
* @param {number} longitude
|
|
40
|
-
* double the longitude in a double format such as -74.222130 for Lakewood, NJ.
|
|
41
|
-
* <b>Note: </b> For longitudes west of the <a href="http://en.wikipedia.org/wiki/Prime_Meridian">Prime
|
|
42
|
-
* Meridian </a> (Greenwich), a negative value should be used.
|
|
43
|
-
* @param {string} timeZoneId
|
|
44
|
-
* the <code>TimeZone</code> for the location.
|
|
45
|
-
*/
|
|
46
|
-
constructor(name: string | null, latitude: number, longitude: number, timeZoneId: string);
|
|
28
|
+
constructor(name: string | null, latitude: number, longitude: number, elevation: number, timeZoneId: string);
|
|
47
29
|
/**
|
|
48
30
|
* @private
|
|
49
|
-
* @see #getLatitude()
|
|
50
|
-
* @see #setLatitude(double)
|
|
51
|
-
* @see #setLatitude(int, int, double, String)
|
|
52
31
|
*/
|
|
53
32
|
private latitude;
|
|
54
33
|
/**
|
|
55
34
|
* @private
|
|
56
|
-
* @see #getLongitude()
|
|
57
|
-
* @see #setLongitude(double)
|
|
58
|
-
* @see #setLongitude(int, int, double, String)
|
|
59
35
|
*/
|
|
60
36
|
private longitude;
|
|
61
37
|
/**
|
|
62
38
|
* @private
|
|
63
|
-
* @see #getLocationName()
|
|
64
|
-
* @see #setLocationName(String)
|
|
65
39
|
*/
|
|
66
40
|
private locationName;
|
|
67
41
|
/**
|
|
68
42
|
* @private
|
|
69
|
-
* @see #getTimeZone()
|
|
70
|
-
* @see #setTimeZone(TimeZone)
|
|
71
43
|
*/
|
|
72
44
|
private timeZoneId;
|
|
73
45
|
/**
|
|
74
46
|
* @private
|
|
75
|
-
* @see #getElevation()
|
|
76
|
-
* @see #setElevation(double)
|
|
77
47
|
*/
|
|
78
48
|
private elevation;
|
|
79
49
|
/**
|
|
@@ -86,7 +56,7 @@ export declare class GeoLocation {
|
|
|
86
56
|
* Method to set the elevation in Meters <b>above </b> sea level.
|
|
87
57
|
*
|
|
88
58
|
* @param {number} elevation
|
|
89
|
-
* The elevation to set in Meters. An
|
|
59
|
+
* The elevation to set in Meters. An Error will be thrown if the value is a negative.
|
|
90
60
|
*/
|
|
91
61
|
setElevation(elevation: number): void;
|
|
92
62
|
setLatitude(latitude: number): void;
|
|
@@ -113,13 +83,7 @@ export declare class GeoLocation {
|
|
|
113
83
|
*/
|
|
114
84
|
getTimeZone(): string;
|
|
115
85
|
/**
|
|
116
|
-
* Method to set the TimeZone.
|
|
117
|
-
* {@link AstronomicalCalendar}, it is critical that
|
|
118
|
-
* {@link AstronomicalCalendar#getCalendar()}.
|
|
119
|
-
* {@link java.util.Calendar#setTimeZone(TimeZone) setTimeZone(TimeZone)} be called in order for the
|
|
120
|
-
* AstronomicalCalendar to output times in the expected offset. This situation will arise if the
|
|
121
|
-
* AstronomicalCalendar is ever {@link AstronomicalCalendar#clone() cloned}.
|
|
122
|
-
*
|
|
86
|
+
* Method to set the TimeZone.
|
|
123
87
|
* @param {string} timeZoneId
|
|
124
88
|
* The timeZone to set.
|
|
125
89
|
*/
|
|
@@ -141,14 +105,11 @@ export declare class GeoLocation {
|
|
|
141
105
|
export declare class NOAACalculator {
|
|
142
106
|
/**
|
|
143
107
|
* A constructor that takes in <a href="http://en.wikipedia.org/wiki/Geolocation">geolocation</a> information as a
|
|
144
|
-
* parameter.
|
|
145
|
-
* calculations is the the {@link NOAACalculator}.
|
|
108
|
+
* parameter.
|
|
146
109
|
*
|
|
147
110
|
* @param {GeoLocation} geoLocation
|
|
148
111
|
* The location information used for calculating astronomical sun times.
|
|
149
112
|
* @param {Temporal.PlainDate} date
|
|
150
|
-
*
|
|
151
|
-
* @see #setAstronomicalCalculator(AstronomicalCalculator) for changing the calculator class.
|
|
152
113
|
*/
|
|
153
114
|
constructor(geoLocation: GeoLocation, date: Temporal.PlainDate);
|
|
154
115
|
/**
|
|
@@ -163,8 +124,8 @@ export declare class NOAACalculator {
|
|
|
163
124
|
* a point, and because the atmosphere refracts light, this 90° zenith does not, in fact, correspond to true
|
|
164
125
|
* sunset or sunrise, instead the center of the Sun's disk must lie just below the horizon for the upper edge to be
|
|
165
126
|
* obscured. This means that a zenith of just above 90° must be used. The Sun subtends an angle of 16 minutes of
|
|
166
|
-
* arc
|
|
167
|
-
* 34 minutes or so
|
|
127
|
+
* arc, and atmospheric refraction accounts for
|
|
128
|
+
* 34 minutes or so, giving a total of 50
|
|
168
129
|
* arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333° for true sunrise/sunset.
|
|
169
130
|
*/
|
|
170
131
|
/** Sun's zenith at civil twilight (96°). */
|
|
@@ -185,23 +146,22 @@ export declare class NOAACalculator {
|
|
|
185
146
|
private geoLocation;
|
|
186
147
|
/**
|
|
187
148
|
* The getSunrise method Returns a `Date` representing the
|
|
188
|
-
* {@link
|
|
189
|
-
* for the calculation uses {@link
|
|
190
|
-
* {@link
|
|
191
|
-
*
|
|
192
|
-
* and 16 archminutes for the sun's radius for a total of {@link
|
|
193
|
-
* See documentation for the specific implementation of the {@link AstronomicalCalculator} that you are using.
|
|
149
|
+
* {@link getElevationAdjustment elevation adjusted} sunrise time. The zenith used
|
|
150
|
+
* for the calculation uses {@link GEOMETRIC_ZENITH geometric zenith} of 90° plus
|
|
151
|
+
* {@link getElevationAdjustment}. This is adjusted
|
|
152
|
+
* to add approximately 50/60 of a degree to account for 34 archminutes of refraction
|
|
153
|
+
* and 16 archminutes for the sun's radius for a total of {@link adjustZenith 90.83333°}.
|
|
194
154
|
*
|
|
195
155
|
* @return {Temporal.ZonedDateTime | null} the `Date` representing the exact sunrise time. If the calculation can't be computed such as
|
|
196
156
|
* in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
|
|
197
157
|
* does not set, a null will be returned. See detailed explanation on top of the page.
|
|
198
|
-
* @see
|
|
199
|
-
* @see
|
|
200
|
-
* @see
|
|
158
|
+
* @see adjustZenith
|
|
159
|
+
* @see getSeaLevelSunrise()
|
|
160
|
+
* @see getUTCSunrise
|
|
201
161
|
*/
|
|
202
162
|
getSunrise(): Temporal.ZonedDateTime | null;
|
|
203
163
|
/**
|
|
204
|
-
* A method that returns the sunrise without {@link
|
|
164
|
+
* A method that returns the sunrise without {@link getElevationAdjustment elevation
|
|
205
165
|
* adjustment}. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,
|
|
206
166
|
* something that is not affected by elevation. This method returns sunrise calculated at sea level. This forms the
|
|
207
167
|
* base for dawn calculations that are calculated as a dip below the horizon before sunrise.
|
|
@@ -209,44 +169,44 @@ export declare class NOAACalculator {
|
|
|
209
169
|
* @return {Temporal.ZonedDateTime | null} the `Date` representing the exact sea-level sunrise time. If the calculation can't be computed
|
|
210
170
|
* such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
|
|
211
171
|
* where it does not set, a null will be returned. See detailed explanation on top of the page.
|
|
212
|
-
* @see
|
|
213
|
-
* @see
|
|
214
|
-
* @see
|
|
172
|
+
* @see getSunrise
|
|
173
|
+
* @see getUTCSeaLevelSunrise
|
|
174
|
+
* @see getSeaLevelSunset()
|
|
215
175
|
*/
|
|
216
176
|
getSeaLevelSunrise(): Temporal.ZonedDateTime | null;
|
|
217
177
|
/**
|
|
218
|
-
* A method that returns the beginning of civil twilight (dawn) using a zenith of {@link
|
|
178
|
+
* A method that returns the beginning of civil twilight (dawn) using a zenith of {@link CIVIL_ZENITH 96°}.
|
|
219
179
|
*
|
|
220
180
|
* @return {Temporal.ZonedDateTime | null} The `Date` of the beginning of civil twilight using a zenith of 96°. If the calculation
|
|
221
181
|
* can't be computed, null will be returned. See detailed explanation on top of the page.
|
|
222
|
-
* @see
|
|
182
|
+
* @see CIVIL_ZENITH
|
|
223
183
|
*/
|
|
224
184
|
getBeginCivilTwilight(): Temporal.ZonedDateTime | null;
|
|
225
185
|
/**
|
|
226
|
-
* A method that returns the beginning of nautical twilight using a zenith of {@link
|
|
186
|
+
* A method that returns the beginning of nautical twilight using a zenith of {@link NAUTICAL_ZENITH 102°}.
|
|
227
187
|
*
|
|
228
188
|
* @return {Temporal.ZonedDateTime | null} The `Date` of the beginning of nautical twilight using a zenith of 102°. If the
|
|
229
189
|
* calculation can't be computed null will be returned. See detailed explanation on top of the page.
|
|
230
|
-
* @see
|
|
190
|
+
* @see NAUTICAL_ZENITH
|
|
231
191
|
*/
|
|
232
192
|
getBeginNauticalTwilight(): Temporal.ZonedDateTime | null;
|
|
233
193
|
/**
|
|
234
|
-
* A method that returns the beginning of astronomical twilight using a zenith of {@link
|
|
194
|
+
* A method that returns the beginning of astronomical twilight using a zenith of {@link ASTRONOMICAL_ZENITH
|
|
235
195
|
* 108°}.
|
|
236
196
|
*
|
|
237
197
|
* @return {Temporal.ZonedDateTime | null} The `Date` of the beginning of astronomical twilight using a zenith of 108°. If the
|
|
238
198
|
* calculation can't be computed, null will be returned. See detailed explanation on top of the page.
|
|
239
|
-
* @see
|
|
199
|
+
* @see ASTRONOMICAL_ZENITH
|
|
240
200
|
*/
|
|
241
201
|
getBeginAstronomicalTwilight(): Temporal.ZonedDateTime | null;
|
|
242
202
|
/**
|
|
243
203
|
* The getSunset method Returns a `Date` representing the
|
|
244
|
-
* {@link
|
|
245
|
-
* the calculation uses {@link
|
|
246
|
-
* {@link
|
|
247
|
-
*
|
|
248
|
-
* and 16 archminutes for the sun's radius for a total of {@link
|
|
249
|
-
*
|
|
204
|
+
* {@link getElevationAdjustment elevation adjusted} sunset time. The zenith used for
|
|
205
|
+
* the calculation uses {@link GEOMETRIC_ZENITH geometric zenith} of 90° plus
|
|
206
|
+
* {@link getElevationAdjustment}. This is adjusted
|
|
207
|
+
* to add approximately 50/60 of a degree to account for 34 archminutes of refraction
|
|
208
|
+
* and 16 archminutes for the sun's radius for a total of {@link adjustZenith 90.83333°}.
|
|
209
|
+
* Note:
|
|
250
210
|
* In certain cases the calculates sunset will occur before sunrise. This will typically happen when a timezone
|
|
251
211
|
* other than the local timezone is used (calculating Los Angeles sunset using a GMT timezone for example). In this
|
|
252
212
|
* case the sunset date will be incremented to the following date.
|
|
@@ -254,13 +214,13 @@ export declare class NOAACalculator {
|
|
|
254
214
|
* @return {Temporal.ZonedDateTime | null} The `Date` representing the exact sunset time. If the calculation can't be computed such as in
|
|
255
215
|
* the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
|
|
256
216
|
* does not set, a null will be returned. See detailed explanation on top of the page.
|
|
257
|
-
* @see
|
|
258
|
-
* @see
|
|
259
|
-
* @see
|
|
217
|
+
* @see adjustZenith
|
|
218
|
+
* @see getSeaLevelSunset()
|
|
219
|
+
* @see getUTCSunset
|
|
260
220
|
*/
|
|
261
221
|
getSunset(): Temporal.ZonedDateTime | null;
|
|
262
222
|
/**
|
|
263
|
-
* A method that returns the sunset without {@link
|
|
223
|
+
* A method that returns the sunset without {@link getElevationAdjustment elevation
|
|
264
224
|
* adjustment}. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,
|
|
265
225
|
* something that is not affected by elevation. This method returns sunset calculated at sea level. This forms the
|
|
266
226
|
* base for dusk calculations that are calculated as a dip below the horizon after sunset.
|
|
@@ -268,34 +228,34 @@ export declare class NOAACalculator {
|
|
|
268
228
|
* @return {Temporal.ZonedDateTime | null} The `Date` representing the exact sea-level sunset time. If the calculation can't be computed
|
|
269
229
|
* such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
|
|
270
230
|
* where it does not set, a null will be returned. See detailed explanation on top of the page.
|
|
271
|
-
* @see
|
|
272
|
-
* @see
|
|
231
|
+
* @see getSunset
|
|
232
|
+
* @see getUTCSeaLevelSunset
|
|
273
233
|
*/
|
|
274
234
|
getSeaLevelSunset(): Temporal.ZonedDateTime | null;
|
|
275
235
|
/**
|
|
276
|
-
* A method that returns the end of civil twilight using a zenith of {@link
|
|
236
|
+
* A method that returns the end of civil twilight using a zenith of {@link CIVIL_ZENITH 96°}.
|
|
277
237
|
*
|
|
278
|
-
* @return {Temporal.ZonedDateTime | null} The `Date` of the end of civil twilight using a zenith of {@link
|
|
238
|
+
* @return {Temporal.ZonedDateTime | null} The `Date` of the end of civil twilight using a zenith of {@link CIVIL_ZENITH 96°}. If
|
|
279
239
|
* the calculation can't be computed, null will be returned. See detailed explanation on top of the page.
|
|
280
|
-
* @see
|
|
240
|
+
* @see CIVIL_ZENITH
|
|
281
241
|
*/
|
|
282
242
|
getEndCivilTwilight(): Temporal.ZonedDateTime | null;
|
|
283
243
|
/**
|
|
284
|
-
* A method that returns the end of nautical twilight using a zenith of {@link
|
|
244
|
+
* A method that returns the end of nautical twilight using a zenith of {@link NAUTICAL_ZENITH 102°}.
|
|
285
245
|
*
|
|
286
|
-
* @return {Temporal.ZonedDateTime | null} The `Date` of the end of nautical twilight using a zenith of {@link
|
|
246
|
+
* @return {Temporal.ZonedDateTime | null} The `Date` of the end of nautical twilight using a zenith of {@link NAUTICAL_ZENITH 102°}
|
|
287
247
|
* . If the calculation can't be computed, null will be returned. See detailed explanation on top of the
|
|
288
248
|
* page.
|
|
289
|
-
* @see
|
|
249
|
+
* @see NAUTICAL_ZENITH
|
|
290
250
|
*/
|
|
291
251
|
getEndNauticalTwilight(): Temporal.ZonedDateTime | null;
|
|
292
252
|
/**
|
|
293
|
-
* A method that returns the end of astronomical twilight using a zenith of {@link
|
|
253
|
+
* A method that returns the end of astronomical twilight using a zenith of {@link ASTRONOMICAL_ZENITH 108°}.
|
|
294
254
|
*
|
|
295
|
-
* @return {Temporal.ZonedDateTime | null} The `Date` of the end of astronomical twilight using a zenith of {@link
|
|
255
|
+
* @return {Temporal.ZonedDateTime | null} The `Date` of the end of astronomical twilight using a zenith of {@link ASTRONOMICAL_ZENITH
|
|
296
256
|
* 108°}. If the calculation can't be computed, null will be returned. See detailed explanation on top
|
|
297
257
|
* of the page.
|
|
298
|
-
* @see
|
|
258
|
+
* @see ASTRONOMICAL_ZENITH
|
|
299
259
|
*/
|
|
300
260
|
getEndAstronomicalTwilight(): Temporal.ZonedDateTime | null;
|
|
301
261
|
/**
|
|
@@ -313,30 +273,30 @@ export declare class NOAACalculator {
|
|
|
313
273
|
static getTimeOffset(time: Temporal.ZonedDateTime | null, offset: number): Temporal.ZonedDateTime | null;
|
|
314
274
|
/**
|
|
315
275
|
* A utility method that returns the time of an offset by degrees below or above the horizon of
|
|
316
|
-
* {@link
|
|
317
|
-
* before sunrise, an offset of 14 + {@link
|
|
276
|
+
* {@link getSunrise() sunrise}. Note that the degree offset is from the vertical, so for a calculation of 14°
|
|
277
|
+
* before sunrise, an offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.
|
|
318
278
|
*
|
|
319
279
|
* @param {number} offsetZenith
|
|
320
|
-
* the degrees before {@link
|
|
280
|
+
* the degrees before {@link getSunrise} to use in the calculation. For time after sunrise use
|
|
321
281
|
* negative numbers. Note that the degree offset is from the vertical, so for a calculation of 14°
|
|
322
|
-
* before sunrise, an offset of 14 + {@link
|
|
282
|
+
* before sunrise, an offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a
|
|
323
283
|
* parameter.
|
|
324
|
-
* @return {Temporal.ZonedDateTime | null} The `Date` of the offset after (or before) {@link
|
|
284
|
+
* @return {Temporal.ZonedDateTime | null} The `Date` of the offset after (or before) {@link getSunrise}. If the calculation
|
|
325
285
|
* can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
|
|
326
286
|
* not rise, and one where it does not set, a null will be returned. See detailed explanation on top of the
|
|
327
287
|
* page.
|
|
328
288
|
*/
|
|
329
289
|
getSunriseOffsetByDegrees(offsetZenith: number): Temporal.ZonedDateTime | null;
|
|
330
290
|
/**
|
|
331
|
-
* A utility method that returns the time of an offset by degrees below or above the horizon of {@link
|
|
291
|
+
* A utility method that returns the time of an offset by degrees below or above the horizon of {@link getSunset()
|
|
332
292
|
* sunset}. Note that the degree offset is from the vertical, so for a calculation of 14° after sunset, an
|
|
333
|
-
* offset of 14 + {@link
|
|
293
|
+
* offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.
|
|
334
294
|
*
|
|
335
295
|
* @param {number} offsetZenith
|
|
336
|
-
* the degrees after {@link
|
|
296
|
+
* the degrees after {@link getSunset} to use in the calculation. For time before sunset use negative
|
|
337
297
|
* numbers. Note that the degree offset is from the vertical, so for a calculation of 14° after
|
|
338
|
-
* sunset, an offset of 14 + {@link
|
|
339
|
-
* @return {Temporal.ZonedDateTime | null} The `Date`of the offset after (or before) {@link
|
|
298
|
+
* sunset, an offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.
|
|
299
|
+
* @return {Temporal.ZonedDateTime | null} The `Date`of the offset after (or before) {@link getSunset}. If the calculation can't
|
|
340
300
|
* be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
|
|
341
301
|
* rise, and one where it does not set, a null will be returned. See detailed explanation on top of the
|
|
342
302
|
* page.
|
|
@@ -350,7 +310,7 @@ export declare class NOAACalculator {
|
|
|
350
310
|
* the degrees below the horizon. For time after sunrise use negative numbers.
|
|
351
311
|
* @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
|
|
352
312
|
* Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
|
|
353
|
-
* not set,
|
|
313
|
+
* not set, `NaN` will be returned. See detailed explanation on top of the page.
|
|
354
314
|
*/
|
|
355
315
|
getUTCSunrise0(zenith: number): number;
|
|
356
316
|
/**
|
|
@@ -363,9 +323,9 @@ export declare class NOAACalculator {
|
|
|
363
323
|
* the degrees below the horizon. For time after sunrise use negative numbers.
|
|
364
324
|
* @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
|
|
365
325
|
* Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
|
|
366
|
-
* not set,
|
|
367
|
-
* @see
|
|
368
|
-
* @see
|
|
326
|
+
* not set, `NaN` will be returned. See detailed explanation on top of the page.
|
|
327
|
+
* @see getUTCSunrise
|
|
328
|
+
* @see getUTCSeaLevelSunset
|
|
369
329
|
*/
|
|
370
330
|
getUTCSeaLevelSunrise(zenith: number): number;
|
|
371
331
|
/**
|
|
@@ -376,8 +336,8 @@ export declare class NOAACalculator {
|
|
|
376
336
|
* the degrees below the horizon. For time after sunset use negative numbers.
|
|
377
337
|
* @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
|
|
378
338
|
* Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
|
|
379
|
-
* not set,
|
|
380
|
-
* @see
|
|
339
|
+
* not set, `NaN` will be returned. See detailed explanation on top of the page.
|
|
340
|
+
* @see getUTCSeaLevelSunset
|
|
381
341
|
*/
|
|
382
342
|
getUTCSunset0(zenith: number): number;
|
|
383
343
|
/**
|
|
@@ -391,9 +351,9 @@ export declare class NOAACalculator {
|
|
|
391
351
|
* the degrees below the horizon. For time before sunset use negative numbers.
|
|
392
352
|
* @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the
|
|
393
353
|
* Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
|
|
394
|
-
* not set,
|
|
395
|
-
* @see
|
|
396
|
-
* @see
|
|
354
|
+
* not set, `NaN` will be returned. See detailed explanation on top of the page.
|
|
355
|
+
* @see getUTCSunset
|
|
356
|
+
* @see getUTCSeaLevelSunrise
|
|
397
357
|
*/
|
|
398
358
|
getUTCSeaLevelSunset(zenith: number): number;
|
|
399
359
|
/**
|
|
@@ -407,9 +367,9 @@ export declare class NOAACalculator {
|
|
|
407
367
|
* Method to return the adjustment to the zenith required to account for the elevation. Since a person at a higher
|
|
408
368
|
* elevation can see farther below the horizon, the calculation for sunrise / sunset is calculated below the horizon
|
|
409
369
|
* used at sea level. This is only used for sunrise and sunset and not times before or after it such as
|
|
410
|
-
* {@link
|
|
370
|
+
* {@link getBeginNauticalTwilight() nautical twilight} since those
|
|
411
371
|
* calculations are based on the level of available light at the given dip below the horizon, something that is not
|
|
412
|
-
* affected by elevation, the adjustment should only made if the zenith == 90° {@link
|
|
372
|
+
* affected by elevation, the adjustment should only made if the zenith == 90° {@link adjustZenith adjusted}
|
|
413
373
|
* for refraction and solar radius. The algorithm used is
|
|
414
374
|
*
|
|
415
375
|
* <pre>
|
|
@@ -437,30 +397,30 @@ export declare class NOAACalculator {
|
|
|
437
397
|
* is not a point, and because the atmosphere refracts light, this 90° zenith does not, in fact, correspond to
|
|
438
398
|
* true sunset or sunrise, instead the centre of the Sun's disk must lie just below the horizon for the upper edge
|
|
439
399
|
* to be obscured. This means that a zenith of just above 90° must be used. The Sun subtends an angle of 16
|
|
440
|
-
* minutes of arc
|
|
441
|
-
* accounts for 34 minutes or so
|
|
400
|
+
* minutes of arc, and atmospheric refraction
|
|
401
|
+
* accounts for 34 minutes or so, giving a total
|
|
442
402
|
* of 50 arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333° for true sunrise/sunset. Since a
|
|
443
403
|
* person at an elevation can see blow the horizon of a person at sea level, this will also adjust the zenith to
|
|
444
404
|
* account for elevation if available. Note that this will only adjust the value if the zenith is exactly 90 degrees.
|
|
445
405
|
* For values below and above this no correction is done. As an example, astronomical twilight is when the sun is
|
|
446
|
-
* 18° below the horizon or {@link
|
|
406
|
+
* 18° below the horizon or {@link ASTRONOMICAL_ZENITH 108°
|
|
447
407
|
* below the zenith}. This is traditionally calculated with none of the above mentioned adjustments. The same goes
|
|
448
408
|
* for various <em>tzais</em> and <em>alos</em> times such as the
|
|
449
409
|
* {@link ZmanimCalendar#ZENITH_16_POINT_1 16.1°} dip used in
|
|
450
|
-
* {@link ComplexZmanimCalendar#getAlos16Point1Degrees
|
|
410
|
+
* {@link ComplexZmanimCalendar#getAlos16Point1Degrees}.
|
|
451
411
|
*
|
|
452
412
|
* @param {number} zenith
|
|
453
|
-
* the azimuth below the vertical zenith of 90°. For sunset typically the {@link
|
|
454
|
-
* zenith} used for the calculation uses geometric zenith of 90° and {@link
|
|
413
|
+
* the azimuth below the vertical zenith of 90°. For sunset typically the {@link adjustZenith
|
|
414
|
+
* zenith} used for the calculation uses geometric zenith of 90° and {@link adjustZenith adjusts}
|
|
455
415
|
* this slightly to account for solar refraction and the sun's radius. Another example would be
|
|
456
|
-
* {@link
|
|
457
|
-
* {@link
|
|
416
|
+
* {@link getEndNauticalTwilight} that passes
|
|
417
|
+
* {@link NAUTICAL_ZENITH} to this method.
|
|
458
418
|
* @param {number} elevation
|
|
459
419
|
* elevation in Meters.
|
|
460
|
-
* @return {number} The zenith adjusted to include the
|
|
461
|
-
*
|
|
420
|
+
* @return {number} The zenith adjusted to include the sun's radius, refracton
|
|
421
|
+
* and {@link getElevationAdjustment elevation} adjustment. This will only be adjusted for
|
|
462
422
|
* sunrise and sunset (if the zenith == 90°)
|
|
463
|
-
* @see
|
|
423
|
+
* @see getElevationAdjustment
|
|
464
424
|
*/
|
|
465
425
|
adjustZenith(zenith: number, elevation: number): number;
|
|
466
426
|
/**
|
|
@@ -474,18 +434,48 @@ export declare class NOAACalculator {
|
|
|
474
434
|
*/
|
|
475
435
|
private static readonly JULIAN_DAYS_PER_CENTURY;
|
|
476
436
|
/**
|
|
477
|
-
*
|
|
437
|
+
* A method that calculates UTC sunrise as well as any time based on an angle above or below sunrise.
|
|
438
|
+
* @param date
|
|
439
|
+
* Used to calculate day of year.
|
|
440
|
+
* @param geoLocation
|
|
441
|
+
* The location information used for astronomical calculating sun times.
|
|
442
|
+
* @param zenith
|
|
443
|
+
* the azimuth below the vertical zenith of 90 degrees. for sunrise typically the {@link adjustZenith
|
|
444
|
+
* zenith} used for the calculation uses geometric zenith of 90° and {@link adjustZenith adjusts}
|
|
445
|
+
* this slightly to account for solar refraction and the sun's radius. Another example would be
|
|
446
|
+
* {@link getBeginNauticalTwilight} that passes
|
|
447
|
+
* {@link NAUTICAL_ZENITH} to this method.
|
|
448
|
+
* @param adjustForElevation
|
|
449
|
+
* Should the time be adjusted for elevation
|
|
450
|
+
* @return The UTC time of sunrise in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in
|
|
451
|
+
* the calculation (expected behavior for some locations such as near the poles,
|
|
452
|
+
* `NaN` will be returned.
|
|
478
453
|
*/
|
|
479
454
|
getUTCSunrise(date: Temporal.PlainDate, geoLocation: GeoLocation, zenith: number, adjustForElevation: boolean): number;
|
|
480
455
|
/**
|
|
481
|
-
*
|
|
456
|
+
* A method that calculates UTC sunset as well as any time based on an angle above or below sunset.
|
|
457
|
+
* @param date
|
|
458
|
+
* Used to calculate day of year.
|
|
459
|
+
* @param geoLocation
|
|
460
|
+
* The location information used for astronomical calculating sun times.
|
|
461
|
+
* @param zenith
|
|
462
|
+
* the azimuth below the vertical zenith of 90°. For sunset typically the {@link adjustZenith
|
|
463
|
+
* zenith} used for the calculation uses geometric zenith of 90° and {@link adjustZenith adjusts}
|
|
464
|
+
* this slightly to account for solar refraction and the sun's radius. Another example would be
|
|
465
|
+
* {@link getEndNauticalTwilight} that passes
|
|
466
|
+
* {@link NAUTICAL_ZENITH} to this method.
|
|
467
|
+
* @param adjustForElevation
|
|
468
|
+
* Should the time be adjusted for elevation
|
|
469
|
+
* @return The UTC time of sunset in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in
|
|
470
|
+
* the calculation (expected behavior for some locations such as near the poles,
|
|
471
|
+
* `NaN` will be returned.
|
|
482
472
|
*/
|
|
483
473
|
getUTCSunset(date: Temporal.PlainDate, geoLocation: GeoLocation, zenith: number, adjustForElevation: boolean): number;
|
|
484
474
|
/**
|
|
485
475
|
* A utility method that will allow the calculation of a temporal (solar) hour based on the sunrise and sunset
|
|
486
476
|
* passed as parameters to this method. An example of the use of this method would be the calculation of a
|
|
487
|
-
* non-elevation adjusted temporal hour by passing in {@link
|
|
488
|
-
* {@link
|
|
477
|
+
* non-elevation adjusted temporal hour by passing in {@link getSeaLevelSunrise() sea level sunrise} and
|
|
478
|
+
* {@link getSeaLevelSunset() sea level sunset} as parameters.
|
|
489
479
|
*
|
|
490
480
|
* @param {Temporal.ZonedDateTime | null} startOfDay
|
|
491
481
|
* The start of the day.
|
|
@@ -493,9 +483,9 @@ export declare class NOAACalculator {
|
|
|
493
483
|
* The end of the day.
|
|
494
484
|
*
|
|
495
485
|
* @return {number} the <code>long</code> millisecond length of the temporal hour. If the calculation can't be computed a
|
|
496
|
-
*
|
|
486
|
+
* `NaN` will be returned. See detailed explanation on top of the page.
|
|
497
487
|
*
|
|
498
|
-
* @see
|
|
488
|
+
* @see getTemporalHour()
|
|
499
489
|
*/
|
|
500
490
|
getTemporalHour(startOfDay?: Temporal.ZonedDateTime | null, endOfDay?: Temporal.ZonedDateTime | null): number;
|
|
501
491
|
/**
|
|
@@ -650,8 +640,7 @@ export declare class NOAACalculator {
|
|
|
650
640
|
private static getSunHourAngleAtSunrise;
|
|
651
641
|
/**
|
|
652
642
|
* Returns the <a href="http://en.wikipedia.org/wiki/Hour_angle">hour angle</a> of the sun at sunset for the
|
|
653
|
-
* latitude.
|
|
654
|
-
* duplication of code.
|
|
643
|
+
* latitude.
|
|
655
644
|
* @private
|
|
656
645
|
* @param {number} lat
|
|
657
646
|
* the latitude of observer in degrees
|