ootk 4.0.0-1 → 4.0.0-3
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/CHANGELOG.md +16 -1
- package/dist/enums/CatalogSource.d.ts +8 -0
- package/dist/enums/CatalogSource.js +10 -0
- package/dist/enums/CatalogSource.js.map +1 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.js +2 -0
- package/dist/enums/index.js.map +1 -0
- package/dist/main.d.ts +3 -2
- package/dist/main.js +3 -4
- package/dist/main.js.map +1 -1
- package/dist/objects/DetailedSatellite.d.ts +1 -0
- package/dist/objects/DetailedSatellite.js +18 -1
- package/dist/objects/DetailedSatellite.js.map +1 -1
- package/dist/utils/functions.d.ts +8 -0
- package/dist/utils/functions.js +18 -0
- package/dist/utils/functions.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/jacobian.d.ts +1 -1
- package/dist/utils/jacobian.js +2 -2
- package/dist/utils/jacobian.js.map +1 -1
- package/package.json +2 -2
- package/src/enums/CatalogSource.ts +8 -0
- package/src/enums/index.ts +1 -0
- package/src/main.ts +3 -4
- package/src/objects/DetailedSatellite.ts +23 -0
- package/src/utils/functions.ts +21 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/jacobian.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,22 @@
|
|
|
3
3
|
This is an automatic changelog that automatically records all changes made to the project. Generated from Git commit
|
|
4
4
|
messages, it details updates like bug fixes and new features, providing a clear history of the project's development.
|
|
5
5
|
|
|
6
|
-
#### [4.0.0-
|
|
6
|
+
#### [4.0.0-3](https://github.com/thkruz/ootk/compare/v4.0.0-2...4.0.0-3)
|
|
7
|
+
|
|
8
|
+
- fix: :bug: fix Vimpel TLEs [`6092a4b`](https://github.com/thkruz/ootk/commit/6092a4b411c1092ee75ed6c34eee499cfa3cefef)
|
|
9
|
+
- fix: :bug: fix enum [`009342f`](https://github.com/thkruz/ootk/commit/009342f15e9f03de98e477c3c7ce1ef7534caa2d)
|
|
10
|
+
|
|
11
|
+
#### [v4.0.0-2](https://github.com/thkruz/ootk/compare/v4.0.0-1...v4.0.0-2)
|
|
12
|
+
|
|
13
|
+
> 17 January 2024
|
|
14
|
+
|
|
15
|
+
- refactor: :recycle: move derivative from ootk-core [`9a9b50d`](https://github.com/thkruz/ootk/commit/9a9b50d4402b24398d920ae4ef0a76a7d19edabf)
|
|
16
|
+
- build: :arrow_up: bump ootk-core [`efc4aa0`](https://github.com/thkruz/ootk/commit/efc4aa0caf7182afd9fbba7e29a50a8defd16ebe)
|
|
17
|
+
- test: :white_check_mark: update snapshots [`ca95ad6`](https://github.com/thkruz/ootk/commit/ca95ad65be2de3f818390585a7bc1749ca7bf918)
|
|
18
|
+
|
|
19
|
+
#### [v4.0.0-1](https://github.com/thkruz/ootk/compare/v4.0.0-0...v4.0.0-1)
|
|
20
|
+
|
|
21
|
+
> 17 January 2024
|
|
7
22
|
|
|
8
23
|
- feat: :sparkles: integrate ootk-core v1.0.7 [`101eeb6`](https://github.com/thkruz/ootk/commit/101eeb6a21008ce198832818154fa0442691e4ad)
|
|
9
24
|
- refactor: :recycle: refactor to match latest ootk-core [`ae37922`](https://github.com/thkruz/ootk/commit/ae3792283571c69ff0d6406188d0c7219215c56f)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var CatalogSource;
|
|
2
|
+
(function (CatalogSource) {
|
|
3
|
+
CatalogSource["USSF"] = "USSF";
|
|
4
|
+
CatalogSource["CELESTRAK"] = "Celestrak";
|
|
5
|
+
CatalogSource["UNIV_OF_MICH"] = "University of Michigan";
|
|
6
|
+
CatalogSource["VIMPEL"] = "JSC Vimpel";
|
|
7
|
+
CatalogSource["TLE_TXT"] = "TLE.txt";
|
|
8
|
+
CatalogSource["EXTRA_JSON"] = "extra.json";
|
|
9
|
+
})(CatalogSource || (CatalogSource = {}));
|
|
10
|
+
//# sourceMappingURL=CatalogSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CatalogSource.js","sourceRoot":"","sources":["../../src/enums/CatalogSource.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,wCAAuB,CAAA;IACvB,wDAAuC,CAAA;IACvC,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;IACnB,0CAAyB,CAAA;AAC3B,CAAC,EAPW,aAAa,KAAb,aAAa,QAOxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CatalogSource } from './CatalogSource';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/main.d.ts
CHANGED
|
@@ -20,10 +20,11 @@
|
|
|
20
20
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
22
|
export * from 'ootk-core';
|
|
23
|
+
export * from './enums';
|
|
24
|
+
export * from './types/types';
|
|
25
|
+
export * from './interfaces';
|
|
23
26
|
export * from './coordinate';
|
|
24
27
|
export * from './objects';
|
|
25
28
|
export * from './operations';
|
|
26
29
|
export * from './transforms';
|
|
27
|
-
export * from './interfaces';
|
|
28
|
-
export * from './types/types';
|
|
29
30
|
export * from './utils';
|
package/dist/main.js
CHANGED
|
@@ -20,13 +20,12 @@
|
|
|
20
20
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
21
21
|
*/
|
|
22
22
|
export * from 'ootk-core';
|
|
23
|
+
export * from './enums';
|
|
24
|
+
export * from './types/types';
|
|
25
|
+
export * from './interfaces';
|
|
23
26
|
export * from './coordinate';
|
|
24
27
|
export * from './objects';
|
|
25
28
|
export * from './operations';
|
|
26
29
|
export * from './transforms';
|
|
27
|
-
export * from './interfaces';
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
export * from './types/types';
|
|
31
30
|
export * from './utils';
|
|
32
31
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -49,6 +49,7 @@ export declare class DetailedSatellite extends Satellite {
|
|
|
49
49
|
altId: string;
|
|
50
50
|
altName: string;
|
|
51
51
|
constructor(info: DetailedSatelliteParams & LaunchDetails & OperationsDetails & SpaceCraftDetails, options?: OptionsParams);
|
|
52
|
+
private static setSccNumTo0_;
|
|
52
53
|
private initSpaceCraftDetails_;
|
|
53
54
|
private initOperationDetails_;
|
|
54
55
|
private initLaunchDetails_;
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* You should have received a copy of the GNU Affero General Public License along with
|
|
15
15
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
|
-
import { Satellite, } from 'ootk-core';
|
|
17
|
+
import { FormatTle, Satellite, } from 'ootk-core';
|
|
18
|
+
import { CatalogSource } from 'src/enums/CatalogSource';
|
|
18
19
|
/**
|
|
19
20
|
* Represents a detailed satellite object with launch, spacecraft, and operations details.
|
|
20
21
|
*/
|
|
@@ -48,6 +49,9 @@ export class DetailedSatellite extends Satellite {
|
|
|
48
49
|
altId = '';
|
|
49
50
|
altName = '';
|
|
50
51
|
constructor(info, options) {
|
|
52
|
+
if (info.source === CatalogSource.VIMPEL) {
|
|
53
|
+
info = DetailedSatellite.setSccNumTo0_(info);
|
|
54
|
+
}
|
|
51
55
|
super(info, options);
|
|
52
56
|
this.active ??= true;
|
|
53
57
|
this.initSpaceCraftDetails_(info);
|
|
@@ -61,6 +65,19 @@ export class DetailedSatellite extends Satellite {
|
|
|
61
65
|
this.initOperationDetails_(info);
|
|
62
66
|
this.initLaunchDetails_(info);
|
|
63
67
|
}
|
|
68
|
+
static setSccNumTo0_(info) {
|
|
69
|
+
info.tle1 = FormatTle.setCharAt(info.tle1, 2, '0');
|
|
70
|
+
info.tle1 = FormatTle.setCharAt(info.tle1, 3, '0');
|
|
71
|
+
info.tle1 = FormatTle.setCharAt(info.tle1, 4, '0');
|
|
72
|
+
info.tle1 = FormatTle.setCharAt(info.tle1, 5, '0');
|
|
73
|
+
info.tle1 = FormatTle.setCharAt(info.tle1, 6, '0');
|
|
74
|
+
info.tle2 = FormatTle.setCharAt(info.tle2, 2, '0');
|
|
75
|
+
info.tle2 = FormatTle.setCharAt(info.tle2, 3, '0');
|
|
76
|
+
info.tle2 = FormatTle.setCharAt(info.tle2, 4, '0');
|
|
77
|
+
info.tle2 = FormatTle.setCharAt(info.tle2, 5, '0');
|
|
78
|
+
info.tle2 = FormatTle.setCharAt(info.tle2, 6, '0');
|
|
79
|
+
return info;
|
|
80
|
+
}
|
|
64
81
|
initSpaceCraftDetails_(info) {
|
|
65
82
|
this.lifetime = info.lifetime ?? '';
|
|
66
83
|
this.maneuver = info.maneuver ?? '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailedSatellite.js","sourceRoot":"","sources":["../../src/objects/DetailedSatellite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"DetailedSatellite.js","sourceRoot":"","sources":["../../src/objects/DetailedSatellite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,SAAS,EAIT,SAAS,GAIV,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IAC9C,aAAa,GAAW,EAAE,CAAC;IAC3B,OAAO,GAAW,EAAE,CAAC;IACrB,OAAO,GAAW,EAAE,CAAC;IACrB,SAAS,GAAW,EAAE,CAAC;IACvB,UAAU,GAAW,EAAE,CAAC;IACxB,UAAU,GAAW,EAAE,CAAC;IACxB,UAAU,GAAW,EAAE,CAAC;IACxB,aAAa,GAAW,EAAE,CAAC;IAC3B,QAAQ,GAAoB,EAAE,CAAC;IAC/B,QAAQ,GAAW,EAAE,CAAC;IACtB,YAAY,GAAW,EAAE,CAAC;IAC1B,OAAO,GAAW,EAAE,CAAC;IACrB,GAAG,GAAW,EAAE,CAAC;IACjB,KAAK,GAAW,EAAE,CAAC;IACnB,KAAK,GAAW,EAAE,CAAC;IACnB,OAAO,GAAW,EAAE,CAAC;IACrB,KAAK,GAAW,EAAE,CAAC;IACnB,OAAO,GAAW,EAAE,CAAC;IACrB,MAAM,GAAW,EAAE,CAAC;IACpB,QAAQ,GAAW,EAAE,CAAC;IACtB,KAAK,GAAW,EAAE,CAAC;IACnB,IAAI,GAAW,EAAE,CAAC;IAClB,IAAI,GAAW,EAAE,CAAC;IAClB,MAAM,GAAW,EAAE,CAAC;IACpB,IAAI,CAAS;IACb,GAAG,CAAS;IACZ,KAAK,GAAW,EAAE,CAAC;IACnB,OAAO,GAAW,EAAE,CAAC;IAErB,YACE,IAAqF,EACrF,OAAuB;QAEvB,IAAI,IAAI,CAAC,MAAM,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Aa;SAClC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,oBAAoB;QAClB,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;IAED;;;OAGG;IACH,oBAAoB;QAClB,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DifferentiableFunction } from '../main';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the derivative of a differentiable function.
|
|
4
|
+
* @param f The differentiable function.
|
|
5
|
+
* @param h The step size for numerical differentiation. Default value is 1e-3.
|
|
6
|
+
* @returns The derivative function.
|
|
7
|
+
*/
|
|
8
|
+
export declare function derivative(f: DifferentiableFunction, h?: number): DifferentiableFunction;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the derivative of a differentiable function.
|
|
3
|
+
* @param f The differentiable function.
|
|
4
|
+
* @param h The step size for numerical differentiation. Default value is 1e-3.
|
|
5
|
+
* @returns The derivative function.
|
|
6
|
+
*/
|
|
7
|
+
export function derivative(f, h = 1e-3) {
|
|
8
|
+
/**
|
|
9
|
+
* @param x The value at which to calculate the derivative.
|
|
10
|
+
* @returns The derivative of the function at the given value.
|
|
11
|
+
*/
|
|
12
|
+
function df(x) {
|
|
13
|
+
const hh = h * 0.5;
|
|
14
|
+
return (f(x + hh) - f(x - hh)) / h;
|
|
15
|
+
}
|
|
16
|
+
return df;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/utils/functions.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,CAAyB,EAAE,CAAC,GAAG,IAAI;IAC5D;;;OAGG;IACH,SAAS,EAAE,CAAC,CAAS;QACnB,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC;QAEnB,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
package/dist/utils/jacobian.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ import { JacobianFunction } from '../types/types';
|
|
|
8
8
|
* @param step The step size for numerical differentiation (default: 1e-5).
|
|
9
9
|
* @returns The Jacobian matrix.
|
|
10
10
|
*/
|
|
11
|
-
export declare
|
|
11
|
+
export declare const jacobian: (f: JacobianFunction, m: number, x0: Float64Array, step?: number) => Matrix;
|
package/dist/utils/jacobian.js
CHANGED
|
@@ -8,7 +8,7 @@ import { array2d, Matrix, Vector } from 'ootk-core';
|
|
|
8
8
|
* @param step The step size for numerical differentiation (default: 1e-5).
|
|
9
9
|
* @returns The Jacobian matrix.
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export const jacobian = (f, m, x0, step = 0.00001) => {
|
|
12
12
|
const n = x0.length;
|
|
13
13
|
const j = array2d(m, n, 0);
|
|
14
14
|
const h = 0.5 * step;
|
|
@@ -25,5 +25,5 @@ export function jacobian(f, m, x0, step = 0.00001) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
return new Matrix(j);
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
//# sourceMappingURL=jacobian.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jacobian.js","sourceRoot":"","sources":["../../src/utils/jacobian.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGpD,uDAAuD;AAEvD;;;;;;;GAOG;AACH,MAAM,
|
|
1
|
+
{"version":3,"file":"jacobian.js","sourceRoot":"","sources":["../../src/utils/jacobian.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGpD,uDAAuD;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAmB,EAAE,CAAS,EAAE,EAAgB,EAAE,IAAI,GAAG,OAAO,EAAU,EAAE;IACnG,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IACpB,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3B,MAAM,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC;IAErB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;QAEtB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACX,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAE7B,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;QAEtB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACX,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAE7B,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;QAE3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC1B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;SAC1B;KACF;IAED,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ootk",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/main.js",
|
|
6
6
|
"description": "Orbital Object Toolkit including Multiple Propagators, Initial Orbit Determination, and Maneuver Calculations.",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"typescript": "^4.9.5"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"ootk-core": "^1.0.
|
|
56
|
+
"ootk-core": "^1.0.8"
|
|
57
57
|
},
|
|
58
58
|
"homepage": "https://github.com/thkruz/ootk"
|
|
59
59
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CatalogSource } from './CatalogSource';
|
package/src/main.ts
CHANGED
|
@@ -21,12 +21,11 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
export * from 'ootk-core';
|
|
24
|
+
export * from './enums';
|
|
25
|
+
export * from './types/types';
|
|
26
|
+
export * from './interfaces';
|
|
24
27
|
export * from './coordinate';
|
|
25
28
|
export * from './objects';
|
|
26
29
|
export * from './operations';
|
|
27
30
|
export * from './transforms';
|
|
28
|
-
export * from './interfaces';
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
export * from './types/types';
|
|
32
31
|
export * from './utils';
|
|
@@ -16,13 +16,17 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import {
|
|
19
|
+
FormatTle,
|
|
19
20
|
LaunchDetails,
|
|
20
21
|
OperationsDetails,
|
|
21
22
|
OptionsParams,
|
|
22
23
|
Satellite,
|
|
23
24
|
SpaceCraftDetails,
|
|
25
|
+
TleLine1,
|
|
26
|
+
TleLine2,
|
|
24
27
|
} from 'ootk-core';
|
|
25
28
|
import { DetailedSatelliteParams } from '../types/types';
|
|
29
|
+
import { CatalogSource } from 'src/enums/CatalogSource';
|
|
26
30
|
|
|
27
31
|
/**
|
|
28
32
|
* Represents a detailed satellite object with launch, spacecraft, and operations details.
|
|
@@ -61,6 +65,10 @@ export class DetailedSatellite extends Satellite {
|
|
|
61
65
|
info: DetailedSatelliteParams & LaunchDetails & OperationsDetails & SpaceCraftDetails,
|
|
62
66
|
options?: OptionsParams,
|
|
63
67
|
) {
|
|
68
|
+
if (info.source === CatalogSource.VIMPEL) {
|
|
69
|
+
info = DetailedSatellite.setSccNumTo0_(info);
|
|
70
|
+
}
|
|
71
|
+
|
|
64
72
|
super(info, options);
|
|
65
73
|
|
|
66
74
|
this.active ??= true;
|
|
@@ -76,6 +84,21 @@ export class DetailedSatellite extends Satellite {
|
|
|
76
84
|
this.initLaunchDetails_(info);
|
|
77
85
|
}
|
|
78
86
|
|
|
87
|
+
private static setSccNumTo0_(info: DetailedSatelliteParams & LaunchDetails & OperationsDetails & SpaceCraftDetails) {
|
|
88
|
+
info.tle1 = FormatTle.setCharAt(info.tle1, 2, '0') as TleLine1;
|
|
89
|
+
info.tle1 = FormatTle.setCharAt(info.tle1, 3, '0') as TleLine1;
|
|
90
|
+
info.tle1 = FormatTle.setCharAt(info.tle1, 4, '0') as TleLine1;
|
|
91
|
+
info.tle1 = FormatTle.setCharAt(info.tle1, 5, '0') as TleLine1;
|
|
92
|
+
info.tle1 = FormatTle.setCharAt(info.tle1, 6, '0') as TleLine1;
|
|
93
|
+
info.tle2 = FormatTle.setCharAt(info.tle2, 2, '0') as TleLine2;
|
|
94
|
+
info.tle2 = FormatTle.setCharAt(info.tle2, 3, '0') as TleLine2;
|
|
95
|
+
info.tle2 = FormatTle.setCharAt(info.tle2, 4, '0') as TleLine2;
|
|
96
|
+
info.tle2 = FormatTle.setCharAt(info.tle2, 5, '0') as TleLine2;
|
|
97
|
+
info.tle2 = FormatTle.setCharAt(info.tle2, 6, '0') as TleLine2;
|
|
98
|
+
|
|
99
|
+
return info;
|
|
100
|
+
}
|
|
101
|
+
|
|
79
102
|
private initSpaceCraftDetails_(
|
|
80
103
|
info: DetailedSatelliteParams &
|
|
81
104
|
LaunchDetails & OperationsDetails &
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DifferentiableFunction } from '../main';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Calculates the derivative of a differentiable function.
|
|
5
|
+
* @param f The differentiable function.
|
|
6
|
+
* @param h The step size for numerical differentiation. Default value is 1e-3.
|
|
7
|
+
* @returns The derivative function.
|
|
8
|
+
*/
|
|
9
|
+
export function derivative(f: DifferentiableFunction, h = 1e-3): DifferentiableFunction {
|
|
10
|
+
/**
|
|
11
|
+
* @param x The value at which to calculate the derivative.
|
|
12
|
+
* @returns The derivative of the function at the given value.
|
|
13
|
+
*/
|
|
14
|
+
function df(x: number): number {
|
|
15
|
+
const hh = h * 0.5;
|
|
16
|
+
|
|
17
|
+
return (f(x + hh) - f(x - hh)) / h;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return df;
|
|
21
|
+
}
|
package/src/utils/index.ts
CHANGED
package/src/utils/jacobian.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { JacobianFunction } from '../types/types';
|
|
|
11
11
|
* @param step The step size for numerical differentiation (default: 1e-5).
|
|
12
12
|
* @returns The Jacobian matrix.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export const jacobian = (f: JacobianFunction, m: number, x0: Float64Array, step = 0.00001): Matrix => {
|
|
15
15
|
const n = x0.length;
|
|
16
16
|
const j = array2d(m, n, 0);
|
|
17
17
|
const h = 0.5 * step;
|
|
@@ -35,4 +35,4 @@ export function jacobian(f: JacobianFunction, m: number, x0: Float64Array, step
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
return new Matrix(j);
|
|
38
|
-
}
|
|
38
|
+
};
|