ootk 4.0.0-10 → 4.0.0-12

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 CHANGED
@@ -3,11 +3,27 @@
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-10](https://github.com/thkruz/ootk/compare/v5.0.0-0...4.0.0-10)
6
+ #### [4.0.0-12](https://github.com/thkruz/ootk/compare/v5.0.0-0...4.0.0-12)
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: move freqBand from RfSensor to DetailedSensor [`185cc50`](https://github.com/thkruz/ootk/commit/185cc506482c0e0224ff0392e6bb1bad599d54ec)
11
+ - refactor: :recycle: update transforms to allow multiple faces [`53c8877`](https://github.com/thkruz/ootk/commit/53c887730d389b06f18889d4f2170a1e4ac82993)
9
12
 
10
- #### [v5.0.0-0](https://github.com/thkruz/ootk/compare/v4.0.0-9...v5.0.0-0)
13
+ #### [v5.0.0-0](https://github.com/thkruz/ootk/compare/v4.0.0-11...v5.0.0-0)
14
+
15
+ #### [v4.0.0-11](https://github.com/thkruz/ootk/compare/v4.0.0-10...v4.0.0-11)
16
+
17
+ > 11 March 2024
18
+
19
+ - refactor: :recycle: update RfSensor to allow multiple faces [`179b486`](https://github.com/thkruz/ootk/commit/179b486bbbd9355569414f9ca7ca82aaa374ca93)
20
+ - refactor: :recycle: update transforms to allow multiple faces [`53c8877`](https://github.com/thkruz/ootk/commit/53c887730d389b06f18889d4f2170a1e4ac82993)
21
+
22
+ #### [v4.0.0-10](https://github.com/thkruz/ootk/compare/v4.0.0-9...v4.0.0-10)
23
+
24
+ > 11 March 2024
25
+
26
+ - refactor: :recycle: make rfSensor an extension of DetailedSensor [`add7613`](https://github.com/thkruz/ootk/commit/add7613c9cea3ddf56b5da0accef36b8b866b144)
11
27
 
12
28
  #### [v4.0.0-9](https://github.com/thkruz/ootk/compare/v4.0.0-8...v4.0.0-9)
13
29
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @author Theodore Kruczek.
3
- * @license MIT
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
- boresightAz: Degrees;
27
- boresightEl: Degrees;
28
- /** For radars, this is the width of the beam */
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
- /** For radar sensors, what frequency does this sensor operate in? */
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 MIT
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,11 +24,12 @@ export declare class DetailedSensor extends Sensor {
24
24
  uiName?: string;
25
25
  country?: string;
26
26
  dwellTime?: Milliseconds;
27
+ freqBand?: string;
27
28
  commLinks: CommLink[];
28
29
  /** Is this sensor volumetric? */
29
30
  isVolumetric?: boolean;
30
31
  /** The ideal zoom to see the sensor's full FOV */
31
- zoom: ZoomValue | number;
32
+ zoom?: ZoomValue | number;
32
33
  system?: string;
33
34
  operator?: string;
34
35
  url?: string;
@@ -22,6 +22,7 @@ export class DetailedSensor extends Sensor {
22
22
  uiName;
23
23
  country;
24
24
  dwellTime;
25
+ freqBand;
25
26
  commLinks;
26
27
  /** Is this sensor volumetric? */
27
28
  isVolumetric;
@@ -35,6 +36,7 @@ export class DetailedSensor extends Sensor {
35
36
  this.commLinks = info.commLinks ?? [];
36
37
  this.country = info.country;
37
38
  this.dwellTime = info.changeObjectInterval;
39
+ this.freqBand = info.freqBand;
38
40
  this.isVolumetric = info.volume;
39
41
  this.objName = info.objName;
40
42
  this.operator = info.operator;
@@ -1 +1 @@
1
- {"version":3,"file":"DetailedSensor.js","sourceRoot":"","sources":["../../src/objects/DetailedSensor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAgB,MAAM,EAAE,MAAM,WAAW,CAAC;AAIjD,MAAM,OAAO,cAAe,SAAQ,MAAM;IACxC,QAAQ,CAAU;IAClB,OAAO,CAAU;IACjB,SAAS,CAAU;IACnB,MAAM,CAAU;IAChB,OAAO,CAAU;IACjB,SAAS,CAAgB;IACzB,SAAS,CAAa;IACtB,iCAAiC;IACjC,YAAY,CAAW;IACvB,kDAAkD;IAClD,IAAI,CAAqB;IACzB,MAAM,CAAU;IAChB,QAAQ,CAAU;IAClB,GAAG,CAAU;IAEb,YAAY,IAA0B;QACpC,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC;QAC3C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,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CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @author Theodore Kruczek.
3
- * @license MIT
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,51 @@ 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;
29
- freqBand?: string;
27
+ boresightAz: Degrees[];
28
+ boresightEl: Degrees[];
29
+ faces: number;
30
30
  beamwidth: Degrees;
31
31
  constructor(info: RfSensorParams);
32
- uvFromAzEl(az: Degrees, el: Degrees): {
32
+ /**
33
+ * Converts azimuth and elevation angles to unit vector coordinates.
34
+ * @param az - The azimuth angle in degrees.
35
+ * @param el - The elevation angle in degrees.
36
+ * @param face - The face number (optional).
37
+ * @returns The unit vector coordinates.
38
+ */
39
+ uvFromAzEl(az: Degrees, el: Degrees, face?: number): {
33
40
  u: number;
34
41
  v: number;
35
42
  };
36
- azElFromUV(u: number, v: number): {
43
+ /**
44
+ * Converts the given UV coordinates to azimuth and elevation angles.
45
+ * @param u - The U coordinate.
46
+ * @param v - The V coordinate.
47
+ * @param face - The face number for multi-faced sensors. (optional)
48
+ * @returns An object containing the azimuth and elevation angles in degrees.
49
+ * @throws Error if face number is not specified for multi-faced sensors.
50
+ */
51
+ azElFromUV(u: number, v: number, face?: number): {
37
52
  az: Degrees;
38
53
  el: Degrees;
39
54
  };
40
- get boresightAzRad(): Radians;
41
- get boresightElRad(): Radians;
55
+ /**
56
+ * Converts the boresight azimuth angle to radians.
57
+ * @param face - The face number for multi-faced sensors. (Optional)
58
+ * @returns The boresight azimuth angle in radians.
59
+ * @throws An error if the face number is not specified for multi-faced sensors.
60
+ */
61
+ boresightAzRad(face?: number): Radians;
62
+ /**
63
+ * Converts the boresight elevation angle of the sensor to radians.
64
+ * @param face - The face number of the sensor (optional for single-faced sensors).
65
+ * @returns The boresight elevation angle in radians.
66
+ * @throws Error if the face number is not specified for multi-faced sensors.
67
+ */
68
+ boresightElRad(face?: number): Radians;
69
+ /**
70
+ * Gets the beamwidth in radians.
71
+ * @returns The beamwidth in radians.
72
+ */
42
73
  get beamwidthRad(): Radians;
43
74
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @author Theodore Kruczek.
3
- * @license MIT
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,7 +26,7 @@ import { DetailedSensor } from './DetailedSensor';
26
26
  export class RfSensor extends DetailedSensor {
27
27
  boresightAz;
28
28
  boresightEl;
29
- freqBand;
29
+ faces;
30
30
  beamwidth;
31
31
  constructor(info) {
32
32
  super(info);
@@ -40,29 +40,72 @@ export class RfSensor extends DetailedSensor {
40
40
  }
41
41
  this.boresightAz = info.boresightAz;
42
42
  this.boresightEl = info.boresightEl;
43
+ if (info.boresightAz.length !== info.boresightEl.length) {
44
+ throw new Error('Boresight azimuth and elevation arrays must be the same length');
45
+ }
46
+ this.faces = info.boresightAz.length;
43
47
  this.beamwidth = info.beamwidth;
44
- this.freqBand = info.freqBand;
45
48
  }
46
- uvFromAzEl(az, el) {
49
+ /**
50
+ * Converts azimuth and elevation angles to unit vector coordinates.
51
+ * @param az - The azimuth angle in degrees.
52
+ * @param el - The elevation angle in degrees.
53
+ * @param face - The face number (optional).
54
+ * @returns The unit vector coordinates.
55
+ */
56
+ uvFromAzEl(az, el, face) {
47
57
  const azRad = (az * DEG2RAD);
48
58
  const elRad = (el * DEG2RAD);
49
- const azDiff = (azRad - this.boresightAzRad);
50
- const elDiff = (elRad - this.boresightElRad);
59
+ const azDiff = (azRad - this.boresightAzRad(face ?? 0));
60
+ const elDiff = (elRad - this.boresightElRad(face ?? 0));
51
61
  return azel2uv(azDiff, elDiff, this.beamwidthRad);
52
62
  }
53
- azElFromUV(u, v) {
63
+ /**
64
+ * Converts the given UV coordinates to azimuth and elevation angles.
65
+ * @param u - The U coordinate.
66
+ * @param v - The V coordinate.
67
+ * @param face - The face number for multi-faced sensors. (optional)
68
+ * @returns An object containing the azimuth and elevation angles in degrees.
69
+ * @throws Error if face number is not specified for multi-faced sensors.
70
+ */
71
+ azElFromUV(u, v, face) {
72
+ if (!face && this.faces > 1) {
73
+ throw new Error('Face number must be specified for multi-faced sensors');
74
+ }
54
75
  const { az, el } = uv2azel(u, v, this.beamwidthRad);
55
76
  return {
56
- az: ((az + this.boresightAz) * RAD2DEG),
57
- el: ((el + this.boresightEl) * RAD2DEG),
77
+ az: ((az + this.boresightAz[face ?? 0]) * RAD2DEG),
78
+ el: ((el + this.boresightEl[face ?? 0]) * RAD2DEG),
58
79
  };
59
80
  }
60
- get boresightAzRad() {
61
- return (this.boresightAz * DEG2RAD);
81
+ /**
82
+ * Converts the boresight azimuth angle to radians.
83
+ * @param face - The face number for multi-faced sensors. (Optional)
84
+ * @returns The boresight azimuth angle in radians.
85
+ * @throws An error if the face number is not specified for multi-faced sensors.
86
+ */
87
+ boresightAzRad(face) {
88
+ if (!face && this.faces > 1) {
89
+ throw new Error('Face number must be specified for multi-faced sensors');
90
+ }
91
+ return (this.boresightAz[face ?? 0] * DEG2RAD);
62
92
  }
63
- get boresightElRad() {
64
- return (this.boresightEl * DEG2RAD);
93
+ /**
94
+ * Converts the boresight elevation angle of the sensor to radians.
95
+ * @param face - The face number of the sensor (optional for single-faced sensors).
96
+ * @returns The boresight elevation angle in radians.
97
+ * @throws Error if the face number is not specified for multi-faced sensors.
98
+ */
99
+ boresightElRad(face) {
100
+ if (!face && this.faces > 1) {
101
+ throw new Error('Face number must be specified for multi-faced sensors');
102
+ }
103
+ return (this.boresightEl[face ?? 0] * DEG2RAD);
65
104
  }
105
+ /**
106
+ * Gets the beamwidth in radians.
107
+ * @returns The beamwidth in radians.
108
+ */
66
109
  get beamwidthRad() {
67
110
  return (this.beamwidth * DEG2RAD);
68
111
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RfSensor.js","sourceRoot":"","sources":["../../src/objects/RfSensor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,OAAO,EAAW,OAAO,EAAW,eAAe,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,OAAO,QAAS,SAAQ,cAAc;IAC1C,WAAW,CAAU;IACrB,WAAW,CAAU;IACrB,QAAQ,CAAU;IAClB,SAAS,CAAU;IAEnB,YAAY,IAAoB;QAC9B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,QAAQ,IAAI,CAAC,IAAI,EAAE;YACjB,KAAK,eAAe,CAAC,wBAAwB,CAAC;YAC9C,KAAK,eAAe,CAAC,UAAU,CAAC;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AC,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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AY,CAAC;IAEhE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AACpB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,MAAM,CAA+C,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAc,EAAE,EAAK,EAAE,EAAK;IACxG,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACjG,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACjG,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,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"}
@@ -60,13 +60,14 @@ export interface DetailedSensorParams extends SensorParams {
60
60
  shortName?: string;
61
61
  changeObjectInterval?: Milliseconds;
62
62
  commLinks?: CommLink[];
63
+ freqBand?: string;
63
64
  static?: boolean;
64
65
  sensorId?: number;
65
66
  url?: string;
66
67
  /** Does this sensor use a volumetric search pattern? */
67
68
  volume?: boolean;
68
69
  /** How far away should we zoom when selecting this sensor? */
69
- zoom: ZoomValue;
70
+ zoom?: ZoomValue;
70
71
  /** This is the name of the object in the array */
71
72
  objName?: string;
72
73
  /** This is the name of the object in the UI */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ootk",
3
- "version": "4.0.0-10",
3
+ "version": "4.0.0-12",
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.",
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @author Theodore Kruczek.
3
- * @license MIT
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
- boresightAz: Degrees;
29
- boresightEl: Degrees;
30
- /** For radars, this is the width of the beam */
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
- /** For radar sensors, what frequency does this sensor operate in? */
34
+ /** The frequency this sensor operate in */
33
35
  freqBand?: string;
34
36
  }
@@ -26,11 +26,12 @@ export class DetailedSensor extends Sensor {
26
26
  uiName?: string;
27
27
  country?: string;
28
28
  dwellTime?: Milliseconds;
29
+ freqBand?: string;
29
30
  commLinks: CommLink[];
30
31
  /** Is this sensor volumetric? */
31
32
  isVolumetric?: boolean;
32
33
  /** The ideal zoom to see the sensor's full FOV */
33
- zoom: ZoomValue | number;
34
+ zoom?: ZoomValue | number;
34
35
  system?: string;
35
36
  operator?: string;
36
37
  url?: string;
@@ -40,6 +41,7 @@ export class DetailedSensor extends Sensor {
40
41
  this.commLinks = info.commLinks ?? [];
41
42
  this.country = info.country;
42
43
  this.dwellTime = info.changeObjectInterval;
44
+ this.freqBand = info.freqBand;
43
45
  this.isVolumetric = info.volume;
44
46
  this.objName = info.objName;
45
47
  this.operator = info.operator;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @author Theodore Kruczek.
3
- * @license MIT
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,9 +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;
31
- freqBand?: string;
29
+ boresightAz: Degrees[];
30
+ boresightEl: Degrees[];
31
+ faces: number;
32
32
  beamwidth: Degrees;
33
33
 
34
34
  constructor(info: RfSensorParams) {
@@ -45,36 +45,82 @@ export class RfSensor extends DetailedSensor {
45
45
 
46
46
  this.boresightAz = info.boresightAz;
47
47
  this.boresightEl = info.boresightEl;
48
+ if (info.boresightAz.length !== info.boresightEl.length) {
49
+ throw new Error('Boresight azimuth and elevation arrays must be the same length');
50
+ }
51
+ this.faces = info.boresightAz.length;
48
52
  this.beamwidth = info.beamwidth;
49
- this.freqBand = info.freqBand;
50
53
  }
51
54
 
52
- uvFromAzEl(az: Degrees, el: Degrees) {
55
+ /**
56
+ * Converts azimuth and elevation angles to unit vector coordinates.
57
+ * @param az - The azimuth angle in degrees.
58
+ * @param el - The elevation angle in degrees.
59
+ * @param face - The face number (optional).
60
+ * @returns The unit vector coordinates.
61
+ */
62
+ uvFromAzEl(az: Degrees, el: Degrees, face?: number) {
53
63
  const azRad = (az * DEG2RAD) as Radians;
54
64
  const elRad = (el * DEG2RAD) as Radians;
55
- const azDiff = (azRad - this.boresightAzRad) as Radians;
56
- const elDiff = (elRad - this.boresightElRad) as Radians;
65
+ const azDiff = (azRad - this.boresightAzRad(face ?? 0)) as Radians;
66
+ const elDiff = (elRad - this.boresightElRad(face ?? 0)) as Radians;
57
67
 
58
68
  return azel2uv(azDiff, elDiff, this.beamwidthRad);
59
69
  }
60
70
 
61
- azElFromUV(u: number, v: number) {
71
+ /**
72
+ * Converts the given UV coordinates to azimuth and elevation angles.
73
+ * @param u - The U coordinate.
74
+ * @param v - The V coordinate.
75
+ * @param face - The face number for multi-faced sensors. (optional)
76
+ * @returns An object containing the azimuth and elevation angles in degrees.
77
+ * @throws Error if face number is not specified for multi-faced sensors.
78
+ */
79
+ azElFromUV(u: number, v: number, face?: number) {
80
+ if (!face && this.faces > 1) {
81
+ throw new Error('Face number must be specified for multi-faced sensors');
82
+ }
83
+
62
84
  const { az, el } = uv2azel(u, v, this.beamwidthRad);
63
85
 
64
86
  return {
65
- az: ((az + this.boresightAz) * RAD2DEG) as Degrees,
66
- el: ((el + this.boresightEl) * RAD2DEG) as Degrees,
87
+ az: ((az + this.boresightAz[face ?? 0]) * RAD2DEG) as Degrees,
88
+ el: ((el + this.boresightEl[face ?? 0]) * RAD2DEG) as Degrees,
67
89
  };
68
90
  }
69
91
 
70
- get boresightAzRad() {
71
- return (this.boresightAz * DEG2RAD) as Radians;
92
+ /**
93
+ * Converts the boresight azimuth angle to radians.
94
+ * @param face - The face number for multi-faced sensors. (Optional)
95
+ * @returns The boresight azimuth angle in radians.
96
+ * @throws An error if the face number is not specified for multi-faced sensors.
97
+ */
98
+ boresightAzRad(face?: number) {
99
+ if (!face && this.faces > 1) {
100
+ throw new Error('Face number must be specified for multi-faced sensors');
101
+ }
102
+
103
+ return (this.boresightAz[face ?? 0] * DEG2RAD) as Radians;
72
104
  }
73
105
 
74
- get boresightElRad() {
75
- return (this.boresightEl * DEG2RAD) as Radians;
106
+ /**
107
+ * Converts the boresight elevation angle of the sensor to radians.
108
+ * @param face - The face number of the sensor (optional for single-faced sensors).
109
+ * @returns The boresight elevation angle in radians.
110
+ * @throws Error if the face number is not specified for multi-faced sensors.
111
+ */
112
+ boresightElRad(face?: number) {
113
+ if (!face && this.faces > 1) {
114
+ throw new Error('Face number must be specified for multi-faced sensors');
115
+ }
116
+
117
+ return (this.boresightEl[face ?? 0] * DEG2RAD) as Radians;
76
118
  }
77
119
 
120
+ /**
121
+ * Gets the beamwidth in radians.
122
+ * @returns The beamwidth in radians.
123
+ */
78
124
  get beamwidthRad() {
79
125
  return (this.beamwidth * DEG2RAD) as Radians;
80
126
  }
@@ -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 };
@@ -64,13 +64,14 @@ export interface DetailedSensorParams extends SensorParams {
64
64
  shortName?: string;
65
65
  changeObjectInterval?: Milliseconds;
66
66
  commLinks?: CommLink[];
67
+ freqBand?: string;
67
68
  static?: boolean;
68
69
  sensorId?: number;
69
70
  url?: string;
70
71
  /** Does this sensor use a volumetric search pattern? */
71
72
  volume?: boolean;
72
73
  /** How far away should we zoom when selecting this sensor? */
73
- zoom: ZoomValue;
74
+ zoom?: ZoomValue;
74
75
  /** This is the name of the object in the array */
75
76
  objName?: string;
76
77
  /** This is the name of the object in the UI */