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.
Files changed (84) hide show
  1. package/{asc → .asc}/asconfig.json +0 -0
  2. package/{asc → .asc}/assembly/index.ts +0 -0
  3. package/{asc → .asc}/ex/asconfig.json +0 -0
  4. package/{asc → .asc}/ex/assembly/index.ts +0 -0
  5. package/{asc → .asc}/ex/index.html +0 -0
  6. package/{asc → .asc}/ex/package.json +0 -0
  7. package/{asc → .asc}/ex/tests/index.js +0 -0
  8. package/{asc → .asc}/package.json +0 -0
  9. package/{asc → .asc}/tests/index.js +0 -0
  10. package/.eslintrc.json +5 -5
  11. package/LICENSE.MD +299 -21
  12. package/README.md +17 -22
  13. package/dist/ootk.d.ts +16 -23
  14. package/dist/ootk.js +2 -1
  15. package/dist/ootk.js.LICENSE.txt +77 -0
  16. package/lib/objects/base-object.d.ts +40 -0
  17. package/lib/objects/base-object.js +109 -0
  18. package/lib/objects/base-object.js.map +1 -0
  19. package/lib/objects/detailed-sat.d.ts +66 -0
  20. package/lib/objects/detailed-sat.js +149 -0
  21. package/lib/objects/detailed-sat.js.map +1 -0
  22. package/lib/objects/index.d.ts +4 -0
  23. package/lib/objects/index.js +5 -0
  24. package/lib/objects/index.js.map +1 -0
  25. package/lib/objects/sat.d.ts +88 -0
  26. package/lib/objects/sat.js +141 -0
  27. package/lib/objects/sat.js.map +1 -0
  28. package/lib/objects/sensor.d.ts +40 -0
  29. package/lib/objects/sensor.js +88 -0
  30. package/lib/objects/sensor.js.map +1 -0
  31. package/lib/objects/space-object.d.ts +38 -0
  32. package/lib/objects/space-object.js +60 -0
  33. package/lib/objects/space-object.js.map +1 -0
  34. package/lib/objects/star.d.ts +46 -0
  35. package/lib/objects/star.js +91 -0
  36. package/lib/objects/star.js.map +1 -0
  37. package/lib/ootk.d.ts +16 -23
  38. package/lib/ootk.js +16 -23
  39. package/lib/ootk.js.map +1 -1
  40. package/{dist → lib/sgp4}/sgp4.d.ts +14 -21
  41. package/lib/{sgp4.js → sgp4/sgp4.js} +35 -27
  42. package/lib/sgp4/sgp4.js.map +1 -0
  43. package/lib/{utils/TleFormatData.d.ts → tle/tle-format-data.d.ts} +0 -0
  44. package/lib/{utils/TleFormatData.js → tle/tle-format-data.js} +1 -1
  45. package/lib/tle/tle-format-data.js.map +1 -0
  46. package/{dist → lib/tle}/tle.d.ts +12 -16
  47. package/lib/{tle.js → tle/tle.js} +13 -17
  48. package/lib/tle/tle.js.map +1 -0
  49. package/lib/{transforms.d.ts → transforms/transforms.d.ts} +12 -16
  50. package/lib/{transforms.js → transforms/transforms.js} +12 -16
  51. package/lib/transforms/transforms.js.map +1 -0
  52. package/{dist → lib/types}/types.d.ts +68 -0
  53. package/lib/types/types.js +34 -0
  54. package/lib/types/types.js.map +1 -0
  55. package/lib/utils/constants.d.ts +13 -16
  56. package/lib/utils/constants.js +13 -16
  57. package/lib/utils/constants.js.map +1 -1
  58. package/lib/utils/moon-math.d.ts +104 -0
  59. package/lib/utils/moon-math.js +387 -0
  60. package/lib/utils/moon-math.js.map +1 -0
  61. package/lib/utils/sun-math.d.ts +230 -0
  62. package/lib/utils/sun-math.js +421 -0
  63. package/lib/utils/sun-math.js.map +1 -0
  64. package/lib/utils/utils.d.ts +36 -0
  65. package/lib/{utils.js → utils/utils.js} +18 -18
  66. package/lib/utils/utils.js.map +1 -0
  67. package/package.json +2 -1
  68. package/dist/sat.d.ts +0 -51
  69. package/dist/transforms.d.ts +0 -59
  70. package/dist/utils.d.ts +0 -36
  71. package/lib/sat.d.ts +0 -51
  72. package/lib/sat.js +0 -81
  73. package/lib/sat.js.map +0 -1
  74. package/lib/sgp4.d.ts +0 -89
  75. package/lib/sgp4.js.map +0 -1
  76. package/lib/tle.d.ts +0 -378
  77. package/lib/tle.js.map +0 -1
  78. package/lib/transforms.js.map +0 -1
  79. package/lib/types.d.ts +0 -204
  80. package/lib/types.js +0 -2
  81. package/lib/types.js.map +0 -1
  82. package/lib/utils/TleFormatData.js.map +0 -1
  83. package/lib/utils.d.ts +0 -36
  84. package/lib/utils.js.map +0 -1
@@ -0,0 +1,149 @@
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 DetailedSat class is an extension of the Sat class that provides additional
7
+ * properties for categorizing and filtering satellites.
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 { Sat } from './sat';
39
+ var DetailedSat = /** @class */ (function (_super) {
40
+ __extends(DetailedSat, _super);
41
+ function DetailedSat(info, options, details) {
42
+ var _this = _super.call(this, info, options) || this;
43
+ _this.setLaunchDetails(details.launchDetails);
44
+ _this.setSpaceCraftDetails(details.spaceCraftDetails);
45
+ _this.setOperationsDetails(details.operationsDetails);
46
+ return _this;
47
+ }
48
+ DetailedSat.prototype.setLaunchDetails = function (details) {
49
+ if (details.launchDate) {
50
+ this.launchDate = details.launchDate;
51
+ }
52
+ if (details.launchMass) {
53
+ this.launchMass = details.launchMass;
54
+ }
55
+ if (details.launchSite) {
56
+ this.launchSite = details.launchSite;
57
+ }
58
+ if (details.launchVehicle) {
59
+ this.launchVehicle = details.launchVehicle;
60
+ }
61
+ };
62
+ DetailedSat.prototype.getLaunchDetails = function () {
63
+ return {
64
+ launchDate: this.launchDate,
65
+ launchMass: this.launchMass,
66
+ launchSite: this.launchSite,
67
+ launchVehicle: this.launchVehicle,
68
+ };
69
+ };
70
+ DetailedSat.prototype.setSpaceCraftDetails = function (details) {
71
+ if (details.lifetime) {
72
+ this.lifetime = details.lifetime;
73
+ }
74
+ if (details.maneuver) {
75
+ this.maneuver = details.maneuver;
76
+ }
77
+ if (details.manufacturer) {
78
+ this.manufacturer = details.manufacturer;
79
+ }
80
+ if (details.motor) {
81
+ this.motor = details.motor;
82
+ }
83
+ if (details.power) {
84
+ this.power = details.power;
85
+ }
86
+ if (details.payload) {
87
+ this.payload = details.payload;
88
+ }
89
+ if (details.purpose) {
90
+ this.purpose = details.purpose;
91
+ }
92
+ if (details.shape) {
93
+ this.shape = details.shape;
94
+ }
95
+ if (details.span) {
96
+ this.span = details.span;
97
+ }
98
+ if (details.configuration) {
99
+ this.configuration = details.configuration;
100
+ }
101
+ if (details.equipment) {
102
+ this.equipment = details.equipment;
103
+ }
104
+ if (details.dryMass) {
105
+ this.dryMass = details.dryMass;
106
+ }
107
+ };
108
+ DetailedSat.prototype.getSpaceCraftDetails = function () {
109
+ return {
110
+ lifetime: this.lifetime,
111
+ maneuver: this.maneuver,
112
+ manufacturer: this.manufacturer,
113
+ motor: this.motor,
114
+ power: this.power,
115
+ payload: this.payload,
116
+ purpose: this.purpose,
117
+ shape: this.shape,
118
+ span: this.span,
119
+ configuration: this.configuration,
120
+ equipment: this.equipment,
121
+ dryMass: this.dryMass,
122
+ };
123
+ };
124
+ DetailedSat.prototype.setOperationsDetails = function (details) {
125
+ if (details.user) {
126
+ this.user = details.user;
127
+ }
128
+ if (details.mission) {
129
+ this.mission = details.mission;
130
+ }
131
+ if (details.owner) {
132
+ this.owner = details.owner;
133
+ }
134
+ if (details.country) {
135
+ this.country = details.country;
136
+ }
137
+ };
138
+ DetailedSat.prototype.getOperationsDetails = function () {
139
+ return {
140
+ user: this.user,
141
+ mission: this.mission,
142
+ owner: this.owner,
143
+ country: this.country,
144
+ };
145
+ };
146
+ return DetailedSat;
147
+ }(Sat));
148
+ export { DetailedSat };
149
+ //# sourceMappingURL=detailed-sat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detailed-sat.js","sourceRoot":"","sources":["../../src/objects/detailed-sat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAW5B;IAAiC,+BAAG;IAyClC,qBACE,IAAgB,EAChB,OAAO,EACP,OAIC;QAPH,YASE,kBAAM,IAAI,EAAE,OAAO,CAAC,SAKrB;QAHC,KAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC7C,KAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACrD,KAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;;IACvD,CAAC;IAEM,sCAAgB,GAAvB,UAAwB,OAAsB;QAC5C,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;SACtC;QACD,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,IAAI,CAAC,UAAU,GA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,IAAI,OAAO,CAAC,OAAO,EAAE;YACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;SAChC;IACH,CAAC;IAEM,0CAAoB,GAA3B;QACE,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;IACH,kBAAC;AAAD,CAAC,AAhKD,CAAiC,GAAG,GAgKnC"}
@@ -0,0 +1,4 @@
1
+ export { DetailedSat } from './detailed-sat';
2
+ export { Sat } from './sat';
3
+ export { Sensor } from './sensor';
4
+ export { Star } from './star';
@@ -0,0 +1,5 @@
1
+ export { DetailedSat } from './detailed-sat';
2
+ export { Sat } from './sat';
3
+ export { Sensor } from './sensor';
4
+ export { Star } from './star';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/objects/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,88 @@
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 Sat class provides functions for calculating satellites positions relative
7
+ * to earth based sensors and other orbital 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 { EcfVec3, EciVec3, LlaVec3, RaeVec3, SatelliteRecord, SpaceObjectType, StateVector } from '../types/types';
24
+ import { Sensor } from './sensor';
25
+ import { SpaceObject } from './space-object';
26
+ interface ObjectInfo {
27
+ name?: string;
28
+ type?: SpaceObjectType;
29
+ rcs?: number;
30
+ vmag?: number;
31
+ tle1: string;
32
+ tle2: string;
33
+ }
34
+ export declare class Sat extends SpaceObject {
35
+ satNum: number;
36
+ satrec: SatelliteRecord;
37
+ intlDes: string;
38
+ epochYear: number;
39
+ epochDay: number;
40
+ meanMoDev1: number;
41
+ meanMoDev2: number;
42
+ bstar: number;
43
+ inclination: number;
44
+ raan: number;
45
+ eccentricity: number;
46
+ argOfPerigee: number;
47
+ meanAnomaly: number;
48
+ meanMotion: number;
49
+ period: number;
50
+ apogee: number;
51
+ perigee: number;
52
+ options: any;
53
+ constructor(info: ObjectInfo, options: any);
54
+ propagateTo(date: Date): Sat;
55
+ /**
56
+ * Calculates position and velocity in ECI coordinates at a given time.
57
+ * @param {Date} date Date to calculate the state vector for
58
+ * @returns {StateVector} State vector for the given date
59
+ */
60
+ getStateVec(date?: Date): StateVector;
61
+ /**
62
+ * Calculates ECI position at a given time.
63
+ * @param {Date} date Date to calculate
64
+ * @returns {EciVec3} ECI position vector
65
+ */
66
+ getEci(date?: Date): EciVec3;
67
+ /**
68
+ * Calculates ECF position at a given time.
69
+ * @param {Date} date Date to calculate
70
+ * @returns {EcfVec3} ECF position vector
71
+ */
72
+ getEcf(date?: Date): EcfVec3;
73
+ /**
74
+ * Calculates LLA position at a given time.
75
+ * @param {Date} date Date to calculate
76
+ * @returns {LlaVec3} LLA position vector
77
+ */
78
+ getLla(date?: Date): LlaVec3;
79
+ getRae(sensor: Sensor, date?: Date): RaeVec3;
80
+ /**
81
+ * Calculates the time variables for a given date relative to the TLE epoch.
82
+ * @param {Date} date Date to calculate
83
+ * @param {SatelliteRecord} satrec Satellite orbital information
84
+ * @returns {{m: number, gmst: GreenwichMeanSiderealTime, j: number}} Time variables
85
+ */
86
+ private static calculateTimeVariables;
87
+ }
88
+ export {};
@@ -0,0 +1,141 @@
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 Sat class provides functions for calculating satellites positions relative
7
+ * to earth based sensors and other orbital 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
+ 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, MINUTES_PER_DAY } from '../utils/constants';
39
+ import { Sgp4 } from '../sgp4/sgp4';
40
+ import { SpaceObject } from './space-object';
41
+ import { Tle } from '../tle/tle';
42
+ import { Transforms } from '../transforms/transforms';
43
+ import { Utils } from '../utils/utils';
44
+ var Sat = /** @class */ (function (_super) {
45
+ __extends(Sat, _super);
46
+ function Sat(info, options) {
47
+ var _this = _super.call(this, info) || this;
48
+ var tleData = Tle.parseTle(info.tle1, info.tle2);
49
+ _this.satNum = tleData.satNum;
50
+ _this.intlDes = tleData.intlDes;
51
+ _this.epochYear = tleData.epochYear;
52
+ _this.epochDay = tleData.epochDay;
53
+ _this.meanMoDev1 = tleData.meanMoDev1;
54
+ _this.meanMoDev2 = tleData.meanMoDev2;
55
+ _this.bstar = tleData.bstar;
56
+ _this.inclination = tleData.inclination;
57
+ _this.raan = tleData.raan;
58
+ _this.eccentricity = tleData.eccentricity;
59
+ _this.argOfPerigee = tleData.argOfPerigee;
60
+ _this.meanAnomaly = tleData.meanAnomaly;
61
+ _this.meanMotion = tleData.meanMotion;
62
+ _this.period = 1440 / _this.meanMotion;
63
+ // NOTE: Calculate apogee and perigee
64
+ _this.satrec = Sgp4.createSatrec(info.tle1, info.tle2);
65
+ _this.options = options;
66
+ return _this;
67
+ }
68
+ Sat.prototype.propagateTo = function (date) {
69
+ var m = Sat.calculateTimeVariables(date, this.satrec).m;
70
+ var eci = Sgp4.propagate(this.satrec, m).position || { x: 0, y: 0, z: 0 };
71
+ this.position = eci;
72
+ this.time = date;
73
+ return this;
74
+ };
75
+ /**
76
+ * Calculates position and velocity in ECI coordinates at a given time.
77
+ * @param {Date} date Date to calculate the state vector for
78
+ * @returns {StateVector} State vector for the given date
79
+ */
80
+ Sat.prototype.getStateVec = function (date) {
81
+ if (date === void 0) { date = this.time; }
82
+ var m = Sat.calculateTimeVariables(date, this.satrec).m;
83
+ return Sgp4.propagate(this.satrec, m);
84
+ };
85
+ /**
86
+ * Calculates ECI position at a given time.
87
+ * @param {Date} date Date to calculate
88
+ * @returns {EciVec3} ECI position vector
89
+ */
90
+ Sat.prototype.getEci = function (date) {
91
+ if (date === void 0) { date = this.time; }
92
+ var m = Sat.calculateTimeVariables(date, this.satrec).m;
93
+ var eci = Sgp4.propagate(this.satrec, m).position;
94
+ return eci ? eci : { x: 0, y: 0, z: 0 };
95
+ };
96
+ /**
97
+ * Calculates ECF position at a given time.
98
+ * @param {Date} date Date to calculate
99
+ * @returns {EcfVec3} ECF position vector
100
+ */
101
+ Sat.prototype.getEcf = function (date) {
102
+ if (date === void 0) { date = this.time; }
103
+ var _a = Sat.calculateTimeVariables(date, this.satrec), m = _a.m, gmst = _a.gmst;
104
+ var eci = Sgp4.propagate(this.satrec, m).position || { x: 0, y: 0, z: 0 };
105
+ return Transforms.eci2ecf(eci, gmst);
106
+ };
107
+ /**
108
+ * Calculates LLA position at a given time.
109
+ * @param {Date} date Date to calculate
110
+ * @returns {LlaVec3} LLA position vector
111
+ */
112
+ Sat.prototype.getLla = function (date) {
113
+ if (date === void 0) { date = this.time; }
114
+ var _a = Sat.calculateTimeVariables(date, this.satrec), m = _a.m, gmst = _a.gmst;
115
+ var eci = Sgp4.propagate(this.satrec, m).position || { x: 0, y: 0, z: 0 };
116
+ return Transforms.eci2lla(eci, gmst);
117
+ };
118
+ Sat.prototype.getRae = function (sensor, date) {
119
+ if (date === void 0) { date = this.time; }
120
+ var _a = Sat.calculateTimeVariables(date, this.satrec), m = _a.m, gmst = _a.gmst;
121
+ var eci = Sgp4.propagate(this.satrec, m).position || { x: 0, y: 0, z: 0 };
122
+ var ecf = Transforms.eci2ecf(eci, gmst);
123
+ return Transforms.ecf2rae({ lat: sensor.lat, lon: sensor.lon, alt: sensor.alt }, ecf);
124
+ };
125
+ /**
126
+ * Calculates the time variables for a given date relative to the TLE epoch.
127
+ * @param {Date} date Date to calculate
128
+ * @param {SatelliteRecord} satrec Satellite orbital information
129
+ * @returns {{m: number, gmst: GreenwichMeanSiderealTime, j: number}} Time variables
130
+ */
131
+ Sat.calculateTimeVariables = function (date, satrec) {
132
+ var j = Utils.jday(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()) +
133
+ date.getUTCMilliseconds() * DAY_TO_MS;
134
+ var gmst = Sgp4.gstime(j);
135
+ var m = satrec ? (j - satrec.jdsatepoch) * MINUTES_PER_DAY : null;
136
+ return { gmst: gmst, m: m, j: j };
137
+ };
138
+ return Sat;
139
+ }(SpaceObject));
140
+ export { Sat };
141
+ //# sourceMappingURL=sat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sat.js","sourceRoot":"","sources":["../../src/objects/sat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;AAEH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAahE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAWvC;IAAyB,uBAAW;IAsBlC,aAAY,IAAgB,EAAE,OAAO;QAArC,YACE,kBAAM,IAAI,CAAC,SAuBZ;QArBC,IAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnD,KAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC,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IACY,0BAAsB,GAArC,UACE,IAAU,EACV,MAAwB;QAExB,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,IAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC;QAEpE,OAAO,EAAE,IAAI,MAAA,EAAE,CAAC,GAAA,EAAE,CAAC,GAAA,EAAE,CAAC;IACxB,CAAC;IACH,UAAC;AAAD,CAAC,AA3ID,CAAyB,WAAW,GA2InC"}
@@ -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 Sensor class is used for creating ground based observers.
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 { RaeVec3, SpaceObjectType } from '../types/types';
23
+ import { BaseObject } from './base-object';
24
+ import { Sat } from './sat';
25
+ interface ObjectInfo {
26
+ name?: string;
27
+ type?: SpaceObjectType;
28
+ lat: number;
29
+ lon: number;
30
+ alt: number;
31
+ }
32
+ export declare class Sensor extends BaseObject {
33
+ lat: number;
34
+ lon: number;
35
+ alt: number;
36
+ constructor(info: ObjectInfo);
37
+ setTime(date: Date): Sensor;
38
+ getRae(sat: Sat, date?: Date): RaeVec3;
39
+ }
40
+ export {};
@@ -0,0 +1,88 @@
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 Sensor class is used for creating ground based observers.
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
+ var __extends = (this && this.__extends) || (function () {
23
+ var extendStatics = function (d, b) {
24
+ extendStatics = Object.setPrototypeOf ||
25
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
27
+ return extendStatics(d, b);
28
+ };
29
+ return function (d, b) {
30
+ if (typeof b !== "function" && b !== null)
31
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
32
+ extendStatics(d, b);
33
+ function __() { this.constructor = d; }
34
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
35
+ };
36
+ })();
37
+ import { SpaceObjectType } from '../types/types';
38
+ import { BaseObject } from './base-object';
39
+ var Sensor = /** @class */ (function (_super) {
40
+ __extends(Sensor, _super);
41
+ function Sensor(info) {
42
+ var _this = this;
43
+ // If there is a sensor type verify it is valid
44
+ if (info.type) {
45
+ switch (info.type) {
46
+ case SpaceObjectType.OPTICAL:
47
+ case SpaceObjectType.MECHANICAL:
48
+ case SpaceObjectType.PHASED_ARRAY_RADAR:
49
+ case SpaceObjectType.OBSERVER:
50
+ case SpaceObjectType.BISTATIC_RADIO_TELESCOPE:
51
+ break;
52
+ default:
53
+ throw new Error('Invalid sensor type');
54
+ }
55
+ }
56
+ _this = _super.call(this, info) || this;
57
+ if (info.lat >= -90 && info.lat <= 90) {
58
+ _this.lat = info.lat;
59
+ }
60
+ else {
61
+ throw new Error('Invalid latitude');
62
+ }
63
+ if (info.lon >= -180 && info.lon <= 180) {
64
+ _this.lon = info.lon;
65
+ }
66
+ else {
67
+ throw new Error('Invalid longitude');
68
+ }
69
+ if (info.alt >= 0) {
70
+ _this.alt = info.alt;
71
+ }
72
+ else {
73
+ throw new Error('Invalid altitude');
74
+ }
75
+ return _this;
76
+ }
77
+ Sensor.prototype.setTime = function (date) {
78
+ this.time = date;
79
+ return this;
80
+ };
81
+ Sensor.prototype.getRae = function (sat, date) {
82
+ if (date === void 0) { date = this.time; }
83
+ return sat.getRae(this, date);
84
+ };
85
+ return Sensor;
86
+ }(BaseObject));
87
+ export { Sensor };
88
+ //# sourceMappingURL=sensor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sensor.js","sourceRoot":"","sources":["../../src/objects/sensor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,OAAO,EAAW,eAAe,EAAE,MAAM,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M,GAAb,UAAc,GAAQ,EAAE,IAAsB;QAAtB,qBAAA,EAAA,OAAa,IAAI,CAAC,IAAI;QAC5C,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IACH,aAAC;AAAD,CAAC,AAlDD,CAA4B,UAAU,GAkDrC"}
@@ -0,0 +1,38 @@
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 SpaceObject class is meant to provide properties to satellites/stars that
7
+ * do not apply to ground 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 { BaseObject } from './base-object';
24
+ import { SpaceObjectType } from '../types/types';
25
+ interface ObjectInfo {
26
+ name?: string;
27
+ type?: SpaceObjectType;
28
+ rcs?: number;
29
+ vmag?: number;
30
+ }
31
+ export declare class SpaceObject extends BaseObject {
32
+ rcs: number;
33
+ vmag: number;
34
+ constructor(info: ObjectInfo);
35
+ getRcs(): number;
36
+ getVmag(): number;
37
+ }
38
+ export {};
@@ -0,0 +1,60 @@
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 SpaceObject class is meant to provide properties to satellites/stars that
7
+ * do not apply to ground 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
+ 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 { BaseObject } from './base-object';
39
+ var SpaceObject = /** @class */ (function (_super) {
40
+ __extends(SpaceObject, _super);
41
+ function SpaceObject(info) {
42
+ var _this = _super.call(this, info) || this;
43
+ if (info.rcs) {
44
+ _this.rcs = info.rcs;
45
+ }
46
+ if (info.vmag) {
47
+ _this.vmag = info.vmag;
48
+ }
49
+ return _this;
50
+ }
51
+ SpaceObject.prototype.getRcs = function () {
52
+ return this.rcs;
53
+ };
54
+ SpaceObject.prototype.getVmag = function () {
55
+ return this.vmag;
56
+ };
57
+ return SpaceObject;
58
+ }(BaseObject));
59
+ export { SpaceObject };
60
+ //# sourceMappingURL=space-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"space-object.js","sourceRoot":"","sources":["../../src/objects/space-object.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C;IAAiC,+BAAU;IAKzC,qBAAY,IAAgB;QAA5B,YACE,kBAAM,IAAI,CAAC,SASZ;QAPC,IAAI,IAAI,CAAC,GAAG,EAAE;YACZ,KAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;SACrB;QAED,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACvB;;IACH,CAAC;IAEM,4BAAM,GAAb;QACE,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAEM,6BAAO,GAAd;QACE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IACH,kBAAC;AAAD,CAAC,AAxBD,CAAiC,UAAU,GAwB1C"}