@hebcal/noaa 0.8.12 → 0.8.14
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/dist/index.mjs +37 -63
- package/package.json +7 -6
package/dist/index.mjs
CHANGED
|
@@ -42,32 +42,16 @@ export class GeoLocation {
|
|
|
42
42
|
* the <code>TimeZone</code> for the location.
|
|
43
43
|
*/
|
|
44
44
|
constructor(name, latitude, longitude, elevation, timeZoneId) {
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
this.locationName = null;
|
|
45
49
|
this.setLocationName(name);
|
|
46
50
|
this.setLatitude(latitude);
|
|
47
51
|
this.setLongitude(longitude);
|
|
48
52
|
this.setElevation(elevation);
|
|
49
53
|
this.setTimeZone(timeZoneId);
|
|
50
54
|
}
|
|
51
|
-
/**
|
|
52
|
-
* @private
|
|
53
|
-
*/
|
|
54
|
-
latitude;
|
|
55
|
-
/**
|
|
56
|
-
* @private
|
|
57
|
-
*/
|
|
58
|
-
longitude;
|
|
59
|
-
/**
|
|
60
|
-
* @private
|
|
61
|
-
*/
|
|
62
|
-
locationName = null;
|
|
63
|
-
/**
|
|
64
|
-
* @private
|
|
65
|
-
*/
|
|
66
|
-
timeZoneId;
|
|
67
|
-
/**
|
|
68
|
-
* @private
|
|
69
|
-
*/
|
|
70
|
-
elevation;
|
|
71
55
|
/**
|
|
72
56
|
* Method to get the elevation in Meters.
|
|
73
57
|
*
|
|
@@ -190,39 +174,6 @@ export class NOAACalculator {
|
|
|
190
174
|
this.date = date;
|
|
191
175
|
this.geoLocation = geoLocation;
|
|
192
176
|
}
|
|
193
|
-
/**
|
|
194
|
-
* The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°
|
|
195
|
-
* @private
|
|
196
|
-
*/
|
|
197
|
-
static GEOMETRIC_ZENITH = 90;
|
|
198
|
-
/**
|
|
199
|
-
* Default value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle that the
|
|
200
|
-
* center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the Earth
|
|
201
|
-
* were without an atmosphere, true sunset and sunrise would correspond to a 90° zenith. Because the Sun is not
|
|
202
|
-
* a point, and because the atmosphere refracts light, this 90° zenith does not, in fact, correspond to true
|
|
203
|
-
* sunset or sunrise, instead the center of the Sun's disk must lie just below the horizon for the upper edge to be
|
|
204
|
-
* obscured. This means that a zenith of just above 90° must be used. The Sun subtends an angle of 16 minutes of
|
|
205
|
-
* arc, and atmospheric refraction accounts for
|
|
206
|
-
* 34 minutes or so, giving a total of 50
|
|
207
|
-
* arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333° for true sunrise/sunset.
|
|
208
|
-
*/
|
|
209
|
-
// const ZENITH: number = GEOMETRIC_ZENITH + 5.0 / 6.0;
|
|
210
|
-
/** Sun's zenith at civil twilight (96°). */
|
|
211
|
-
static CIVIL_ZENITH = 96;
|
|
212
|
-
/** Sun's zenith at nautical twilight (102°). */
|
|
213
|
-
static NAUTICAL_ZENITH = 102;
|
|
214
|
-
/** Sun's zenith at astronomical twilight (108°). */
|
|
215
|
-
static ASTRONOMICAL_ZENITH = 108;
|
|
216
|
-
/**
|
|
217
|
-
* The Java Calendar encapsulated by this class to track the current date used by the class
|
|
218
|
-
* @private
|
|
219
|
-
*/
|
|
220
|
-
date;
|
|
221
|
-
/**
|
|
222
|
-
* the {@link GeoLocation} used for calculations.
|
|
223
|
-
* @private
|
|
224
|
-
*/
|
|
225
|
-
geoLocation;
|
|
226
177
|
/**
|
|
227
178
|
* The getSunrise method Returns a `Date` representing the
|
|
228
179
|
* {@link getElevationAdjustment elevation adjusted} sunrise time. The zenith used
|
|
@@ -572,16 +523,6 @@ export class NOAACalculator {
|
|
|
572
523
|
}
|
|
573
524
|
return adjustedZenith;
|
|
574
525
|
}
|
|
575
|
-
/**
|
|
576
|
-
* The <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> of January 1, 2000
|
|
577
|
-
* @private
|
|
578
|
-
*/
|
|
579
|
-
static JULIAN_DAY_JAN_1_2000 = 2451545;
|
|
580
|
-
/**
|
|
581
|
-
* Julian days per century
|
|
582
|
-
* @private
|
|
583
|
-
*/
|
|
584
|
-
static JULIAN_DAYS_PER_CENTURY = 36525;
|
|
585
526
|
/**
|
|
586
527
|
* A method that calculates UTC sunrise as well as any time based on an angle above or below sunrise.
|
|
587
528
|
* @param date
|
|
@@ -1121,3 +1062,36 @@ export class NOAACalculator {
|
|
|
1121
1062
|
return timeUTC;
|
|
1122
1063
|
}
|
|
1123
1064
|
}
|
|
1065
|
+
/**
|
|
1066
|
+
* The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°
|
|
1067
|
+
* @private
|
|
1068
|
+
*/
|
|
1069
|
+
NOAACalculator.GEOMETRIC_ZENITH = 90;
|
|
1070
|
+
/**
|
|
1071
|
+
* Default value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle that the
|
|
1072
|
+
* center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the Earth
|
|
1073
|
+
* were without an atmosphere, true sunset and sunrise would correspond to a 90° zenith. Because the Sun is not
|
|
1074
|
+
* a point, and because the atmosphere refracts light, this 90° zenith does not, in fact, correspond to true
|
|
1075
|
+
* sunset or sunrise, instead the center of the Sun's disk must lie just below the horizon for the upper edge to be
|
|
1076
|
+
* obscured. This means that a zenith of just above 90° must be used. The Sun subtends an angle of 16 minutes of
|
|
1077
|
+
* arc, and atmospheric refraction accounts for
|
|
1078
|
+
* 34 minutes or so, giving a total of 50
|
|
1079
|
+
* arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333° for true sunrise/sunset.
|
|
1080
|
+
*/
|
|
1081
|
+
// const ZENITH: number = GEOMETRIC_ZENITH + 5.0 / 6.0;
|
|
1082
|
+
/** Sun's zenith at civil twilight (96°). */
|
|
1083
|
+
NOAACalculator.CIVIL_ZENITH = 96;
|
|
1084
|
+
/** Sun's zenith at nautical twilight (102°). */
|
|
1085
|
+
NOAACalculator.NAUTICAL_ZENITH = 102;
|
|
1086
|
+
/** Sun's zenith at astronomical twilight (108°). */
|
|
1087
|
+
NOAACalculator.ASTRONOMICAL_ZENITH = 108;
|
|
1088
|
+
/**
|
|
1089
|
+
* The <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> of January 1, 2000
|
|
1090
|
+
* @private
|
|
1091
|
+
*/
|
|
1092
|
+
NOAACalculator.JULIAN_DAY_JAN_1_2000 = 2451545;
|
|
1093
|
+
/**
|
|
1094
|
+
* Julian days per century
|
|
1095
|
+
* @private
|
|
1096
|
+
*/
|
|
1097
|
+
NOAACalculator.JULIAN_DAYS_PER_CENTURY = 36525;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/noaa",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.14",
|
|
4
4
|
"description": "sunrise and sunset via NOAA algorithm with elevation, based on KosherJava",
|
|
5
5
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
6
6
|
"contributors": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"types": "./dist/index.d.ts"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
-
"test": "
|
|
26
|
+
"test": "ava",
|
|
27
27
|
"build": "npm run build:cjs && mv dist/index.js dist/index.cjs && npm run build:es6 && mv dist/index.js dist/index.mjs",
|
|
28
28
|
"build:cjs": "tsc -p ./tsconfig-cjs.json",
|
|
29
29
|
"build:es6": "tsc",
|
|
@@ -43,11 +43,12 @@
|
|
|
43
43
|
"dist/*"
|
|
44
44
|
],
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@types/node": "20.
|
|
47
|
-
"
|
|
48
|
-
"
|
|
46
|
+
"@types/node": "20.12.7",
|
|
47
|
+
"ava": "^6.1.2",
|
|
48
|
+
"gts": "^5.3.0",
|
|
49
|
+
"typescript": "^5.4.5"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"temporal-polyfill": "^0.2.
|
|
52
|
+
"temporal-polyfill": "^0.2.4"
|
|
52
53
|
}
|
|
53
54
|
}
|