ootk 4.0.0-10 → 4.0.0-11
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 +10 -2
- package/dist/interfaces/RfSensorParams.d.ts +7 -5
- package/dist/interfaces/RfSensorParams.js +1 -1
- package/dist/objects/RfSensor.d.ts +39 -7
- package/dist/objects/RfSensor.js +56 -11
- package/dist/objects/RfSensor.js.map +1 -1
- package/dist/transforms/transforms.d.ts +4 -2
- package/dist/transforms/transforms.js +7 -5
- package/dist/transforms/transforms.js.map +1 -1
- package/package.json +1 -1
- package/src/interfaces/RfSensorParams.ts +7 -5
- package/src/objects/RfSensor.ts +61 -13
- package/src/transforms/transforms.ts +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,19 @@
|
|
|
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-11](https://github.com/thkruz/ootk/compare/v5.0.0-0...4.0.0-11)
|
|
7
7
|
|
|
8
|
+
- refactor: :recycle: update RfSensor to allow multiple faces [`179b486`](https://github.com/thkruz/ootk/commit/179b486bbbd9355569414f9ca7ca82aaa374ca93)
|
|
8
9
|
- refactor: :recycle: make rfSensor an extension of DetailedSensor [`add7613`](https://github.com/thkruz/ootk/commit/add7613c9cea3ddf56b5da0accef36b8b866b144)
|
|
10
|
+
- refactor: :recycle: update transforms to allow multiple faces [`53c8877`](https://github.com/thkruz/ootk/commit/53c887730d389b06f18889d4f2170a1e4ac82993)
|
|
9
11
|
|
|
10
|
-
#### [v5.0.0-0](https://github.com/thkruz/ootk/compare/v4.0.0-
|
|
12
|
+
#### [v5.0.0-0](https://github.com/thkruz/ootk/compare/v4.0.0-10...v5.0.0-0)
|
|
13
|
+
|
|
14
|
+
#### [v4.0.0-10](https://github.com/thkruz/ootk/compare/v4.0.0-9...v4.0.0-10)
|
|
15
|
+
|
|
16
|
+
> 11 March 2024
|
|
17
|
+
|
|
18
|
+
- refactor: :recycle: make rfSensor an extension of DetailedSensor [`add7613`](https://github.com/thkruz/ootk/commit/add7613c9cea3ddf56b5da0accef36b8b866b144)
|
|
11
19
|
|
|
12
20
|
#### [v4.0.0-9](https://github.com/thkruz/ootk/compare/v4.0.0-8...v4.0.0-9)
|
|
13
21
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Theodore Kruczek.
|
|
3
|
-
* @license
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2022-2024 Theodore Kruczek Permission is
|
|
5
5
|
* hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
6
|
* software and associated documentation files (the "Software"), to deal in the
|
|
@@ -23,10 +23,12 @@
|
|
|
23
23
|
import { Degrees } from 'ootk-core';
|
|
24
24
|
import { DetailedSensorParams } from '../types/types';
|
|
25
25
|
export interface RfSensorParams extends DetailedSensorParams {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
26
|
+
/** The azimuth angles at boresight of the sensor */
|
|
27
|
+
boresightAz: Degrees[];
|
|
28
|
+
/** The elevation angles at boresight of the sensor */
|
|
29
|
+
boresightEl: Degrees[];
|
|
30
|
+
/** The width of the beam */
|
|
29
31
|
beamwidth: Degrees;
|
|
30
|
-
/**
|
|
32
|
+
/** The frequency this sensor operate in */
|
|
31
33
|
freqBand?: string;
|
|
32
34
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Theodore Kruczek.
|
|
3
|
-
* @license
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2022-2024 Theodore Kruczek Permission is
|
|
5
5
|
* hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
6
|
* software and associated documentation files (the "Software"), to deal in the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Theodore Kruczek.
|
|
3
|
-
* @license
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2022-2024 Theodore Kruczek Permission is
|
|
5
5
|
* hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
6
|
* software and associated documentation files (the "Software"), to deal in the
|
|
@@ -24,20 +24,52 @@ import { Degrees, Radians } from 'ootk-core';
|
|
|
24
24
|
import { RfSensorParams } from '../main';
|
|
25
25
|
import { DetailedSensor } from './DetailedSensor';
|
|
26
26
|
export declare class RfSensor extends DetailedSensor {
|
|
27
|
-
boresightAz: Degrees;
|
|
28
|
-
boresightEl: Degrees;
|
|
27
|
+
boresightAz: Degrees[];
|
|
28
|
+
boresightEl: Degrees[];
|
|
29
|
+
faces: number;
|
|
29
30
|
freqBand?: string;
|
|
30
31
|
beamwidth: Degrees;
|
|
31
32
|
constructor(info: RfSensorParams);
|
|
32
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Converts azimuth and elevation angles to unit vector coordinates.
|
|
35
|
+
* @param az - The azimuth angle in degrees.
|
|
36
|
+
* @param el - The elevation angle in degrees.
|
|
37
|
+
* @param face - The face number (optional).
|
|
38
|
+
* @returns The unit vector coordinates.
|
|
39
|
+
*/
|
|
40
|
+
uvFromAzEl(az: Degrees, el: Degrees, face?: number): {
|
|
33
41
|
u: number;
|
|
34
42
|
v: number;
|
|
35
43
|
};
|
|
36
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Converts the given UV coordinates to azimuth and elevation angles.
|
|
46
|
+
* @param u - The U coordinate.
|
|
47
|
+
* @param v - The V coordinate.
|
|
48
|
+
* @param face - The face number for multi-faced sensors. (optional)
|
|
49
|
+
* @returns An object containing the azimuth and elevation angles in degrees.
|
|
50
|
+
* @throws Error if face number is not specified for multi-faced sensors.
|
|
51
|
+
*/
|
|
52
|
+
azElFromUV(u: number, v: number, face?: number): {
|
|
37
53
|
az: Degrees;
|
|
38
54
|
el: Degrees;
|
|
39
55
|
};
|
|
40
|
-
|
|
41
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Converts the boresight azimuth angle to radians.
|
|
58
|
+
* @param face - The face number for multi-faced sensors. (Optional)
|
|
59
|
+
* @returns The boresight azimuth angle in radians.
|
|
60
|
+
* @throws An error if the face number is not specified for multi-faced sensors.
|
|
61
|
+
*/
|
|
62
|
+
boresightAzRad(face?: number): Radians;
|
|
63
|
+
/**
|
|
64
|
+
* Converts the boresight elevation angle of the sensor to radians.
|
|
65
|
+
* @param face - The face number of the sensor (optional for single-faced sensors).
|
|
66
|
+
* @returns The boresight elevation angle in radians.
|
|
67
|
+
* @throws Error if the face number is not specified for multi-faced sensors.
|
|
68
|
+
*/
|
|
69
|
+
boresightElRad(face?: number): Radians;
|
|
70
|
+
/**
|
|
71
|
+
* Gets the beamwidth in radians.
|
|
72
|
+
* @returns The beamwidth in radians.
|
|
73
|
+
*/
|
|
42
74
|
get beamwidthRad(): Radians;
|
|
43
75
|
}
|
package/dist/objects/RfSensor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Theodore Kruczek.
|
|
3
|
-
* @license
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2022-2024 Theodore Kruczek Permission is
|
|
5
5
|
* hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
6
|
* software and associated documentation files (the "Software"), to deal in the
|
|
@@ -26,6 +26,7 @@ import { DetailedSensor } from './DetailedSensor';
|
|
|
26
26
|
export class RfSensor extends DetailedSensor {
|
|
27
27
|
boresightAz;
|
|
28
28
|
boresightEl;
|
|
29
|
+
faces;
|
|
29
30
|
freqBand;
|
|
30
31
|
beamwidth;
|
|
31
32
|
constructor(info) {
|
|
@@ -40,29 +41,73 @@ export class RfSensor extends DetailedSensor {
|
|
|
40
41
|
}
|
|
41
42
|
this.boresightAz = info.boresightAz;
|
|
42
43
|
this.boresightEl = info.boresightEl;
|
|
44
|
+
if (info.boresightAz.length !== info.boresightEl.length) {
|
|
45
|
+
throw new Error('Boresight azimuth and elevation arrays must be the same length');
|
|
46
|
+
}
|
|
47
|
+
this.faces = info.boresightAz.length;
|
|
43
48
|
this.beamwidth = info.beamwidth;
|
|
44
49
|
this.freqBand = info.freqBand;
|
|
45
50
|
}
|
|
46
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Converts azimuth and elevation angles to unit vector coordinates.
|
|
53
|
+
* @param az - The azimuth angle in degrees.
|
|
54
|
+
* @param el - The elevation angle in degrees.
|
|
55
|
+
* @param face - The face number (optional).
|
|
56
|
+
* @returns The unit vector coordinates.
|
|
57
|
+
*/
|
|
58
|
+
uvFromAzEl(az, el, face) {
|
|
47
59
|
const azRad = (az * DEG2RAD);
|
|
48
60
|
const elRad = (el * DEG2RAD);
|
|
49
|
-
const azDiff = (azRad - this.boresightAzRad);
|
|
50
|
-
const elDiff = (elRad - this.boresightElRad);
|
|
61
|
+
const azDiff = (azRad - this.boresightAzRad(face ?? 0));
|
|
62
|
+
const elDiff = (elRad - this.boresightElRad(face ?? 0));
|
|
51
63
|
return azel2uv(azDiff, elDiff, this.beamwidthRad);
|
|
52
64
|
}
|
|
53
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Converts the given UV coordinates to azimuth and elevation angles.
|
|
67
|
+
* @param u - The U coordinate.
|
|
68
|
+
* @param v - The V coordinate.
|
|
69
|
+
* @param face - The face number for multi-faced sensors. (optional)
|
|
70
|
+
* @returns An object containing the azimuth and elevation angles in degrees.
|
|
71
|
+
* @throws Error if face number is not specified for multi-faced sensors.
|
|
72
|
+
*/
|
|
73
|
+
azElFromUV(u, v, face) {
|
|
74
|
+
if (!face && this.faces > 1) {
|
|
75
|
+
throw new Error('Face number must be specified for multi-faced sensors');
|
|
76
|
+
}
|
|
54
77
|
const { az, el } = uv2azel(u, v, this.beamwidthRad);
|
|
55
78
|
return {
|
|
56
|
-
az: ((az + this.boresightAz) * RAD2DEG),
|
|
57
|
-
el: ((el + this.boresightEl) * RAD2DEG),
|
|
79
|
+
az: ((az + this.boresightAz[face ?? 0]) * RAD2DEG),
|
|
80
|
+
el: ((el + this.boresightEl[face ?? 0]) * RAD2DEG),
|
|
58
81
|
};
|
|
59
82
|
}
|
|
60
|
-
|
|
61
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Converts the boresight azimuth angle to radians.
|
|
85
|
+
* @param face - The face number for multi-faced sensors. (Optional)
|
|
86
|
+
* @returns The boresight azimuth angle in radians.
|
|
87
|
+
* @throws An error if the face number is not specified for multi-faced sensors.
|
|
88
|
+
*/
|
|
89
|
+
boresightAzRad(face) {
|
|
90
|
+
if (!face && this.faces > 1) {
|
|
91
|
+
throw new Error('Face number must be specified for multi-faced sensors');
|
|
92
|
+
}
|
|
93
|
+
return (this.boresightAz[face ?? 0] * DEG2RAD);
|
|
62
94
|
}
|
|
63
|
-
|
|
64
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Converts the boresight elevation angle of the sensor to radians.
|
|
97
|
+
* @param face - The face number of the sensor (optional for single-faced sensors).
|
|
98
|
+
* @returns The boresight elevation angle in radians.
|
|
99
|
+
* @throws Error if the face number is not specified for multi-faced sensors.
|
|
100
|
+
*/
|
|
101
|
+
boresightElRad(face) {
|
|
102
|
+
if (!face && this.faces > 1) {
|
|
103
|
+
throw new Error('Face number must be specified for multi-faced sensors');
|
|
104
|
+
}
|
|
105
|
+
return (this.boresightEl[face ?? 0] * DEG2RAD);
|
|
65
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Gets the beamwidth in radians.
|
|
109
|
+
* @returns The beamwidth in radians.
|
|
110
|
+
*/
|
|
66
111
|
get beamwidthRad() {
|
|
67
112
|
return (this.beamwidth * DEG2RAD);
|
|
68
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RfSensor.js","sourceRoot":"","sources":["../../src/objects/RfSensor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH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C,IAAa;QAC1B,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;SAC1E;QAED,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,OAAO,CAAY,CAAC;IAC5D,CAAC;IAED;;;;;OAKG;IACH,cAAc,CAAC,IAAa;QAC1B,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;SAC1E;QAED,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,OAAO,CAAY,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACH,IAAI,YAAY;QACd,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAY,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -18,10 +18,11 @@ export declare function azel2uv(az: Radians, el: Radians, coneHalfAngle: Radians
|
|
|
18
18
|
* Determine azimuth and elevation off of boresight based on sensor orientation and RAE.
|
|
19
19
|
* @param rae Range, Azimuth, Elevation
|
|
20
20
|
* @param sensor Radar sensor object
|
|
21
|
+
* @param face Face number of the sensor
|
|
21
22
|
* @param maxSensorAz Maximum sensor azimuth
|
|
22
23
|
* @returns Azimuth and Elevation off of boresight
|
|
23
24
|
*/
|
|
24
|
-
export declare function rae2raeOffBoresight(rae: RaeVec3, sensor: RfSensor, maxSensorAz: Degrees): {
|
|
25
|
+
export declare function rae2raeOffBoresight(rae: RaeVec3, sensor: RfSensor, face: number, maxSensorAz: Degrees): {
|
|
25
26
|
az: Radians;
|
|
26
27
|
el: Radians;
|
|
27
28
|
};
|
|
@@ -29,10 +30,11 @@ export declare function rae2raeOffBoresight(rae: RaeVec3, sensor: RfSensor, maxS
|
|
|
29
30
|
* Converts Range Az El to Range U V.
|
|
30
31
|
* @param rae Range, Azimuth, Elevation
|
|
31
32
|
* @param sensor Radar sensor object
|
|
33
|
+
* @param face Face number of the sensor
|
|
32
34
|
* @param maxSensorAz Maximum sensor azimuth
|
|
33
35
|
* @returns Range, U, V
|
|
34
36
|
*/
|
|
35
|
-
export declare function rae2ruv(rae: RaeVec3, sensor: RfSensor, maxSensorAz: Degrees): RuvVec3;
|
|
37
|
+
export declare function rae2ruv(rae: RaeVec3, sensor: RfSensor, face: number, maxSensorAz: Degrees): RuvVec3;
|
|
36
38
|
/**
|
|
37
39
|
* Converts U and V to Azimuth and Elevation off of boresight.
|
|
38
40
|
* @param u The U coordinate.
|
|
@@ -27,27 +27,29 @@ export function azel2uv(az, el, coneHalfAngle) {
|
|
|
27
27
|
* Determine azimuth and elevation off of boresight based on sensor orientation and RAE.
|
|
28
28
|
* @param rae Range, Azimuth, Elevation
|
|
29
29
|
* @param sensor Radar sensor object
|
|
30
|
+
* @param face Face number of the sensor
|
|
30
31
|
* @param maxSensorAz Maximum sensor azimuth
|
|
31
32
|
* @returns Azimuth and Elevation off of boresight
|
|
32
33
|
*/
|
|
33
|
-
export function rae2raeOffBoresight(rae, sensor, maxSensorAz) {
|
|
34
|
+
export function rae2raeOffBoresight(rae, sensor, face, maxSensorAz) {
|
|
34
35
|
let az = (rae.az * DEG2RAD);
|
|
35
36
|
let el = (rae.el * DEG2RAD);
|
|
36
37
|
// Correct azimuth for sensor orientation.
|
|
37
38
|
az = az > maxSensorAz * DEG2RAD ? (az - TAU) : az;
|
|
38
|
-
az = (az - sensor.boresightAz);
|
|
39
|
-
el = (el - sensor.boresightEl);
|
|
39
|
+
az = (az - sensor.boresightAz[face]);
|
|
40
|
+
el = (el - sensor.boresightEl[face]);
|
|
40
41
|
return { az, el };
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
44
|
* Converts Range Az El to Range U V.
|
|
44
45
|
* @param rae Range, Azimuth, Elevation
|
|
45
46
|
* @param sensor Radar sensor object
|
|
47
|
+
* @param face Face number of the sensor
|
|
46
48
|
* @param maxSensorAz Maximum sensor azimuth
|
|
47
49
|
* @returns Range, U, V
|
|
48
50
|
*/
|
|
49
|
-
export function rae2ruv(rae, sensor, maxSensorAz) {
|
|
50
|
-
const { az, el } = rae2raeOffBoresight(rae, sensor, maxSensorAz);
|
|
51
|
+
export function rae2ruv(rae, sensor, face, maxSensorAz) {
|
|
52
|
+
const { az, el } = rae2raeOffBoresight(rae, sensor, face, maxSensorAz);
|
|
51
53
|
const { u, v } = azel2uv(az, el, sensor.beamwidthRad);
|
|
52
54
|
return { rng: rae.rng, u, v };
|
|
53
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transforms.js","sourceRoot":"","sources":["../../src/transforms/transforms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAoB,OAAO,EAAoB,GAAG,EAAE,MAAM,WAAW,CAAC;AAGtF;;;;;;;;;GASG;AACH,MAAM,UAAU,OAAO,CAAC,EAAW,EAAE,EAAW,EAAE,aAAsB;IACtE,IAAI,EAAE,GAAG,aAAa,IAAI,EAAE,GAAG,aAAa,EAAE;QAC5C,MAAM,IAAI,UAAU,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;KACzD;IAED,IAAI,EAAE,GAAG,aAAa,IAAI,EAAE,GAAG,aAAa,EAAE;QAC5C,MAAM,IAAI,UAAU,CAAC,+BAA+B,EAAE,EAAE,CAAC,CAAC;KAC3D;IAED,MAAM,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,aAAa,GAAG,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC;IACpD,MAAM,IAAI,GAAG,CAAC,EAAE,GAAG,CAAC,aAAa,GAAG,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC;IAEnD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAY,CAAC;IACrC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAY,CAA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C,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEjD,OAAO;QACL,CAAC,EAAE,GAAQ;QACX,CAAC,EAAE,GAAQ;QACX,CAAC,EAAE,GAAQ;KACZ,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Theodore Kruczek.
|
|
3
|
-
* @license
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2022-2024 Theodore Kruczek Permission is
|
|
5
5
|
* hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
6
|
* software and associated documentation files (the "Software"), to deal in the
|
|
@@ -25,10 +25,12 @@ import { Degrees } from 'ootk-core';
|
|
|
25
25
|
import { DetailedSensorParams } from '../types/types';
|
|
26
26
|
|
|
27
27
|
export interface RfSensorParams extends DetailedSensorParams {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
/**
|
|
28
|
+
/** The azimuth angles at boresight of the sensor */
|
|
29
|
+
boresightAz: Degrees[];
|
|
30
|
+
/** The elevation angles at boresight of the sensor */
|
|
31
|
+
boresightEl: Degrees[];
|
|
32
|
+
/** The width of the beam */
|
|
31
33
|
beamwidth: Degrees;
|
|
32
|
-
/**
|
|
34
|
+
/** The frequency this sensor operate in */
|
|
33
35
|
freqBand?: string;
|
|
34
36
|
}
|
package/src/objects/RfSensor.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @author Theodore Kruczek.
|
|
3
|
-
* @license
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
4
|
* @copyright (c) 2022-2024 Theodore Kruczek Permission is
|
|
5
5
|
* hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
6
|
* software and associated documentation files (the "Software"), to deal in the
|
|
@@ -26,8 +26,9 @@ import { azel2uv, uv2azel, RfSensorParams } from '../main';
|
|
|
26
26
|
import { DetailedSensor } from './DetailedSensor';
|
|
27
27
|
|
|
28
28
|
export class RfSensor extends DetailedSensor {
|
|
29
|
-
boresightAz: Degrees;
|
|
30
|
-
boresightEl: Degrees;
|
|
29
|
+
boresightAz: Degrees[];
|
|
30
|
+
boresightEl: Degrees[];
|
|
31
|
+
faces: number;
|
|
31
32
|
freqBand?: string;
|
|
32
33
|
beamwidth: Degrees;
|
|
33
34
|
|
|
@@ -45,36 +46,83 @@ export class RfSensor extends DetailedSensor {
|
|
|
45
46
|
|
|
46
47
|
this.boresightAz = info.boresightAz;
|
|
47
48
|
this.boresightEl = info.boresightEl;
|
|
49
|
+
if (info.boresightAz.length !== info.boresightEl.length) {
|
|
50
|
+
throw new Error('Boresight azimuth and elevation arrays must be the same length');
|
|
51
|
+
}
|
|
52
|
+
this.faces = info.boresightAz.length;
|
|
48
53
|
this.beamwidth = info.beamwidth;
|
|
49
54
|
this.freqBand = info.freqBand;
|
|
50
55
|
}
|
|
51
56
|
|
|
52
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Converts azimuth and elevation angles to unit vector coordinates.
|
|
59
|
+
* @param az - The azimuth angle in degrees.
|
|
60
|
+
* @param el - The elevation angle in degrees.
|
|
61
|
+
* @param face - The face number (optional).
|
|
62
|
+
* @returns The unit vector coordinates.
|
|
63
|
+
*/
|
|
64
|
+
uvFromAzEl(az: Degrees, el: Degrees, face?: number) {
|
|
53
65
|
const azRad = (az * DEG2RAD) as Radians;
|
|
54
66
|
const elRad = (el * DEG2RAD) as Radians;
|
|
55
|
-
const azDiff = (azRad - this.boresightAzRad) as Radians;
|
|
56
|
-
const elDiff = (elRad - this.boresightElRad) as Radians;
|
|
67
|
+
const azDiff = (azRad - this.boresightAzRad(face ?? 0)) as Radians;
|
|
68
|
+
const elDiff = (elRad - this.boresightElRad(face ?? 0)) as Radians;
|
|
57
69
|
|
|
58
70
|
return azel2uv(azDiff, elDiff, this.beamwidthRad);
|
|
59
71
|
}
|
|
60
72
|
|
|
61
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Converts the given UV coordinates to azimuth and elevation angles.
|
|
75
|
+
* @param u - The U coordinate.
|
|
76
|
+
* @param v - The V coordinate.
|
|
77
|
+
* @param face - The face number for multi-faced sensors. (optional)
|
|
78
|
+
* @returns An object containing the azimuth and elevation angles in degrees.
|
|
79
|
+
* @throws Error if face number is not specified for multi-faced sensors.
|
|
80
|
+
*/
|
|
81
|
+
azElFromUV(u: number, v: number, face?: number) {
|
|
82
|
+
if (!face && this.faces > 1) {
|
|
83
|
+
throw new Error('Face number must be specified for multi-faced sensors');
|
|
84
|
+
}
|
|
85
|
+
|
|
62
86
|
const { az, el } = uv2azel(u, v, this.beamwidthRad);
|
|
63
87
|
|
|
64
88
|
return {
|
|
65
|
-
az: ((az + this.boresightAz) * RAD2DEG) as Degrees,
|
|
66
|
-
el: ((el + this.boresightEl) * RAD2DEG) as Degrees,
|
|
89
|
+
az: ((az + this.boresightAz[face ?? 0]) * RAD2DEG) as Degrees,
|
|
90
|
+
el: ((el + this.boresightEl[face ?? 0]) * RAD2DEG) as Degrees,
|
|
67
91
|
};
|
|
68
92
|
}
|
|
69
93
|
|
|
70
|
-
|
|
71
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Converts the boresight azimuth angle to radians.
|
|
96
|
+
* @param face - The face number for multi-faced sensors. (Optional)
|
|
97
|
+
* @returns The boresight azimuth angle in radians.
|
|
98
|
+
* @throws An error if the face number is not specified for multi-faced sensors.
|
|
99
|
+
*/
|
|
100
|
+
boresightAzRad(face?: number) {
|
|
101
|
+
if (!face && this.faces > 1) {
|
|
102
|
+
throw new Error('Face number must be specified for multi-faced sensors');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return (this.boresightAz[face ?? 0] * DEG2RAD) as Radians;
|
|
72
106
|
}
|
|
73
107
|
|
|
74
|
-
|
|
75
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Converts the boresight elevation angle of the sensor to radians.
|
|
110
|
+
* @param face - The face number of the sensor (optional for single-faced sensors).
|
|
111
|
+
* @returns The boresight elevation angle in radians.
|
|
112
|
+
* @throws Error if the face number is not specified for multi-faced sensors.
|
|
113
|
+
*/
|
|
114
|
+
boresightElRad(face?: number) {
|
|
115
|
+
if (!face && this.faces > 1) {
|
|
116
|
+
throw new Error('Face number must be specified for multi-faced sensors');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return (this.boresightEl[face ?? 0] * DEG2RAD) as Radians;
|
|
76
120
|
}
|
|
77
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Gets the beamwidth in radians.
|
|
124
|
+
* @returns The beamwidth in radians.
|
|
125
|
+
*/
|
|
78
126
|
get beamwidthRad() {
|
|
79
127
|
return (this.beamwidth * DEG2RAD) as Radians;
|
|
80
128
|
}
|
|
@@ -35,12 +35,14 @@ export function azel2uv(az: Radians, el: Radians, coneHalfAngle: Radians): { u:
|
|
|
35
35
|
* Determine azimuth and elevation off of boresight based on sensor orientation and RAE.
|
|
36
36
|
* @param rae Range, Azimuth, Elevation
|
|
37
37
|
* @param sensor Radar sensor object
|
|
38
|
+
* @param face Face number of the sensor
|
|
38
39
|
* @param maxSensorAz Maximum sensor azimuth
|
|
39
40
|
* @returns Azimuth and Elevation off of boresight
|
|
40
41
|
*/
|
|
41
42
|
export function rae2raeOffBoresight(
|
|
42
43
|
rae: RaeVec3,
|
|
43
44
|
sensor: RfSensor,
|
|
45
|
+
face: number,
|
|
44
46
|
maxSensorAz: Degrees,
|
|
45
47
|
): { az: Radians; el: Radians } {
|
|
46
48
|
let az = (rae.az * DEG2RAD) as Radians;
|
|
@@ -49,8 +51,8 @@ export function rae2raeOffBoresight(
|
|
|
49
51
|
// Correct azimuth for sensor orientation.
|
|
50
52
|
az = az > maxSensorAz * DEG2RAD ? ((az - TAU) as Radians) : az;
|
|
51
53
|
|
|
52
|
-
az = (az - sensor.boresightAz) as Radians;
|
|
53
|
-
el = (el - sensor.boresightEl) as Radians;
|
|
54
|
+
az = (az - sensor.boresightAz[face]) as Radians;
|
|
55
|
+
el = (el - sensor.boresightEl[face]) as Radians;
|
|
54
56
|
|
|
55
57
|
return { az, el };
|
|
56
58
|
}
|
|
@@ -59,11 +61,12 @@ export function rae2raeOffBoresight(
|
|
|
59
61
|
* Converts Range Az El to Range U V.
|
|
60
62
|
* @param rae Range, Azimuth, Elevation
|
|
61
63
|
* @param sensor Radar sensor object
|
|
64
|
+
* @param face Face number of the sensor
|
|
62
65
|
* @param maxSensorAz Maximum sensor azimuth
|
|
63
66
|
* @returns Range, U, V
|
|
64
67
|
*/
|
|
65
|
-
export function rae2ruv(rae: RaeVec3, sensor: RfSensor, maxSensorAz: Degrees): RuvVec3 {
|
|
66
|
-
const { az, el } = rae2raeOffBoresight(rae, sensor, maxSensorAz);
|
|
68
|
+
export function rae2ruv(rae: RaeVec3, sensor: RfSensor, face: number, maxSensorAz: Degrees): RuvVec3 {
|
|
69
|
+
const { az, el } = rae2raeOffBoresight(rae, sensor, face, maxSensorAz);
|
|
67
70
|
const { u, v } = azel2uv(az, el, sensor.beamwidthRad);
|
|
68
71
|
|
|
69
72
|
return { rng: rae.rng, u, v };
|