feat(satellites): flag naked-eye visible passes

- Add Sun position and Earth-shadow checks
- Add visible to pass results
- next_iss_pass prefers a visible pass, falls back with visible: false
This commit is contained in:
Rehaan Delmotra committed 2026-09-14 22:50:15 +05:30
1 parent 096f533efe
commit ac4a17bebe
7 files changed
+314 -16

No files matched your search

+7 -1
View File
@@ -2017,7 +2017,12 @@ function nextIssPass(viewer, args) {
lonDeg = Cesium.Math.toDegrees(carto.longitude);
}
const minElevDeg = Number.isFinite(args.minElevationDeg) ? args.minElevationDeg : 10;
const result = getNextIssPass({ latDeg, lonDeg, minElevDeg });
// Prefer a naked-eye-visible pass (the tool contract); otherwise report the
// next pass with visible: false.
let result = getNextIssPass({ latDeg, lonDeg, minElevDeg, requireVisible: true });
if (result.status === 'none') {
result = getNextIssPass({ latDeg, lonDeg, minElevDeg });
}
if (result.status === 'no-tle') {
return {
ok: false,
@@ -2042,6 +2047,7 @@ function nextIssPass(viewer, args) {
durationMin: Math.max(1, Math.round((pass.setMs - pass.riseMs) / 60000)),
peakElevationDeg: Math.round(pass.maxElevDeg),
riseDirection: compassDir(pass.riseAzDeg),
visible: Boolean(pass.visible),
};
}