ootk 1.0.3 → 1.0.7

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +20 -26
  2. package/LICENSE.MD +21 -21
  3. package/README.md +128 -128
  4. package/asc/asconfig.json +22 -0
  5. package/asc/assembly/index.ts +1143 -0
  6. package/asc/ex/asconfig.json +22 -0
  7. package/asc/ex/assembly/index.ts +5 -0
  8. package/asc/ex/index.html +10 -0
  9. package/asc/ex/package.json +19 -0
  10. package/asc/ex/tests/index.js +4 -0
  11. package/asc/package.json +19 -0
  12. package/asc/tests/index.js +4 -0
  13. package/codecov.yml +21 -0
  14. package/{lib/ootk.es.d.ts → dist/ootk.d.ts} +3 -4
  15. package/dist/ootk.js +1 -3850
  16. package/{lib/ootk-sgp4.es.d.ts → dist/sgp4.d.ts} +6 -140
  17. package/dist/transforms.d.ts +58 -0
  18. package/dist/utils.d.ts +33 -0
  19. package/lib/{ootk.es.js → ootk.d.ts} +3 -4
  20. package/lib/{ootk-utils.es.d.ts → ootk.js} +6 -11
  21. package/lib/ootk.js.map +1 -0
  22. package/lib/sgp4.d.ts +89 -0
  23. package/lib/{ootk-sgp4.es.js → sgp4.js} +545 -528
  24. package/lib/sgp4.js.map +1 -0
  25. package/lib/transforms.d.ts +58 -0
  26. package/lib/{ootk-transforms.es.js → transforms.js} +3 -3
  27. package/lib/transforms.js.map +1 -0
  28. package/lib/utils/constants.d.ts +30 -0
  29. package/lib/utils/constants.js +31 -0
  30. package/lib/utils/constants.js.map +1 -0
  31. package/lib/utils/types.d.ts +164 -0
  32. package/lib/utils/types.js +2 -0
  33. package/lib/utils/types.js.map +1 -0
  34. package/lib/utils.d.ts +33 -0
  35. package/lib/{ootk-utils.es.js → utils.js} +12 -5
  36. package/lib/utils.js.map +1 -0
  37. package/package.json +17 -17
  38. package/sandbox.html +8 -0
  39. package/dist/ootk-sgp4.js +0 -3471
  40. package/dist/ootk-sgp4.min.js +0 -34
  41. package/dist/ootk-transforms.js +0 -340
  42. package/dist/ootk-transforms.min.js +0 -1
  43. package/dist/ootk-utils.js +0 -149
  44. package/dist/ootk-utils.min.js +0 -1
  45. package/dist/ootk.min.js +0 -60
  46. package/lib/ootk-transforms.es.d.ts +0 -141
@@ -30,141 +30,7 @@
30
30
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
31
  * SOFTWARE.
32
32
  */
33
- /** @interface SatelliteRecord contains all of the orbital parameters necessary for running SGP4. It is generated by Sgp4.createSatrec.*/
34
- interface SatelliteRecord {
35
- a: number;
36
- am: number;
37
- alta: number;
38
- altp: number;
39
- argpdot: number;
40
- argpo: number;
41
- aycof: number;
42
- bstar: number;
43
- cc1: number;
44
- cc4: number;
45
- cc5: number;
46
- con41: number;
47
- d2: number;
48
- d3: number;
49
- d4: number;
50
- d5232: number;
51
- d5421: number;
52
- d5433: number;
53
- dedt: number;
54
- delmo: number;
55
- del1: number;
56
- ecco: number;
57
- em: number;
58
- epochdays: number;
59
- epochyr: number;
60
- error: number;
61
- eta: number;
62
- gsto: number;
63
- im: number;
64
- inclo: number;
65
- init: string;
66
- isimp: number;
67
- jdsatepoch: number;
68
- mdot: number;
69
- method: string;
70
- mo: number;
71
- mm: number;
72
- nddot: number;
73
- ndot: number;
74
- no: number;
75
- nodecf: number;
76
- nodedot: number;
77
- nodeo: number;
78
- om: number;
79
- Om: number;
80
- omgcof: number;
81
- operationmode: string;
82
- satnum: string;
83
- sinmao: number;
84
- t: number;
85
- t2cof: number;
86
- t3cof: number;
87
- t4cof: number;
88
- t5cof: number;
89
- x1mth2: number;
90
- x7thm1: number;
91
- xlcof: number;
92
- xmcof: number;
93
- xfact: number;
94
- xlamo: number;
95
- xli: number;
96
- xgh4: number;
97
- xgh3: number;
98
- xh2: number;
99
- xi2: number;
100
- xi3: number;
101
- xl2: number;
102
- xl3: number;
103
- xl4: number;
104
- zmol: number;
105
- zmos: number;
106
- dmdt: number;
107
- dnodt: number;
108
- domdt: number;
109
- e3: number;
110
- ee2: number;
111
- peo: number;
112
- pgho: number;
113
- pho: number;
114
- PInco: number;
115
- plo: number;
116
- se2: number;
117
- se3: number;
118
- sgh2: number;
119
- sgh3: number;
120
- sgh4: number;
121
- sh2: number;
122
- sh3: number;
123
- si2: number;
124
- si3: number;
125
- sl2: number;
126
- sl3: number;
127
- sl4: number;
128
- xgh2: number;
129
- xh3: number;
130
- tumin: number;
131
- radiusearthkm: number;
132
- irez: number;
133
- d3210: number;
134
- d3222: number;
135
- d4410: number;
136
- d4422: number;
137
- d5220: number;
138
- del2: number;
139
- del3: number;
140
- didt: number;
141
- atime: number;
142
- j2: number;
143
- j3: number;
144
- j4: number;
145
- mus: number;
146
- xke: number;
147
- j3oj2: number;
148
- xni: number;
149
- d2201: number;
150
- d2211: number;
151
- nm: number;
152
- }
153
- /** @typedef StateVector is a three dimensional position and velocity vector output from Sgp4.propagate.*/
154
- declare type StateVector = {
155
- position: {
156
- x: number;
157
- y: number;
158
- z: number;
159
- } | boolean;
160
- velocity: {
161
- x: number;
162
- y: number;
163
- z: number;
164
- } | boolean;
165
- };
166
- /** @typedef vec3 is a flat three dimensional array used in vector math.*/
167
- declare type vec3 = [number, number, number];
33
+ import { SatelliteRecord, StateVector, Vec3Flat } from './utils/types';
168
34
  declare class Sgp4 {
169
35
  private static dpper;
170
36
  private static dscom;
@@ -177,17 +43,17 @@ declare class Sgp4 {
177
43
  static createSatrec(tleLine1: string, tleLine2: string, whichconst?: string, opsmode?: string): SatelliteRecord;
178
44
  static gstime(jdut1: number): number;
179
45
  static sgn(x: number): number;
180
- static mag(x: vec3): number;
181
- static cross(vec1: vec3, vec2: vec3): vec3;
182
- static dot(x: vec3, y: vec3): number;
183
- static angle(vec1: vec3, vec2: vec3): number;
46
+ static mag(x: Vec3Flat): number;
47
+ static cross(vec1: Vec3Flat, vec2: Vec3Flat): Vec3Flat;
48
+ static dot(x: Vec3Flat, y: Vec3Flat): number;
49
+ static angle(vec1: Vec3Flat, vec2: Vec3Flat): number;
184
50
  static asinh(xval: number): number;
185
51
  static newtonnu(ecc: number, nu: number): {
186
52
  e0: number;
187
53
  m: number;
188
54
  };
189
55
  static sinh(x: number): number;
190
- static rv2coe(r: vec3, v: vec3, mus: number): {
56
+ static rv2coe(r: Vec3Flat, v: Vec3Flat, mus: number): {
191
57
  p: number;
192
58
  a: number;
193
59
  ecc: number;
@@ -0,0 +1,58 @@
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 Transforms module contains a collection of conversions not contained
7
+ * in the original SGP4 library such as ECI to ECF and ECF to RAE. This was based
8
+ * on some of the functions in satellite.js.
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ * of this software and associated documentation files (the "Software"), to deal
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:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in all
18
+ * copies or substantial portions of the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ * SOFTWARE.
27
+ */
28
+ import { Degrees, EcfVec3, EciVec3, LlaVec3, Radians, RaeVec3, SezVec3 } from './utils/types';
29
+ declare class Transforms {
30
+ static getDegLat(radians: Radians): Degrees;
31
+ static getDegLon(radians: Radians): Degrees;
32
+ static getRadLat(degrees: Degrees): Radians;
33
+ static getRadLon(degrees: Degrees): Radians;
34
+ static rad2deg(radians: Radians): Degrees;
35
+ static deg2rad(degrees: Degrees): Radians;
36
+ static ecf2eci(ecf: EcfVec3, gmst: number): EciVec3;
37
+ static ecf2rae(lla: LlaVec3, ecf: EcfVec3): RaeVec3;
38
+ /** eciToGeodetic converts eci coordinates to lla coordinates
39
+ * @param {vec3} eci takes xyz coordinates
40
+ * @param {number} gmst takes a number in gmst time
41
+ * @returns {array} array containing lla coordinates
42
+ */
43
+ static eci2lla(eci: EciVec3, gmst: number): LlaVec3;
44
+ static eci2ecf(eci: EciVec3, gmst: number): EcfVec3;
45
+ static lla2ecf(lla: LlaVec3): EcfVec3;
46
+ static lla2sez(lla: LlaVec3, ecf: EcfVec3): SezVec3;
47
+ static rae2sez(rae: RaeVec3): SezVec3;
48
+ static rae2ecf(rae: RaeVec3, lla: LlaVec3): EcfVec3;
49
+ /**
50
+ * @param {Object} sez Containing SEZ coordinates
51
+ * @param {Number} sez.s Positive horizontal vector S due south.
52
+ * @param {Number} sez.e Positive horizontal vector E due east.
53
+ * @param {Number} sez.z Vector Z normal to the surface of the earth (up).
54
+ * @returns {Object} Rng, Az, El array
55
+ */
56
+ static sez2rae(sez: SezVec3): RaeVec3;
57
+ }
58
+ export { Transforms };
@@ -0,0 +1,33 @@
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
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
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:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ */
26
+ import { EciVec3, Kilometer } from './utils/types';
27
+ declare class Utils {
28
+ static distance(pos1: EciVec3, pos2: EciVec3): Kilometer;
29
+ private static sign;
30
+ static dopplerFactor(location: EciVec3, position: EciVec3, velocity: EciVec3): Kilometer;
31
+ static createVec(start: number, stop: number, step: number): number[];
32
+ }
33
+ export { Utils };
@@ -24,7 +24,6 @@
24
24
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
25
  * SOFTWARE.
26
26
  */
27
- import { Sgp4 } from './ootk-sgp4.es.js';
28
- import { Transforms } from './ootk-transforms.es.js';
29
- import { Utils } from './ootk-utils.es.js';
30
- export { Sgp4, Transforms, Utils };
27
+ export { Sgp4 } from './sgp4';
28
+ export { Transforms } from './transforms';
29
+ export { Utils } from './utils';
@@ -3,7 +3,8 @@
3
3
  * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
4
4
  * with satellites and other orbital objects.
5
5
  *
6
- * @file The Utils module.
6
+ * @copyright MIT License.
7
+ * Copyright (c) 2020-2021 Theodore Kruczek
7
8
  *
8
9
  * Permission is hereby granted, free of charge, to any person obtaining a copy
9
10
  * of this software and associated documentation files (the "Software"), to deal
@@ -23,13 +24,7 @@
23
24
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
25
  * SOFTWARE.
25
26
  */
26
- declare type vec3K = {
27
- x: number;
28
- y: number;
29
- z: number;
30
- };
31
- declare class Utils {
32
- static distance(pos1: vec3K, pos2: vec3K): number;
33
- static dopplerFactor(location: vec3K, position: vec3K, velocity: vec3K): number;
34
- }
35
- export { Utils };
27
+ export { Sgp4 } from './sgp4';
28
+ export { Transforms } from './transforms';
29
+ export { Utils } from './utils';
30
+ //# sourceMappingURL=ootk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ootk.js","sourceRoot":"","sources":["../src/ootk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
package/lib/sgp4.d.ts ADDED
@@ -0,0 +1,89 @@
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 Sgp4 module contains a TypeScript port of the 2020 version of
7
+ * sgp4unit.cpp from "Fundamentals of Astrodynamics and Applications" by David
8
+ * Vallado. All of the original comments and notes are inserted in the code below
9
+ * in order provide context to the functions and clarify any adjustments made for
10
+ * TypeScript/JavaScript compatibility.
11
+ *
12
+ * @copyright MIT License.
13
+ * Copyright (c) 2020-2021 Theodore Kruczek
14
+ *
15
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ * of this software and associated documentation files (the "Software"), to deal
17
+ * in the Software without restriction, including without limitation the rights
18
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ * copies of the Software, and to permit persons to whom the Software is
20
+ * furnished to do so, subject to the following conditions:
21
+ *
22
+ * The above copyright notice and this permission notice shall be included in all
23
+ * copies or substantial portions of the Software.
24
+ *
25
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ * SOFTWARE.
32
+ */
33
+ import { SatelliteRecord, StateVector, Vec3Flat } from './utils/types';
34
+ declare class Sgp4 {
35
+ private static dpper;
36
+ private static dscom;
37
+ private static dsinit;
38
+ private static dspace;
39
+ private static initl;
40
+ private static sgp4init;
41
+ static propagate(satrec: SatelliteRecord, tsince: number): StateVector;
42
+ private static getgravconst;
43
+ static createSatrec(tleLine1: string, tleLine2: string, whichconst?: string, opsmode?: string): SatelliteRecord;
44
+ static gstime(jdut1: number): number;
45
+ static sgn(x: number): number;
46
+ static mag(x: Vec3Flat): number;
47
+ static cross(vec1: Vec3Flat, vec2: Vec3Flat): Vec3Flat;
48
+ static dot(x: Vec3Flat, y: Vec3Flat): number;
49
+ static angle(vec1: Vec3Flat, vec2: Vec3Flat): number;
50
+ static asinh(xval: number): number;
51
+ static newtonnu(ecc: number, nu: number): {
52
+ e0: number;
53
+ m: number;
54
+ };
55
+ static sinh(x: number): number;
56
+ static rv2coe(r: Vec3Flat, v: Vec3Flat, mus: number): {
57
+ p: number;
58
+ a: number;
59
+ ecc: number;
60
+ incl: number;
61
+ omega: number;
62
+ argp: number;
63
+ nu: number;
64
+ m: number;
65
+ arglat: number;
66
+ truelon: number;
67
+ lonper: number;
68
+ };
69
+ static jday(year: number, mon: number, day: number, hr: number, minute: number, sec: number): {
70
+ jd: number;
71
+ jdFrac: number;
72
+ };
73
+ static days2mdhms(year: number, days: number): {
74
+ mon: number;
75
+ day: number;
76
+ hr: number;
77
+ minute: number;
78
+ sec: number;
79
+ };
80
+ static invjday(jd: number, jdfrac: number): {
81
+ year: number;
82
+ mon: number;
83
+ day: number;
84
+ hr: number;
85
+ minute: number;
86
+ sec: number;
87
+ };
88
+ }
89
+ export { Sgp4 };