mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-12 06:12:18 +00:00
Read a satellite's launch year from one TLE parser
The catalog stored the designator on satrec.intldesg for internationalDesignatorYear, while the active-TLE lookup parsed the same columns with tleLineLaunchYear. Each catalog entry now keeps launchYear from tleLineLaunchYear, which moves to src/sources/tle.js beside the other TLE field readers, and internationalDesignatorYear goes. A blank designator now reads as an unknown year in both lookups; the active-TLE lookup read it as 2000.
This commit is contained in:
1 parent
bfeec17c81
commit
4779432e48
5 files changed
+46
-23
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import * as Cesium from 'cesium';
|
||||
import { twoline2satrec } from 'satellite.js';
|
||||
import { noradIdFromSatnum } from '../../sources/tle.js';
|
||||
import { noradIdFromSatnum, tleLineLaunchYear } from '../../sources/tle.js';
|
||||
import {
|
||||
DENSE_REFRESH_FRAMES,
|
||||
DENSE_GROUP_PATH,
|
||||
@@ -114,8 +114,6 @@ export function createCatalog({ state: layerState, services, parts, source }) {
|
||||
const entry = entries[i];
|
||||
const satrec = twoline2satrec(entry.line1, entry.line2);
|
||||
if (!satrec || satrec.error !== 0) continue;
|
||||
// satellite.js omits the designator the launch-year match reads.
|
||||
satrec.intldesg = entry.line1.slice(9, 17).trim();
|
||||
const noradId = noradIdFromSatnum(satrec.satnum);
|
||||
if (layerState._catalog.has(noradId)) continue; // core catalog keeps priority
|
||||
const pos = parts.orbits.propagatePosition(satrec, now);
|
||||
@@ -125,6 +123,7 @@ export function createCatalog({ state: layerState, services, parts, source }) {
|
||||
name: entry.name,
|
||||
satrec,
|
||||
group: 'dense',
|
||||
launchYear: tleLineLaunchYear(entry.line1),
|
||||
});
|
||||
const point = layerState._pointCollection.add({
|
||||
position: Cesium.Cartesian3.fromDegrees(
|
||||
|
||||
Reference in new issue
Block a user