ootk 1.2.0 → 1.5.2
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/{asc → .asc}/asconfig.json +0 -0
- package/{asc → .asc}/assembly/index.ts +0 -0
- package/{asc → .asc}/ex/asconfig.json +0 -0
- package/{asc → .asc}/ex/assembly/index.ts +0 -0
- package/{asc → .asc}/ex/index.html +0 -0
- package/{asc → .asc}/ex/package.json +0 -0
- package/{asc → .asc}/ex/tests/index.js +0 -0
- package/{asc → .asc}/package.json +0 -0
- package/{asc → .asc}/tests/index.js +0 -0
- package/.eslintrc.json +5 -5
- package/LICENSE.MD +299 -21
- package/README.md +17 -22
- package/dist/objects/base-object.d.ts +40 -0
- package/dist/objects/detailed-sat.d.ts +66 -0
- package/dist/objects/index.d.ts +4 -0
- package/dist/objects/sat.d.ts +88 -0
- package/dist/objects/sensor.d.ts +40 -0
- package/dist/objects/space-object.d.ts +38 -0
- package/dist/objects/star.d.ts +46 -0
- package/dist/ootk.d.ts +16 -23
- package/dist/ootk.js +2 -1
- package/dist/ootk.js.LICENSE.txt +77 -0
- package/dist/{sgp4.d.ts → sgp4/sgp4.d.ts} +14 -21
- package/{lib/utils/TleFormatData.d.ts → dist/tle/tle-format-data.d.ts} +0 -0
- package/dist/{tle.d.ts → tle/tle.d.ts} +12 -16
- package/{lib → dist/transforms}/transforms.d.ts +12 -16
- package/dist/{types.d.ts → types/types.d.ts} +68 -0
- package/dist/utils/constants.d.ts +34 -0
- package/dist/utils/moon-math.d.ts +104 -0
- package/dist/utils/sun-math.d.ts +230 -0
- package/dist/utils/utils.d.ts +36 -0
- package/lib/objects/base-object.d.ts +40 -0
- package/lib/objects/base-object.js +109 -0
- package/lib/objects/base-object.js.map +1 -0
- package/lib/objects/detailed-sat.d.ts +66 -0
- package/lib/objects/detailed-sat.js +149 -0
- package/lib/objects/detailed-sat.js.map +1 -0
- package/lib/objects/index.d.ts +4 -0
- package/lib/objects/index.js +5 -0
- package/lib/objects/index.js.map +1 -0
- package/lib/objects/sat.d.ts +88 -0
- package/lib/objects/sat.js +141 -0
- package/lib/objects/sat.js.map +1 -0
- package/lib/objects/sensor.d.ts +40 -0
- package/lib/objects/sensor.js +88 -0
- package/lib/objects/sensor.js.map +1 -0
- package/lib/objects/space-object.d.ts +38 -0
- package/lib/objects/space-object.js +60 -0
- package/lib/objects/space-object.js.map +1 -0
- package/lib/objects/star.d.ts +46 -0
- package/lib/objects/star.js +91 -0
- package/lib/objects/star.js.map +1 -0
- package/lib/ootk.d.ts +16 -23
- package/lib/ootk.js +16 -23
- package/lib/ootk.js.map +1 -1
- package/lib/{sgp4.d.ts → sgp4/sgp4.d.ts} +14 -21
- package/lib/{sgp4.js → sgp4/sgp4.js} +35 -27
- package/lib/sgp4/sgp4.js.map +1 -0
- package/lib/tle/tle-format-data.d.ts +6 -0
- package/lib/{utils/TleFormatData.js → tle/tle-format-data.js} +1 -1
- package/lib/tle/tle-format-data.js.map +1 -0
- package/lib/{tle.d.ts → tle/tle.d.ts} +12 -16
- package/lib/{tle.js → tle/tle.js} +13 -17
- package/lib/tle/tle.js.map +1 -0
- package/{dist → lib/transforms}/transforms.d.ts +12 -16
- package/lib/{transforms.js → transforms/transforms.js} +12 -16
- package/lib/transforms/transforms.js.map +1 -0
- package/lib/{types.d.ts → types/types.d.ts} +68 -0
- package/lib/types/types.js +34 -0
- package/lib/types/types.js.map +1 -0
- package/lib/utils/constants.d.ts +13 -16
- package/lib/utils/constants.js +13 -16
- package/lib/utils/constants.js.map +1 -1
- package/lib/utils/moon-math.d.ts +104 -0
- package/lib/utils/moon-math.js +387 -0
- package/lib/utils/moon-math.js.map +1 -0
- package/lib/utils/sun-math.d.ts +230 -0
- package/lib/utils/sun-math.js +421 -0
- package/lib/utils/sun-math.js.map +1 -0
- package/lib/utils/utils.d.ts +36 -0
- package/lib/{utils.js → utils/utils.js} +18 -18
- package/lib/utils/utils.js.map +1 -0
- package/package.json +2 -1
- package/dist/sat.d.ts +0 -51
- package/dist/utils.d.ts +0 -36
- package/lib/sat.d.ts +0 -51
- package/lib/sat.js +0 -81
- package/lib/sat.js.map +0 -1
- package/lib/sgp4.js.map +0 -1
- package/lib/tle.js.map +0 -1
- package/lib/transforms.js.map +0 -1
- package/lib/types.js +0 -2
- package/lib/types.js.map +0 -1
- package/lib/utils/TleFormatData.js.map +0 -1
- package/lib/utils.d.ts +0 -36
- package/lib/utils.js.map +0 -1
|
@@ -5,25 +5,21 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @file The TLE module contains a collection of functions for working with TLEs.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* in the Software without restriction, including without limitation the rights
|
|
11
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* @license AGPL-3.0-or-later
|
|
9
|
+
* @Copyright (c) 2020-2022 Theodore Kruczek
|
|
14
10
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
11
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
12
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
13
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
17
14
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* SOFTWARE.
|
|
15
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
16
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
17
|
+
* See the GNU Affero General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
20
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
25
21
|
*/
|
|
26
|
-
import { Line1Data, Line2Data, TleLine1, TleLine2 } from '
|
|
22
|
+
import { Line1Data, Line2Data, TleLine1, TleLine2 } from '../types/types';
|
|
27
23
|
declare type TleData = {
|
|
28
24
|
satNum: number;
|
|
29
25
|
intlDes: string;
|
|
@@ -7,25 +7,21 @@
|
|
|
7
7
|
* in the original SGP4 library such as ECI to ECF and ECF to RAE. This was based
|
|
8
8
|
* on some of the functions in satellite.js.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* in the Software without restriction, including without limitation the rights
|
|
13
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
* furnished to do so, subject to the following conditions:
|
|
10
|
+
* @license AGPL-3.0-or-later
|
|
11
|
+
* @Copyright (c) 2020-2022 Theodore Kruczek
|
|
16
12
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
13
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
14
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
15
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
19
16
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* SOFTWARE.
|
|
17
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
18
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
19
|
+
* See the GNU Affero General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
22
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
27
23
|
*/
|
|
28
|
-
import { Degrees, EcfVec3, EciVec3, LlaVec3, Radians, RaeVec3, SezVec3 } from '
|
|
24
|
+
import { Degrees, EcfVec3, EciVec3, LlaVec3, Radians, RaeVec3, SezVec3 } from '../types/types';
|
|
29
25
|
declare class Transforms {
|
|
30
26
|
static getDegLat(radians: Radians): Degrees;
|
|
31
27
|
static getDegLon(radians: Radians): Degrees;
|
|
@@ -202,3 +202,71 @@ export declare type Line2Data = {
|
|
|
202
202
|
revNum: number;
|
|
203
203
|
checksum2: number;
|
|
204
204
|
};
|
|
205
|
+
export declare enum SpaceObjectType {
|
|
206
|
+
UNKNOWN = 0,
|
|
207
|
+
PAYLOAD = 1,
|
|
208
|
+
ROCKET_BODY = 2,
|
|
209
|
+
DEBRIS = 3,
|
|
210
|
+
SPECIAL = 4,
|
|
211
|
+
RADAR_MEASUREMENT = 5,
|
|
212
|
+
RADAR_TRACK = 6,
|
|
213
|
+
RADAR_OBJECT = 7,
|
|
214
|
+
BALLISTIC_MISSILE = 8,
|
|
215
|
+
STAR = 9,
|
|
216
|
+
INTERGOVERNMENTAL_ORGANIZATION = 10,
|
|
217
|
+
SUBORBITAL_PAYLOAD_OPERATOR = 11,
|
|
218
|
+
PAYLOAD_OWNER = 12,
|
|
219
|
+
METEOROLOGICAL_ROCKET_LAUNCH_AGENCY_OR_MANUFACTURER = 13,
|
|
220
|
+
PAYLOAD_MANUFACTURER = 14,
|
|
221
|
+
LAUNCH_AGENCY = 15,
|
|
222
|
+
LAUNCH_SITE = 16,
|
|
223
|
+
LAUNCH_POSITION = 17,
|
|
224
|
+
LAUNCH_FACILITY = 18,
|
|
225
|
+
CONTROL_FACILITY = 19,
|
|
226
|
+
GROUND_SENSOR_STATION = 20,
|
|
227
|
+
OPTICAL = 21,
|
|
228
|
+
MECHANICAL = 22,
|
|
229
|
+
PHASED_ARRAY_RADAR = 23,
|
|
230
|
+
OBSERVER = 24,
|
|
231
|
+
BISTATIC_RADIO_TELESCOPE = 25,
|
|
232
|
+
COUNTRY = 26,
|
|
233
|
+
LAUNCH_VEHICLE_MANUFACTURER = 27,
|
|
234
|
+
ENGINE_MANUFACTURER = 28
|
|
235
|
+
}
|
|
236
|
+
export declare type GreenwichMeanSiderealTime = number;
|
|
237
|
+
export declare type LaunchDetails = {
|
|
238
|
+
launchDate?: string;
|
|
239
|
+
launchMass?: string;
|
|
240
|
+
launchSite?: string;
|
|
241
|
+
launchVehicle?: string;
|
|
242
|
+
};
|
|
243
|
+
export declare type SpaceCraftDetails = {
|
|
244
|
+
lifetime?: string | number;
|
|
245
|
+
maneuver?: string;
|
|
246
|
+
manufacturer?: string;
|
|
247
|
+
motor?: string;
|
|
248
|
+
power?: string;
|
|
249
|
+
payload?: string;
|
|
250
|
+
purpose?: string;
|
|
251
|
+
shape?: string;
|
|
252
|
+
span?: string;
|
|
253
|
+
bus?: string;
|
|
254
|
+
configuration?: string;
|
|
255
|
+
equipment?: string;
|
|
256
|
+
dryMass?: string;
|
|
257
|
+
};
|
|
258
|
+
export declare type OperationsDetails = {
|
|
259
|
+
user?: string;
|
|
260
|
+
mission?: string;
|
|
261
|
+
owner?: string;
|
|
262
|
+
country?: string;
|
|
263
|
+
};
|
|
264
|
+
export declare type AzEl = {
|
|
265
|
+
az: Radians;
|
|
266
|
+
el: Radians;
|
|
267
|
+
};
|
|
268
|
+
export declare type Meters = number;
|
|
269
|
+
export declare type SunTime = {
|
|
270
|
+
solarNoon: Date;
|
|
271
|
+
nadir: Date;
|
|
272
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek.
|
|
3
|
+
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
|
|
4
|
+
* with satellites and other orbital objects.
|
|
5
|
+
*
|
|
6
|
+
* @file Commonly used constants.
|
|
7
|
+
*
|
|
8
|
+
* @license AGPL-3.0-or-later
|
|
9
|
+
* @Copyright (c) 2020-2022 Theodore Kruczek
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
12
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
13
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
14
|
+
*
|
|
15
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
16
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
17
|
+
* See the GNU Affero General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
20
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
export declare const PI: number;
|
|
23
|
+
export declare const TAU: number;
|
|
24
|
+
export declare const DEG2RAD: number;
|
|
25
|
+
export declare const x2o3: number;
|
|
26
|
+
export declare const temp4 = 1.5e-12;
|
|
27
|
+
export declare const RAD2DEG: number;
|
|
28
|
+
export declare const MINUTES_PER_DAY = 1440;
|
|
29
|
+
export declare const MS_PER_DAY = 86400000;
|
|
30
|
+
export declare const DAY_TO_MS = 1.15741e-8;
|
|
31
|
+
export declare const cMPerSec = 299792458;
|
|
32
|
+
export declare const cKmPerSec: number;
|
|
33
|
+
export declare const cKmPerMs: number;
|
|
34
|
+
export declare const RADIUS_OF_EARTH = 6371;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek.
|
|
3
|
+
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
|
|
4
|
+
* with satellites and other orbital objects.
|
|
5
|
+
*
|
|
6
|
+
* @file MoonMath is a an extension to SunMath for calculating the position of the moon
|
|
7
|
+
* and its phases. This was originally created by Vladimir Agafonkin. Robert Gester's
|
|
8
|
+
* update was referenced for documentation. There were a couple of bugs in both versions
|
|
9
|
+
* so there will be some differences if you are migrating from either to this library.
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* @license AGPL-3.0-or-later
|
|
13
|
+
* @Copyright (c) 2020-2022 Theodore Kruczek
|
|
14
|
+
*
|
|
15
|
+
* @Copyright (c) 2011-2015, Vladimir Agafonkin
|
|
16
|
+
* SunCalc is a JavaScript library for calculating sun/moon position and light phases.
|
|
17
|
+
* https://github.com/mourner/suncalc
|
|
18
|
+
*
|
|
19
|
+
* Reworked and enhanced by Robert Gester
|
|
20
|
+
* @Copyright (c) 2022 Robert Gester
|
|
21
|
+
* https://github.com/hypnos3/suncalc3
|
|
22
|
+
*
|
|
23
|
+
* moon calculations, based on http://aa.quae.nl/en/reken/hemelpositie.html formulas
|
|
24
|
+
*
|
|
25
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
26
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
27
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
28
|
+
*
|
|
29
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
30
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
31
|
+
* See the GNU Affero General Public License for more details.
|
|
32
|
+
*
|
|
33
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
34
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
35
|
+
*/
|
|
36
|
+
import { Radians } from '../ootk';
|
|
37
|
+
declare type MoonIlluminationData = {
|
|
38
|
+
fraction: number;
|
|
39
|
+
phase: any;
|
|
40
|
+
phaseValue: number;
|
|
41
|
+
angle: any;
|
|
42
|
+
next: {
|
|
43
|
+
value: number;
|
|
44
|
+
date: string;
|
|
45
|
+
type: string;
|
|
46
|
+
newMoon: {
|
|
47
|
+
value: any;
|
|
48
|
+
date: string;
|
|
49
|
+
};
|
|
50
|
+
fullMoon: {
|
|
51
|
+
value: any;
|
|
52
|
+
date: string;
|
|
53
|
+
};
|
|
54
|
+
firstQuarter: {
|
|
55
|
+
value: any;
|
|
56
|
+
date: string;
|
|
57
|
+
};
|
|
58
|
+
thirdQuarter: {
|
|
59
|
+
value: any;
|
|
60
|
+
date: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export declare class MoonMath {
|
|
65
|
+
static moonCoords(d: any): {
|
|
66
|
+
ra: number;
|
|
67
|
+
dec: number;
|
|
68
|
+
dist: number;
|
|
69
|
+
};
|
|
70
|
+
static hoursLater(date: Date, h: number): Date;
|
|
71
|
+
static getMoonPosition(date: any, lat: any, lon: any): {
|
|
72
|
+
az: number;
|
|
73
|
+
el: number;
|
|
74
|
+
rng: number;
|
|
75
|
+
parallacticAngle: number;
|
|
76
|
+
};
|
|
77
|
+
private static moonCycles;
|
|
78
|
+
/**
|
|
79
|
+
* calculations for illumination parameters of the moon,
|
|
80
|
+
* based on http://idlastro.gsfc.nasa.gov/ftp/pro/astro/mphase.pro formulas and
|
|
81
|
+
* Chapter 48 of "Astronomical Algorithms" 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.
|
|
82
|
+
* @param {number | Date} date Date object or timestamp for calculating moon-illumination
|
|
83
|
+
* @return {MoonIlluminationData} result object of moon-illumination
|
|
84
|
+
*/
|
|
85
|
+
static getMoonIllumination(date: number | Date): MoonIlluminationData;
|
|
86
|
+
/**
|
|
87
|
+
* calculations for moon rise/set times are based on http://www.stargazing.net/kepler/moonrise.html article
|
|
88
|
+
* @param {number|Date} dateValue Date object or timestamp for calculating moon-times
|
|
89
|
+
* @param {number} lat latitude for calculating moon-times
|
|
90
|
+
* @param {number} lon longitude for calculating moon-times
|
|
91
|
+
* @param {boolean} [isUtc] defines if the calculation should be in utc or local time (default is local)
|
|
92
|
+
* @return {IMoonTimes} result object of sunTime
|
|
93
|
+
*/
|
|
94
|
+
static getMoonTimes(dateValue: Date, lat: Radians, lon: Radians, isUtc?: boolean): {
|
|
95
|
+
rise: any;
|
|
96
|
+
set: any;
|
|
97
|
+
ye: any;
|
|
98
|
+
alwaysUp: any;
|
|
99
|
+
alwaysDown: any;
|
|
100
|
+
highest: any;
|
|
101
|
+
};
|
|
102
|
+
private static calculateRiseSetTimes;
|
|
103
|
+
}
|
|
104
|
+
export {};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek.
|
|
3
|
+
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
|
|
4
|
+
* with satellites and other orbital objects.
|
|
5
|
+
*
|
|
6
|
+
* @file SunMath is a collection of functions for calculating the position of the sun
|
|
7
|
+
* and other stars. This was originally created by Vladimir Agafonkin. Robert Gester's
|
|
8
|
+
* update was referenced for documentation. There were a couple of bugs in both versions
|
|
9
|
+
* so there will be some differences if you are migrating from either to this library.
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* @license AGPL-3.0-or-later
|
|
13
|
+
* @Copyright (c) 2020-2022 Theodore Kruczek
|
|
14
|
+
*
|
|
15
|
+
* @Copyright (c) 2011-2015, Vladimir Agafonkin
|
|
16
|
+
* SunCalc is a JavaScript library for calculating sun/moon position and light phases.
|
|
17
|
+
* https://github.com/mourner/suncalc
|
|
18
|
+
*
|
|
19
|
+
* Reworked and enhanced by Robert Gester
|
|
20
|
+
* @Copyright (c) 2022 Robert Gester
|
|
21
|
+
* https://github.com/hypnos3/suncalc3
|
|
22
|
+
*
|
|
23
|
+
* sun calculations are based on http://aa.quae.nl/en/reken/zonpositie.html formulas
|
|
24
|
+
*
|
|
25
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
26
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
27
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
28
|
+
*
|
|
29
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
30
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
31
|
+
* See the GNU Affero General Public License for more details.
|
|
32
|
+
*
|
|
33
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
34
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
35
|
+
*/
|
|
36
|
+
import { AzEl, Meters, SunTime } from '../types/types';
|
|
37
|
+
import { Degrees, Radians } from '../ootk';
|
|
38
|
+
export declare class SunMath {
|
|
39
|
+
private static readonly J1970;
|
|
40
|
+
private static readonly J2000;
|
|
41
|
+
private static readonly J0;
|
|
42
|
+
private static readonly e;
|
|
43
|
+
private static times;
|
|
44
|
+
private static julianCycle;
|
|
45
|
+
/**
|
|
46
|
+
* calculates the obderver angle
|
|
47
|
+
* @param {number} alt the observer altitude (in meters) relative to the horizon
|
|
48
|
+
* @returns {number} height for further calculations
|
|
49
|
+
*/
|
|
50
|
+
private static observerAngle;
|
|
51
|
+
/**
|
|
52
|
+
* get solar mean anomaly
|
|
53
|
+
* @param {number} d - julian day
|
|
54
|
+
* @returns {number} solar mean anomaly
|
|
55
|
+
*/
|
|
56
|
+
private static solarMeanAnomaly;
|
|
57
|
+
/**
|
|
58
|
+
* convert Julian calendar to date object
|
|
59
|
+
* @param {number} julian day number in Julian calendar to convert
|
|
60
|
+
* @return {number} result date as timestamp
|
|
61
|
+
*/
|
|
62
|
+
static julian2date(julian: number): Date;
|
|
63
|
+
/**
|
|
64
|
+
* get number of days for a dateValue since 2000
|
|
65
|
+
*
|
|
66
|
+
* See: https://en.wikipedia.org/wiki/Epoch_(astronomy)
|
|
67
|
+
*
|
|
68
|
+
* @param {number} date date as timestamp to get days
|
|
69
|
+
* @return {number} count of days
|
|
70
|
+
*/
|
|
71
|
+
static date2jSince2000(date: Date): number;
|
|
72
|
+
/**
|
|
73
|
+
* get right ascension
|
|
74
|
+
* @param {number} l - ecliptic longitude
|
|
75
|
+
* @param {number} b - ecliptic latitude
|
|
76
|
+
* @returns {number} right ascension
|
|
77
|
+
*/
|
|
78
|
+
static rightAscension(l: number, b: number): Radians;
|
|
79
|
+
/**
|
|
80
|
+
* get declination
|
|
81
|
+
* @param {number} l - ecliptic longitude
|
|
82
|
+
* @param {number} b - ecliptic latitude
|
|
83
|
+
* @returns {number} declination
|
|
84
|
+
*/
|
|
85
|
+
static declination(l: number, b: number): Radians;
|
|
86
|
+
/**
|
|
87
|
+
* get azimuth
|
|
88
|
+
* @param {number} H - siderealTime
|
|
89
|
+
* @param {Radians} phi - latitude
|
|
90
|
+
* @param {Radians} dec - The declination of the sun
|
|
91
|
+
* @returns {Radians} azimuth in rad
|
|
92
|
+
*/
|
|
93
|
+
static azimuth(H: number, phi: Radians, dec: Radians): Radians;
|
|
94
|
+
/**
|
|
95
|
+
* get elevation (sometimes called altitude)
|
|
96
|
+
* @param {number} H - siderealTime
|
|
97
|
+
* @param {Radians} phi - latitude
|
|
98
|
+
* @param {Radians} dec - The declination of the sun
|
|
99
|
+
* @returns {Radians} elevation
|
|
100
|
+
*/
|
|
101
|
+
static elevation(H: number, phi: Radians, dec: Radians): Radians;
|
|
102
|
+
/**
|
|
103
|
+
* side real time
|
|
104
|
+
* @param {number} d - julian day
|
|
105
|
+
* @param {Radians} lw - longitude of the observer
|
|
106
|
+
* @returns {number} sidereal time
|
|
107
|
+
*/
|
|
108
|
+
static siderealTime(d: number, lw: Radians): number;
|
|
109
|
+
/**
|
|
110
|
+
* get astro refraction
|
|
111
|
+
* @param {Radians} h - elevation
|
|
112
|
+
* @returns {number} refraction
|
|
113
|
+
*/
|
|
114
|
+
static astroRefraction(h: Degrees): Radians;
|
|
115
|
+
/**
|
|
116
|
+
* ecliptic longitude
|
|
117
|
+
* @param {number} M - solar mean anomaly
|
|
118
|
+
* @returns {number} ecliptic longitude
|
|
119
|
+
*/
|
|
120
|
+
static eclipticLongitude(M: number): number;
|
|
121
|
+
/**
|
|
122
|
+
* ecliptic latitude
|
|
123
|
+
* @param {number} B - ?
|
|
124
|
+
* @returns {number} ecliptic latitude
|
|
125
|
+
*/
|
|
126
|
+
static eclipticLatitude(B: number): number;
|
|
127
|
+
/**
|
|
128
|
+
* Julian cycle
|
|
129
|
+
* @param {number} d - number of days
|
|
130
|
+
* @param {number} lw - rad * -lng;
|
|
131
|
+
* @returns {number} julian cycle
|
|
132
|
+
*/
|
|
133
|
+
static julianCyle(d: number, lw: number): number;
|
|
134
|
+
/**
|
|
135
|
+
* approx transit
|
|
136
|
+
* @param {number} Ht - hourAngle
|
|
137
|
+
* @param {number} lw - rad * -lng
|
|
138
|
+
* @param {number} n - Julian cycle
|
|
139
|
+
* @returns {number} approx transit
|
|
140
|
+
*/
|
|
141
|
+
static approxTransit(Ht: number, lw: number, n: number): number;
|
|
142
|
+
/**
|
|
143
|
+
* solar transit in Julian
|
|
144
|
+
* @param {number} ds - approxTransit
|
|
145
|
+
* @param {number} M - solar mean anomal
|
|
146
|
+
* @param {number} L - ecliptic longitude
|
|
147
|
+
* @returns {number} solar transit in Julian
|
|
148
|
+
*/
|
|
149
|
+
static solarTransitJulian(ds: number, M: number, L: number): number;
|
|
150
|
+
/**
|
|
151
|
+
* hour angle
|
|
152
|
+
* @param {number} h - heigh at 0
|
|
153
|
+
* @param {number} phi - rad * lat;
|
|
154
|
+
* @param {number} dec - declination
|
|
155
|
+
* @returns {number} hour angle
|
|
156
|
+
*/
|
|
157
|
+
static hourAngle(h: number, phi: number, dec: number): number;
|
|
158
|
+
/**
|
|
159
|
+
* returns set time for the given sun altitude
|
|
160
|
+
* @param {number} h - heigh at 0
|
|
161
|
+
* @param {number} lw - rad * -lng
|
|
162
|
+
* @param {number} phi - rad * lat;
|
|
163
|
+
* @param {number} dec - declination
|
|
164
|
+
* @param {number} n - Julian cycle
|
|
165
|
+
* @param {number} M - solar mean anomal
|
|
166
|
+
* @param {number} L - ecliptic longitude
|
|
167
|
+
* @returns {number} set time
|
|
168
|
+
*/
|
|
169
|
+
static getSetJulian(h: number, lw: number, phi: number, dec: number, n: number, M: number, L: number): number;
|
|
170
|
+
/**
|
|
171
|
+
* returns set time for the given sun altitude
|
|
172
|
+
* @param {Meters} alt - altitude at 0
|
|
173
|
+
* @param {Radians} lw - -lng
|
|
174
|
+
* @param {Radians} phi - lat;
|
|
175
|
+
* @param {Radians} dec - declination
|
|
176
|
+
* @param {number} n - Julian cycle
|
|
177
|
+
* @param {number} M - solar mean anomal
|
|
178
|
+
* @param {number} L - ecliptic longitude
|
|
179
|
+
* @return {J2000Value} sunset time in days since 2000
|
|
180
|
+
*/
|
|
181
|
+
private static getSetJ;
|
|
182
|
+
/**
|
|
183
|
+
* calculates sun times for a given date and latitude/longitude
|
|
184
|
+
* @param {Date|number} dateVal Date object for calculating sun-times
|
|
185
|
+
* @param {number} lat latitude for calculating sun-times
|
|
186
|
+
* @param {number} lon longitude for calculating sun-times
|
|
187
|
+
* @param {number} [alt=0] the observer height (in meters) relative to the horizon
|
|
188
|
+
* @param {boolean} [isUtc=false] defines if the calculation should be in utc or local time (default is local)
|
|
189
|
+
* @return {SunTime} result object of sunTime
|
|
190
|
+
*/
|
|
191
|
+
static getTimes(dateVal: Date, lat: Degrees, lon: Degrees, alt?: Meters, isUtc?: boolean): SunTime;
|
|
192
|
+
private static calculateJnoon;
|
|
193
|
+
/**
|
|
194
|
+
* calculates time for a given azimuth angle for a given date and latitude/longitude
|
|
195
|
+
* @param {number|Date} dateValue Date object or timestamp for calculating sun-time
|
|
196
|
+
* @param {Degrees} lat latitude for calculating sun-time
|
|
197
|
+
* @param {Degrees} lon longitude for calculating sun-time
|
|
198
|
+
* @param {Radians | Degrees} az azimuth for calculating sun-time
|
|
199
|
+
* @param {boolean} [isDegrees] true if the az angle is in degree and not in rad
|
|
200
|
+
* @return {Date} result time of sun-time
|
|
201
|
+
*/
|
|
202
|
+
static getSunTimeByAzimuth(dateValue: any, lat: Degrees, lon: Degrees, az: Radians | Degrees, isDegrees?: boolean): Date;
|
|
203
|
+
/**
|
|
204
|
+
* get azimuth
|
|
205
|
+
* @param {number} H - siderealTime
|
|
206
|
+
* @param {Radians} phi - latitude
|
|
207
|
+
* @param {Radians} dec - The declination of the sun
|
|
208
|
+
* @returns {Radians} azimuth
|
|
209
|
+
*/
|
|
210
|
+
private static getAzimuth;
|
|
211
|
+
/**
|
|
212
|
+
* Convert Date to Solar Date/Time
|
|
213
|
+
*
|
|
214
|
+
* Based on https://www.pveducation.org/pvcdrom/properties-of-sunlight/solar-time
|
|
215
|
+
*
|
|
216
|
+
* See: https://github.com/mourner/suncalc/pull/156
|
|
217
|
+
*
|
|
218
|
+
* @param {date} date - Date to calculate for
|
|
219
|
+
* @param {number} utcOffset - UTC offset in hours
|
|
220
|
+
* @param {Degrees} lon - Longitude in degrees
|
|
221
|
+
* @returns {Date} - Date Object in Solar Time
|
|
222
|
+
*/
|
|
223
|
+
static getSolarTime(date: Date, utcOffset: number, lon: number): Date;
|
|
224
|
+
static getStarAzEl(date: Date, lat: Degrees, lon: Degrees, ra: number, dec: number): AzEl;
|
|
225
|
+
static getSunAzEl(date: Date, lat: Degrees, lon: Degrees): AzEl;
|
|
226
|
+
static getSunRaDec(d: number): {
|
|
227
|
+
dec: number;
|
|
228
|
+
ra: number;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek.
|
|
3
|
+
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
|
|
4
|
+
* with satellites and other orbital objects.
|
|
5
|
+
*
|
|
6
|
+
* @file The Utils module.
|
|
7
|
+
*
|
|
8
|
+
* @license AGPL-3.0-or-later
|
|
9
|
+
* @Copyright (c) 2020-2022 Theodore Kruczek
|
|
10
|
+
*
|
|
11
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
12
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
13
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
14
|
+
*
|
|
15
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
16
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
17
|
+
* See the GNU Affero General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
20
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import * as Types from '../types/types';
|
|
23
|
+
import { MoonMath } from './moon-math';
|
|
24
|
+
import { SunMath } from './sun-math';
|
|
25
|
+
declare class Utils {
|
|
26
|
+
static Types: typeof Types;
|
|
27
|
+
static distance(pos1: Types.EciVec3, pos2: Types.EciVec3): Types.Kilometer;
|
|
28
|
+
private static sign;
|
|
29
|
+
static dopplerFactor(location: Types.EciVec3, position: Types.EciVec3, velocity: Types.EciVec3): Types.Kilometer;
|
|
30
|
+
static createVec(start: number, stop: number, step: number): number[];
|
|
31
|
+
static jday: (year?: number, mon?: number, day?: number, hr?: number, minute?: number, sec?: number) => number;
|
|
32
|
+
static roundToNDecimalPlaces(value: number, places: number): number;
|
|
33
|
+
static SunMath: typeof SunMath;
|
|
34
|
+
static MoonMath: typeof MoonMath;
|
|
35
|
+
}
|
|
36
|
+
export { Utils };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek.
|
|
3
|
+
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
|
|
4
|
+
* with satellites and other orbital objects.
|
|
5
|
+
*
|
|
6
|
+
* @file The BaseObject class is used for creating core properties and methods applicable
|
|
7
|
+
* to ground and space based objects.
|
|
8
|
+
*
|
|
9
|
+
* @license AGPL-3.0-or-later
|
|
10
|
+
* @Copyright (c) 2020-2022 Theodore Kruczek
|
|
11
|
+
*
|
|
12
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
13
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
14
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
17
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
18
|
+
* See the GNU Affero General Public License for more details.
|
|
19
|
+
*
|
|
20
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
21
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
22
|
+
*/
|
|
23
|
+
import { EciVec3, SpaceObjectType } from '../types/types';
|
|
24
|
+
interface ObjectInfo {
|
|
25
|
+
name?: string;
|
|
26
|
+
type?: SpaceObjectType;
|
|
27
|
+
position?: EciVec3;
|
|
28
|
+
time?: Date;
|
|
29
|
+
}
|
|
30
|
+
export declare class BaseObject {
|
|
31
|
+
name: string;
|
|
32
|
+
type: SpaceObjectType;
|
|
33
|
+
position: EciVec3;
|
|
34
|
+
time: Date;
|
|
35
|
+
constructor(info: ObjectInfo);
|
|
36
|
+
getName(): string;
|
|
37
|
+
getType(): SpaceObjectType;
|
|
38
|
+
getTypeString(): string;
|
|
39
|
+
}
|
|
40
|
+
export {};
|