mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(weather): add globe wind, observed weather and cyclone context (#617)
Wind (NOAA GFS and ECMWF IFS: animated particles, colour field, a reading at map centre), observed weather (NOAA MRMS radar, GOES and NESDIS infrared clouds, lightning density) on one shared history timeline, NHC and CPHC cyclone advisories with tracks and cones, and a WEATHER panel in the right rail. On 3D Tiles the observed products render as raised shells with a sharper window around the view. Co-authored-by: Gustavo Beneduzi <[email protected]> Co-authored-by: Daniel Slay <[email protected]> Co-authored-by: Rehaan Delmotra <[email protected]> Co-authored-by: Cursor Agent <[email protected]>
This commit is contained in:
180 files changed
+30645
-434
No files matched your search
@@ -3182,3 +3182,91 @@ test('ISS voice lookup uses the registered satellite instance', async () => {
|
||||
assert.deepEqual(calls, [{ latDeg: 30, lonDeg: -97, minElevDeg: 15 }]);
|
||||
assert.match(result.error, /No ISS pass above 15/);
|
||||
});
|
||||
|
||||
test('analyst_query and get_current_view_state carry stale feed provenance', async () => {
|
||||
globalThis.window = globalThis.window || { clearTimeout, setTimeout, requestIdleCallback: null };
|
||||
const now = Date.now();
|
||||
const flights = {
|
||||
id: 'flights',
|
||||
source: 'OpenSky Network',
|
||||
getStats: () => ({
|
||||
source: 'OpenSky Network',
|
||||
stale: true,
|
||||
count: 12,
|
||||
lastUpdate: now - 240_000,
|
||||
}),
|
||||
getAnalystRecords: () => ([
|
||||
{ id: 'SWA1', icao24: 'aaa001', lat: 30.27, lon: -97.74, altitudeM: 11000, onGround: false },
|
||||
]),
|
||||
};
|
||||
const viewer = {
|
||||
clock: { onTick: { addEventListener: () => () => {} } },
|
||||
scene: { canvas: { addEventListener() {}, removeEventListener() {} } },
|
||||
camera: {
|
||||
moveEnd: { addEventListener() {} },
|
||||
positionWC: Cesium.Cartesian3.fromDegrees(-97.7, 30.2, 1000),
|
||||
positionCartographic: { height: 300_000, latitude: 0.52, longitude: -1.71 },
|
||||
},
|
||||
};
|
||||
const dataManager = {
|
||||
layers: new Map([['flights', { module: flights }]]),
|
||||
isEnabled: (id) => id === 'flights',
|
||||
getAll: () => [{
|
||||
id: 'flights',
|
||||
name: 'Live Flights',
|
||||
enabled: true,
|
||||
source: 'OpenSky Network',
|
||||
stats: flights.getStats(),
|
||||
}],
|
||||
};
|
||||
const runner = createGevActionRunner({
|
||||
viewer,
|
||||
styleManager: {
|
||||
activeStyle: 'normal',
|
||||
getContextModeState: () => ({ mode: null, active: false }),
|
||||
getCockpitState: () => ({ active: false }),
|
||||
getControlState: () => null,
|
||||
},
|
||||
dataManager,
|
||||
});
|
||||
const view = await runner('get_current_view_state');
|
||||
assert.equal(view.layers[0].feedState, 'stale');
|
||||
assert.equal(view.feedProvenance.overall, 'stale');
|
||||
assert.match(view.feedProvenance.note, /STALE/);
|
||||
|
||||
const query = await runner('analyst_query', {
|
||||
layers: ['flights'],
|
||||
scope: { kind: 'view' },
|
||||
limit: 5,
|
||||
});
|
||||
assert.equal(query.ok, true);
|
||||
assert.equal(query.feedState, 'stale');
|
||||
assert.equal(query.feedProvenance.overall, 'stale');
|
||||
assert.equal(query.coverage.layersQueried[0].feedState, 'stale');
|
||||
assert.match(query.feedProvenance.note, /do not describe this as live/i);
|
||||
});
|
||||
|
||||
|
||||
test('general satellite pass resolves once, refuses ambiguity, and preserves ISS call semantics', async () => {
|
||||
const calls = [];
|
||||
const pass = { riseMs: Date.now() + 60000, setMs: Date.now() + 360000, maxElevMs: Date.now() + 180000, maxElevDeg: 30, riseAzDeg: 90, visible: false };
|
||||
const layer = {
|
||||
resolveSatelliteForPass(target) { return target === 'starlink' ? { status: 'ambiguous', candidates: [{ noradId: 1 }, { noradId: 2 }] } : { status: 'ok', noradId: 25544, name: 'ISS' }; },
|
||||
getNextSatellitePass(id, options) { calls.push({ id, ...options }); return { status: 'ok', pass }; },
|
||||
getNextIssPass(options) { calls.push(options); return { status: 'ok', pass }; },
|
||||
};
|
||||
const viewer = { clock: { onTick: { addEventListener: () => () => {} } }, scene: { canvas: { addEventListener() {}, removeEventListener() {} } }, camera: { moveEnd: { addEventListener() {} } } };
|
||||
const runner = createGevActionRunner({ viewer, styleManager: {}, dataManager: { layers: new Map([['satellites', { module: layer }]]) } });
|
||||
const ambiguous = await runner('next_satellite_pass', { target: 'starlink' });
|
||||
assert.equal(ambiguous.status, 'ambiguous');
|
||||
assert.equal(calls.length, 0);
|
||||
const args = { latitude: 30, longitude: -97, minElevationDeg: 15 };
|
||||
const general = await runner('next_satellite_pass', { target: '25544', visibleOnly: true, ...args });
|
||||
assert.equal(general.action, 'next_satellite_pass');
|
||||
assert.deepEqual(calls[0], { id: 25544, latDeg: 30, lonDeg: -97, minElevDeg: 15, requireVisible: true });
|
||||
const iss = await runner('next_iss_pass', args);
|
||||
assert.deepEqual(calls[1], { latDeg: 30, lonDeg: -97, minElevDeg: 15 });
|
||||
for (const key of ['observer', 'riseIso', 'minutesFromNow', 'durationMin', 'peakElevationDeg', 'riseDirection']) assert.deepEqual(iss[key], general[key]);
|
||||
assert.equal(iss.visible, false);
|
||||
assert.equal(iss.action, 'next_iss_pass');
|
||||
});
|
||||
Reference in new issue
Block a user