ootk 1.2.0 → 1.5.0
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/ootk.d.ts +16 -23
- package/dist/ootk.js +2 -1
- package/dist/ootk.js.LICENSE.txt +77 -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/{dist → lib/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/{utils/TleFormatData.d.ts → tle/tle-format-data.d.ts} +0 -0
- package/lib/{utils/TleFormatData.js → tle/tle-format-data.js} +1 -1
- package/lib/tle/tle-format-data.js.map +1 -0
- package/{dist → lib/tle}/tle.d.ts +12 -16
- package/lib/{tle.js → tle/tle.js} +13 -17
- package/lib/tle/tle.js.map +1 -0
- package/lib/{transforms.d.ts → transforms/transforms.d.ts} +12 -16
- package/lib/{transforms.js → transforms/transforms.js} +12 -16
- package/lib/transforms/transforms.js.map +1 -0
- package/{dist → lib/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/transforms.d.ts +0 -59
- 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.d.ts +0 -89
- package/lib/sgp4.js.map +0 -1
- package/lib/tle.d.ts +0 -378
- package/lib/tle.js.map +0 -1
- package/lib/transforms.js.map +0 -1
- package/lib/types.d.ts +0 -204
- 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
|
@@ -0,0 +1,46 @@
|
|
|
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 Star class is meant to help with cacluating star positions relative to
|
|
7
|
+
* satellites and earth based sensors.
|
|
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, LlaVec3, RaeVec3, SpaceObjectType } from '../types/types';
|
|
24
|
+
import { SpaceObject } from './space-object';
|
|
25
|
+
interface ObjectInfo {
|
|
26
|
+
name?: string;
|
|
27
|
+
type?: SpaceObjectType;
|
|
28
|
+
vmag?: number;
|
|
29
|
+
ra: number;
|
|
30
|
+
dec: number;
|
|
31
|
+
pname?: string;
|
|
32
|
+
bf?: string;
|
|
33
|
+
h?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare class Star extends SpaceObject {
|
|
36
|
+
pname: string;
|
|
37
|
+
bf: string;
|
|
38
|
+
h: string;
|
|
39
|
+
dec: number;
|
|
40
|
+
ra: number;
|
|
41
|
+
constructor(info: ObjectInfo);
|
|
42
|
+
getEci(lla?: LlaVec3, date?: Date): EciVec3;
|
|
43
|
+
getRae(lla?: LlaVec3, date?: Date): RaeVec3;
|
|
44
|
+
private static calculateTimeVariables;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
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 Star class is meant to help with cacluating star positions relative to
|
|
7
|
+
* satellites and earth based sensors.
|
|
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
|
+
var __extends = (this && this.__extends) || (function () {
|
|
24
|
+
var extendStatics = function (d, b) {
|
|
25
|
+
extendStatics = Object.setPrototypeOf ||
|
|
26
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
27
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
28
|
+
return extendStatics(d, b);
|
|
29
|
+
};
|
|
30
|
+
return function (d, b) {
|
|
31
|
+
if (typeof b !== "function" && b !== null)
|
|
32
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
33
|
+
extendStatics(d, b);
|
|
34
|
+
function __() { this.constructor = d; }
|
|
35
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
import { DAY_TO_MS, DEG2RAD } from '../utils/constants';
|
|
39
|
+
import { SpaceObjectType } from '../types/types';
|
|
40
|
+
import { Sgp4 } from '../sgp4/sgp4';
|
|
41
|
+
import { SpaceObject } from './space-object';
|
|
42
|
+
import { Transforms } from '../transforms/transforms';
|
|
43
|
+
import { Utils } from '../utils/utils';
|
|
44
|
+
var Star = /** @class */ (function (_super) {
|
|
45
|
+
__extends(Star, _super);
|
|
46
|
+
function Star(info) {
|
|
47
|
+
var _this = this;
|
|
48
|
+
if (info.type && info.type !== SpaceObjectType.STAR) {
|
|
49
|
+
throw new Error('Invalid object type');
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
info.type = SpaceObjectType.STAR;
|
|
53
|
+
}
|
|
54
|
+
_this = _super.call(this, info) || this;
|
|
55
|
+
_this.ra = info.ra;
|
|
56
|
+
_this.dec = info.dec;
|
|
57
|
+
if (info.pname) {
|
|
58
|
+
_this.pname = info.pname;
|
|
59
|
+
}
|
|
60
|
+
if (info.bf) {
|
|
61
|
+
_this.bf = info.bf;
|
|
62
|
+
}
|
|
63
|
+
if (info.h) {
|
|
64
|
+
_this.h = info.h;
|
|
65
|
+
}
|
|
66
|
+
return _this;
|
|
67
|
+
}
|
|
68
|
+
Star.prototype.getEci = function (lla, date) {
|
|
69
|
+
if (lla === void 0) { lla = { lat: 180, lon: 0, alt: 0 }; }
|
|
70
|
+
if (date === void 0) { date = this.time; }
|
|
71
|
+
var rae = this.getRae(lla, date);
|
|
72
|
+
var gmst = Star.calculateTimeVariables(date).gmst;
|
|
73
|
+
// Arbitrary distance to enable using ECI coordinates
|
|
74
|
+
return Transforms.ecf2eci(Transforms.rae2ecf(rae, { lat: 0, lon: 0, alt: 0 }), gmst);
|
|
75
|
+
};
|
|
76
|
+
Star.prototype.getRae = function (lla, date) {
|
|
77
|
+
if (lla === void 0) { lla = { lat: 180, lon: 0, alt: 0 }; }
|
|
78
|
+
if (date === void 0) { date = this.time; }
|
|
79
|
+
var starPos = Utils.SunMath.getStarAzEl(date, lla.lat * DEG2RAD, lla.lon * DEG2RAD, this.ra, this.dec);
|
|
80
|
+
return { az: starPos.az, el: starPos.el, rng: 250000 };
|
|
81
|
+
};
|
|
82
|
+
Star.calculateTimeVariables = function (date) {
|
|
83
|
+
var j = Utils.jday(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()) +
|
|
84
|
+
date.getUTCMilliseconds() * DAY_TO_MS;
|
|
85
|
+
var gmst = Sgp4.gstime(j);
|
|
86
|
+
return { gmst: gmst, j: j };
|
|
87
|
+
};
|
|
88
|
+
return Star;
|
|
89
|
+
}(SpaceObject));
|
|
90
|
+
export { Star };
|
|
91
|
+
//# sourceMappingURL=star.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"star.js","sourceRoot":"","sources":["../../src/objects/star.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;AAEH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAwD,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEvG,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAavC;IAA0B,wBAAW;IAQnC,cAAY,IAAgB;QAA5B,iBAuBC;QAtBC,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC,IAAI,EAAE;YACnD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACxC;aAAM;YACL,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;SAClC;gBAED,kBAAM,IAAI,CAAC;QAEX,KAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,KAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QAEpB,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,KAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;SACzB;QAED,IAAI,IAAI,CAAC,EAAE,EAAE;YACX,KAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;SACnB;QAED,IAAI,IAAI,CAAC,CAAC,EAAE;YACV,KAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;SACjB;;IACH,CAAC;IAED,qBAAM,GAAN,UAAO,GAA2C,EAAE,IAAsB;QAAnE,oBAAA,EAAA,QAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;QAAE,qBAAA,EAAA,OAAa,IAAI,CAAC,IAAI;QACxE,IAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC3B,IAAA,IAAI,GAAK,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAtC,CAAuC;QAEnD,qDAAqD;QACrD,OAAO,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IACvF,CAAC;IAED,qBAAM,GAAN,UAAO,GAA2C,EAAE,IAAsB;QAAnE,oBAAA,EAAA,QAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;QAAE,qBAAA,EAAA,OAAa,IAAI,CAAC,IAAI;QACxE,IAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,GAAG,OAAO,EAAE,GAAG,CAAC,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAEzG,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IACzD,CAAC;IAEc,2BAAsB,GAArC,UAAsC,IAAU;QAC9C,IAAM,CAAC,GACL,KAAK,CAAC,IAAI,CACR,IAAI,CAAC,cAAc,EAAE,EACrB,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,EACtB,IAAI,CAAC,UAAU,EAAE,EACjB,IAAI,CAAC,WAAW,EAAE,EAClB,IAAI,CAAC,aAAa,EAAE,EACpB,IAAI,CAAC,aAAa,EAAE,CACrB;YACD,IAAI,CAAC,kBAAkB,EAAE,GAAG,SAAS,CAAC;QACxC,IAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAE5B,OAAO,EAAE,IAAI,MAAA,EAAE,CAAC,GAAA,EAAE,CAAC;IACrB,CAAC;IACH,WAAC;AAAD,CAAC,AA9DD,CAA0B,WAAW,GA8DpC"}
|
package/lib/ootk.d.ts
CHANGED
|
@@ -3,30 +3,23 @@
|
|
|
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
|
-
* @
|
|
7
|
-
* Copyright (c) 2020-
|
|
6
|
+
* @license AGPL-3.0-or-later
|
|
7
|
+
* @Copyright (c) 2020-2022 Theodore Kruczek
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* of
|
|
11
|
-
*
|
|
12
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
-
* furnished to do so, subject to the following conditions:
|
|
9
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
10
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
11
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
15
12
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
14
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
15
|
+
* See the GNU Affero General Public License for more details.
|
|
18
16
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
-
* SOFTWARE.
|
|
17
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
18
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
26
19
|
*/
|
|
27
|
-
export { Sgp4 } from './sgp4';
|
|
28
|
-
export { Transforms } from './transforms';
|
|
29
|
-
export { Utils } from './utils';
|
|
30
|
-
export { Tle } from './tle';
|
|
31
|
-
export
|
|
32
|
-
export * from './types';
|
|
20
|
+
export { Sgp4 } from './sgp4/sgp4';
|
|
21
|
+
export { Transforms } from './transforms/transforms';
|
|
22
|
+
export { Utils } from './utils/utils';
|
|
23
|
+
export { Tle } from './tle/tle';
|
|
24
|
+
export * from './objects/index';
|
|
25
|
+
export * from './types/types';
|
package/lib/ootk.js
CHANGED
|
@@ -3,31 +3,24 @@
|
|
|
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
|
-
* @
|
|
7
|
-
* Copyright (c) 2020-
|
|
6
|
+
* @license AGPL-3.0-or-later
|
|
7
|
+
* @Copyright (c) 2020-2022 Theodore Kruczek
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* of
|
|
11
|
-
*
|
|
12
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
14
|
-
* furnished to do so, subject to the following conditions:
|
|
9
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
10
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
11
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
15
12
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
14
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
15
|
+
* See the GNU Affero General Public License for more details.
|
|
18
16
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
-
* SOFTWARE.
|
|
17
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
18
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
26
19
|
*/
|
|
27
|
-
export { Sgp4 } from './sgp4';
|
|
28
|
-
export { Transforms } from './transforms';
|
|
29
|
-
export { Utils } from './utils';
|
|
30
|
-
export { Tle } from './tle';
|
|
31
|
-
export
|
|
32
|
-
export * from './types';
|
|
20
|
+
export { Sgp4 } from './sgp4/sgp4';
|
|
21
|
+
export { Transforms } from './transforms/transforms';
|
|
22
|
+
export { Utils } from './utils/utils';
|
|
23
|
+
export { Tle } from './tle/tle';
|
|
24
|
+
export * from './objects/index';
|
|
25
|
+
export * from './types/types';
|
|
33
26
|
//# sourceMappingURL=ootk.js.map
|
package/lib/ootk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ootk.js","sourceRoot":"","sources":["../src/ootk.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ootk.js","sourceRoot":"","sources":["../src/ootk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
|
@@ -9,28 +9,21 @@
|
|
|
9
9
|
* in order provide context to the functions and clarify any adjustments made for
|
|
10
10
|
* TypeScript/JavaScript compatibility.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
13
|
-
* Copyright (c) 2020-
|
|
12
|
+
* @license AGPL-3.0-or-later
|
|
13
|
+
* @Copyright (c) 2020-2022 Theodore Kruczek
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
* of
|
|
17
|
-
*
|
|
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:
|
|
15
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
16
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
17
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
21
18
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
19
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
20
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
21
|
+
* See the GNU Affero General Public License for more details.
|
|
24
22
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
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.
|
|
23
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
24
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
32
25
|
*/
|
|
33
|
-
import { SatelliteRecord, StateVector, Vec3Flat } from '
|
|
26
|
+
import { SatelliteRecord, StateVector, Vec3Flat } from '../types/types';
|
|
34
27
|
declare class Sgp4 {
|
|
35
28
|
private static dpper;
|
|
36
29
|
private static dscom;
|
|
@@ -66,7 +59,7 @@ declare class Sgp4 {
|
|
|
66
59
|
truelon: number;
|
|
67
60
|
lonper: number;
|
|
68
61
|
};
|
|
69
|
-
static jday(year: number, mon
|
|
62
|
+
static jday(year: number | Date, mon?: number, day?: number, hr?: number, min?: number, sec?: number, ms?: number): {
|
|
70
63
|
jd: number;
|
|
71
64
|
jdFrac: number;
|
|
72
65
|
};
|
|
@@ -74,7 +67,7 @@ declare class Sgp4 {
|
|
|
74
67
|
mon: number;
|
|
75
68
|
day: number;
|
|
76
69
|
hr: number;
|
|
77
|
-
|
|
70
|
+
min: number;
|
|
78
71
|
sec: number;
|
|
79
72
|
};
|
|
80
73
|
static invjday(jd: number, jdfrac: number): {
|
|
@@ -82,7 +75,7 @@ declare class Sgp4 {
|
|
|
82
75
|
mon: number;
|
|
83
76
|
day: number;
|
|
84
77
|
hr: number;
|
|
85
|
-
|
|
78
|
+
min: number;
|
|
86
79
|
sec: number;
|
|
87
80
|
};
|
|
88
81
|
}
|
|
@@ -9,26 +9,19 @@
|
|
|
9
9
|
* in order provide context to the functions and clarify any adjustments made for
|
|
10
10
|
* TypeScript/JavaScript compatibility.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
13
|
-
* Copyright (c) 2020-
|
|
12
|
+
* @license AGPL-3.0-or-later
|
|
13
|
+
* @Copyright (c) 2020-2022 Theodore Kruczek
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
* of
|
|
17
|
-
*
|
|
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:
|
|
15
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
16
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
17
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
21
18
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
19
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
20
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
21
|
+
* See the GNU Affero General Public License for more details.
|
|
24
22
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
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.
|
|
23
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
24
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
32
25
|
*/
|
|
33
26
|
// NOTE: This file is meant to maintain as much of the original format as possible.
|
|
34
27
|
/* eslint-disable no-lonely-if */
|
|
@@ -42,7 +35,7 @@
|
|
|
42
35
|
/* eslint-disable max-statements */
|
|
43
36
|
/* eslint-disable max-lines-per-function */
|
|
44
37
|
/* eslint-disable max-lines */
|
|
45
|
-
import { DEG2RAD, PI, TAU, temp4, x2o3 } from '
|
|
38
|
+
import { DEG2RAD, PI, TAU, temp4, x2o3 } from '../utils/constants';
|
|
46
39
|
/*
|
|
47
40
|
* ----------------------------------------------------------------
|
|
48
41
|
*
|
|
@@ -2496,8 +2489,8 @@ var Sgp4 = /** @class */ (function () {
|
|
|
2496
2489
|
else {
|
|
2497
2490
|
year = satrec.epochyr + 1900;
|
|
2498
2491
|
}
|
|
2499
|
-
var _a = Sgp4.days2mdhms(year, satrec.epochdays), mon = _a.mon, day = _a.day, hr = _a.hr,
|
|
2500
|
-
var jdayRes = Sgp4.jday(year, mon, day, hr,
|
|
2492
|
+
var _a = Sgp4.days2mdhms(year, satrec.epochdays), mon = _a.mon, day = _a.day, hr = _a.hr, min = _a.min, sec = _a.sec;
|
|
2493
|
+
var jdayRes = Sgp4.jday(year, mon, day, hr, min, sec);
|
|
2501
2494
|
satrec.jdsatepoch = jdayRes.jd + jdayRes.jdFrac;
|
|
2502
2495
|
// ---------------- initialize the orbit at sgp4epoch -------------------
|
|
2503
2496
|
Sgp4.sgp4init(satrec, {
|
|
@@ -3075,13 +3068,28 @@ var Sgp4 = /** @class */ (function () {
|
|
|
3075
3068
|
*
|
|
3076
3069
|
* ---------------------------------------------------------------------------
|
|
3077
3070
|
*/
|
|
3078
|
-
Sgp4.jday = function (year, mon, day, hr,
|
|
3071
|
+
Sgp4.jday = function (year, mon, day, hr, min, sec, ms) {
|
|
3072
|
+
if (mon === void 0) { mon = 0; }
|
|
3073
|
+
if (day === void 0) { day = 0; }
|
|
3074
|
+
if (hr === void 0) { hr = 0; }
|
|
3075
|
+
if (min === void 0) { min = 0; }
|
|
3076
|
+
if (sec === void 0) { sec = 0; }
|
|
3077
|
+
if (ms === void 0) { ms = 0; }
|
|
3078
|
+
if (year instanceof Date) {
|
|
3079
|
+
mon = year.getUTCMonth() + 1;
|
|
3080
|
+
day = year.getUTCDate();
|
|
3081
|
+
hr = year.getUTCHours();
|
|
3082
|
+
min = year.getUTCMinutes();
|
|
3083
|
+
sec = year.getUTCSeconds();
|
|
3084
|
+
ms = year.getUTCMilliseconds();
|
|
3085
|
+
year = year.getUTCFullYear();
|
|
3086
|
+
}
|
|
3079
3087
|
var jd = 367.0 * year -
|
|
3080
3088
|
Math.floor(7 * (year + Math.floor((mon + 9) / 12.0)) * 0.25) +
|
|
3081
3089
|
Math.floor((275 * mon) / 9.0) +
|
|
3082
3090
|
day +
|
|
3083
3091
|
1721013.5; // Use - 678987.0 to go to mjd directly
|
|
3084
|
-
var jdFrac = (sec +
|
|
3092
|
+
var jdFrac = (ms / 1000 + sec + min * 60.0 + hr * 3600.0) / 86400.0;
|
|
3085
3093
|
// Check that the day and fractional day are correct
|
|
3086
3094
|
if (Math.abs(jdFrac) > 1.0) {
|
|
3087
3095
|
var dtt = Math.floor(jdFrac);
|
|
@@ -3150,13 +3158,13 @@ var Sgp4 = /** @class */ (function () {
|
|
|
3150
3158
|
var temp = (days - dayofyr) * 24.0;
|
|
3151
3159
|
var hr = Math.floor(temp);
|
|
3152
3160
|
temp = (temp - hr) * 60.0;
|
|
3153
|
-
var
|
|
3154
|
-
var sec = (temp -
|
|
3161
|
+
var min = Math.floor(temp);
|
|
3162
|
+
var sec = (temp - min) * 60.0;
|
|
3155
3163
|
return {
|
|
3156
3164
|
mon: mon,
|
|
3157
3165
|
day: day,
|
|
3158
3166
|
hr: hr,
|
|
3159
|
-
|
|
3167
|
+
min: min,
|
|
3160
3168
|
sec: sec,
|
|
3161
3169
|
};
|
|
3162
3170
|
}; // Days2mdhms
|
|
@@ -3229,13 +3237,13 @@ var Sgp4 = /** @class */ (function () {
|
|
|
3229
3237
|
days = Math.floor(temp - ((year - 1900) * 365.0 + leapyrs));
|
|
3230
3238
|
}
|
|
3231
3239
|
/* ----------------- find remaining data ------------------------- */
|
|
3232
|
-
var _a = Sgp4.days2mdhms(year, days + jdfrac), mon = _a.mon, day = _a.day, hr = _a.hr,
|
|
3240
|
+
var _a = Sgp4.days2mdhms(year, days + jdfrac), mon = _a.mon, day = _a.day, hr = _a.hr, min = _a.min, sec = _a.sec;
|
|
3233
3241
|
return {
|
|
3234
3242
|
year: year,
|
|
3235
3243
|
mon: mon,
|
|
3236
3244
|
day: day,
|
|
3237
3245
|
hr: hr,
|
|
3238
|
-
|
|
3246
|
+
min: min,
|
|
3239
3247
|
sec: sec,
|
|
3240
3248
|
};
|
|
3241
3249
|
}; // Invjday
|