Skip to content

Commit 50b8ceb

Browse files
MiguelPuntoEsclaude
andcommitted
feat: azimuth series on VisibilityResult
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 91423ab commit 50b8ceb

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 1.8.0
4+
5+
### New features
6+
7+
- `VisibilityResult` gains per-PRN **`azimuth`** series (radians, same shape as `elevation`) — enables sky plots of a planned window.
8+
39
## 1.7.0
410

511
### New features

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gnss-js",
3-
"version": "1.7.0",
3+
"version": "1.8.0",
44
"description": "Comprehensive GNSS library for JavaScript — time scales, coordinates, RINEX parsing, RTCM3 decoding, orbit computation, and signal analysis",
55
"type": "module",
66
"sideEffects": false,

src/orbit/index.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,8 @@ export interface VisibilityResult {
914914
times: number[];
915915
/** Elevation (radians) per PRN per epoch; null when no valid ephemeris. */
916916
elevation: Record<string, (number | null)[]>;
917+
/** Azimuth (radians) per PRN per epoch; null when no valid ephemeris. */
918+
azimuth: Record<string, (number | null)[]>;
917919
/** Number of satellites at or above the mask, per epoch. */
918920
visibleCount: number[];
919921
/** PDOP per epoch (null when < 4 satellites above the mask). */
@@ -955,6 +957,7 @@ export function computeVisibility(
955957
const all = computeAllPositions(ephemerides, times, rxPos);
956958

957959
const elevation: Record<string, (number | null)[]> = {};
960+
const azimuth: Record<string, (number | null)[]> = {};
958961
const visibleCount = new Array<number>(times.length).fill(0);
959962
const pdop = new Array<number | null>(times.length).fill(null);
960963
const gdop = new Array<number | null>(times.length).fill(null);
@@ -967,6 +970,7 @@ export function computeVisibility(
967970
for (const prn of all.prns) {
968971
const series = all.positions[prn]!;
969972
elevation[prn] = series.map((p) => (p ? p.el : null));
973+
azimuth[prn] = series.map((p) => (p ? p.az : null));
970974
for (let i = 0; i < series.length; i++) {
971975
const p = series[i];
972976
if (p && p.el >= maskRad) {
@@ -1018,5 +1022,15 @@ export function computeVisibility(
10181022
}
10191023
passes.sort((a, b) => a.rise - b.rise);
10201024

1021-
return { times, elevation, visibleCount, pdop, gdop, hdop, vdop, passes };
1025+
return {
1026+
times,
1027+
elevation,
1028+
azimuth,
1029+
visibleCount,
1030+
pdop,
1031+
gdop,
1032+
hdop,
1033+
vdop,
1034+
passes,
1035+
};
10221036
}

0 commit comments

Comments
 (0)