mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
Merge pull request #1354 from rudycelekli/fix/firms-frp-ten-megawatts
Reviewed display correction with its runtime documentation update.
This commit is contained in:
6 files changed
+44
-4
No files matched your search
@@ -0,0 +1,3 @@
|
|||||||
|
- Drop the decimal when fire radiative power rounds to 10 MW. A 9.96 MW
|
||||||
|
detection was labeled 10.0 MW because the one-decimal cutoff ran before
|
||||||
|
rounding (Rudy Celekli, @rudycelekli, #1354).
|
||||||
@@ -4643,7 +4643,7 @@ silently demoting every later lookup for the session.
|
|||||||
multi-sensor datasheets publish a capability range, not the lens's current zoom, so those
|
multi-sensor datasheets publish a capability range, not the lens's current zoom, so those
|
||||||
cameras keep their estimate and show `SPEC FOV min–max° (CAPABILITY)` beside it. Public
|
cameras keep their estimate and show `SPEC FOV min–max° (CAPABILITY)` beside it. Public
|
||||||
camera state carries `fovSource`, `specFovMinDeg`, `specFovMaxDeg` and `spec` (#452).
|
camera state carries `fovSource`, `specFovMinDeg`, `specFovMaxDeg` and `spec` (#452).
|
||||||
- **FIRMS**: no ground clamping (zero 3D-tiles height sampling), ≤18 screen-decluttered ambient labels, click-to-inspect detail card, 2.5k/3k sprite budgets viewport-clipped by FRP.
|
- **FIRMS**: no ground clamping (zero 3D-tiles height sampling), ≤18 screen-decluttered ambient labels, click-to-inspect detail card, 2.5k/3k sprite budgets viewport-clipped by FRP. Fire-power labels share display rounding before localization: one decimal below the rounded 10 MW boundary, then whole megawatts (for example, 9.96 MW reads 10 MW).
|
||||||
- **CCTV v2 foundation:** a pitched
|
- **CCTV v2 foundation:** a pitched
|
||||||
frustum wireframe (4 corner rays + far-cap rectangle) with a monitor plane at the frustum's
|
frustum wireframe (4 corner rays + far-cap rectangle) with a monitor plane at the frustum's
|
||||||
far cap, retargeting the existing video/canvas texture pipeline. Stills are drawn at their source aspect, centered on the placeholder dark (`#01070c`), instead of being stretched to the 16:9 canvas. Manual calibration only —
|
far cap, retargeting the existing video/canvas texture pipeline. Stills are drawn at their source aspect, centered on the placeholder dark (`#01070c`), instead of being stretched to the 16:9 canvas. Manual calibration only —
|
||||||
|
|||||||
@@ -53,6 +53,21 @@ test('buildFireCard: missing acquisition time omits the age segment', () => {
|
|||||||
assert.equal(card.details[0], 'high · N20');
|
assert.equal(card.details[0], 'high · N20');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('buildFireCard: power that rounds to 10 MW drops the decimal', () => {
|
||||||
|
const crossed = buildFireCard(
|
||||||
|
{ fire: fire({ frp: 9.96 }), position: {} },
|
||||||
|
NOW,
|
||||||
|
);
|
||||||
|
assert.equal(crossed.title, '▲ 10 MW');
|
||||||
|
const below = buildFireCard(
|
||||||
|
{ fire: fire({ frp: 9.94 }), position: {} },
|
||||||
|
NOW,
|
||||||
|
);
|
||||||
|
assert.equal(below.title, '▲ 9.9 MW');
|
||||||
|
const selected = buildSelectedFireCard(fire({ frp: 9.96 }), NOW);
|
||||||
|
assert.equal(selected.title, 'FIRE · 10 MW');
|
||||||
|
});
|
||||||
|
|
||||||
test('buildFireCard: SNPP satellite code renders as SNPP, weak fire is not red', () => {
|
test('buildFireCard: SNPP satellite code renders as SNPP, weak fire is not red', () => {
|
||||||
const card = buildFireCard({ fire: fire({ satellite: 'N', frp: 0.8, confidence: 0.3 }), position: {} }, NOW);
|
const card = buildFireCard({ fire: fire({ satellite: 'N', frp: 0.8, confidence: 0.3 }), position: {} }, NOW);
|
||||||
assert.match(card.details[0], /SNPP$/);
|
assert.match(card.details[0], /SNPP$/);
|
||||||
|
|||||||
@@ -39,6 +39,17 @@ export function accentForSeverity(stopName) {
|
|||||||
return ACCENT_RGB[stopName] || ACCENT_RGB.yellow;
|
return ACCENT_RGB[stopName] || ACCENT_RGB.yellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fire radiative power as shown on a card: "9.9" below 10 MW, "10" once
|
||||||
|
* one-decimal rounding reaches 10. "10.0" would sit beside a whole "10".
|
||||||
|
* @param {number} frp Megawatts.
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
export function formatFrpMw(frp) {
|
||||||
|
const digits = Number(Number(frp).toFixed(1)) >= 10 ? 0 : 1;
|
||||||
|
return Number(frp).toFixed(digits);
|
||||||
|
}
|
||||||
|
|
||||||
/** Raw FIRMS satellite code → short display name (N = Suomi NPP). */
|
/** Raw FIRMS satellite code → short display name (N = Suomi NPP). */
|
||||||
export function satelliteShortName(satellite) {
|
export function satelliteShortName(satellite) {
|
||||||
const s = String(satellite || '')
|
const s = String(satellite || '')
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
FIRMS_AMBIENT_COHORT_LIMIT,
|
FIRMS_AMBIENT_COHORT_LIMIT,
|
||||||
FIRMS_OVERLAY_SOURCE_ID,
|
FIRMS_OVERLAY_SOURCE_ID,
|
||||||
satelliteShortName,
|
satelliteShortName,
|
||||||
|
formatFrpMw,
|
||||||
} from './firmsLabels.js';
|
} from './firmsLabels.js';
|
||||||
|
|
||||||
test('FIRMS formatting helpers retain the shipped severity palette', () => {
|
test('FIRMS formatting helpers retain the shipped severity palette', () => {
|
||||||
@@ -15,6 +16,14 @@ test('FIRMS formatting helpers retain the shipped severity palette', () => {
|
|||||||
assert.equal(accentForSeverity('chartreuse'), accentForSeverity('yellow'));
|
assert.equal(accentForSeverity('chartreuse'), accentForSeverity('yellow'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('FIRMS power that rounds to 10 MW drops the decimal', () => {
|
||||||
|
assert.equal(formatFrpMw(9.96), '10');
|
||||||
|
assert.equal(formatFrpMw(9.94), '9.9');
|
||||||
|
assert.equal(formatFrpMw(0.8), '0.8');
|
||||||
|
assert.equal(formatFrpMw(1520.27), '1520');
|
||||||
|
assert.equal(formatFrpMw(210.4), '210');
|
||||||
|
});
|
||||||
|
|
||||||
test('FIRMS satellite names retain the three VIIRS abbreviations', () => {
|
test('FIRMS satellite names retain the three VIIRS abbreviations', () => {
|
||||||
assert.equal(satelliteShortName('N20'), 'N20');
|
assert.equal(satelliteShortName('N20'), 'N20');
|
||||||
assert.equal(satelliteShortName('N21'), 'N21');
|
assert.equal(satelliteShortName('N21'), 'N21');
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
satelliteShortName,
|
satelliteShortName,
|
||||||
fireDetectionKey,
|
fireDetectionKey,
|
||||||
accentForSeverity,
|
accentForSeverity,
|
||||||
|
formatFrpMw,
|
||||||
} from '../../data/firmsLabels.js';
|
} from '../../data/firmsLabels.js';
|
||||||
import {
|
import {
|
||||||
VIEW_PADDING,
|
VIEW_PADDING,
|
||||||
@@ -480,14 +481,15 @@ export function createModel({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function formatFrp(frp) {
|
function formatFrp(frp) {
|
||||||
return frp >= 10 ? frp.toFixed(0) : frp.toFixed(1);
|
return formatFrpMw(frp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** formatFrp for a card, with the locale's decimal separator ("4,9"). */
|
/** formatFrp for a card, with the locale's decimal separator ("4,9"). */
|
||||||
|
|
||||||
function formatFrpLabel(frp) {
|
function formatFrpLabel(frp) {
|
||||||
const digits = frp >= 10 ? 0 : 1;
|
const text = formatFrpMw(frp);
|
||||||
return formatNumber(frp, {
|
const digits = text.includes('.') ? 1 : 0;
|
||||||
|
return formatNumber(Number(text), {
|
||||||
minimumFractionDigits: digits,
|
minimumFractionDigits: digits,
|
||||||
maximumFractionDigits: digits,
|
maximumFractionDigits: digits,
|
||||||
useGrouping: false,
|
useGrouping: false,
|
||||||
|
|||||||
Reference in new issue
Block a user