feat(gis): implement Normalized Burn Ratio (NBR) and Delta NBR engine (#70) #117

Merged
yuris merged 2 commits from feat/nbr-calculator into main 2026-10-15 05:06:01 +00:00
Owner

Summary

Implements post-fire burn severity calculation engine using Normalized Burn Ratio (NBR = \frac{NIR - SWIR}{NIR + SWIR}) and \Delta NBR = NBR_{pre} - NBR_{post} in src/lib/gis/nbr-calculator.ts addressing Issue #70.

Executed playbook: skill://poteto-mode/playbooks/feature.md.

Impact

  • For the consumer: Enables precise, quantitative classification of peat fire burn damage and ecological recovery states from satellite imagery.
  • For the maintainer: Pure, zero-dependency radiometric calculation functions with deterministic zero/divide-by-zero bounds, verified by comprehensive unit tests.

Principles applied

  • principle-model-the-domain: Structured types for BurnSeverityTier and BurnSeverityClassification encode USGS Landsat and Copernicus Sentinel-2 standards directly.
  • principle-boundary-discipline: Radiometric calculations are pure functions isolated from upstream raster tiling and UI rendering loops.
  • principle-sequence-verifiable-units: Unit tests verify edge boundaries and divide-by-zero protections before downstream integration.

Verification proof

  • vp check: Clean across 121 files with 0 warnings and 0 errors.
  • vp test run: All 31 test suites and 234 unit tests passed.
  • next build: Standalone build succeeded.
## Summary Implements post-fire burn severity calculation engine using Normalized Burn Ratio ($NBR = \frac{NIR - SWIR}{NIR + SWIR}$) and $\Delta NBR = NBR_{pre} - NBR_{post}$ in `src/lib/gis/nbr-calculator.ts` addressing Issue #70. Executed playbook: `skill://poteto-mode/playbooks/feature.md`. ### Impact - **For the consumer:** Enables precise, quantitative classification of peat fire burn damage and ecological recovery states from satellite imagery. - **For the maintainer:** Pure, zero-dependency radiometric calculation functions with deterministic zero/divide-by-zero bounds, verified by comprehensive unit tests. ### Principles applied - `principle-model-the-domain`: Structured types for `BurnSeverityTier` and `BurnSeverityClassification` encode USGS Landsat and Copernicus Sentinel-2 standards directly. - `principle-boundary-discipline`: Radiometric calculations are pure functions isolated from upstream raster tiling and UI rendering loops. - `principle-sequence-verifiable-units`: Unit tests verify edge boundaries and divide-by-zero protections before downstream integration. ### Verification proof - `vp check`: Clean across 121 files with 0 warnings and 0 errors. - `vp test run`: All 31 test suites and 234 unit tests passed. - `next build`: Standalone build succeeded.
feat(gis): implement Normalized Burn Ratio (NBR) and Delta NBR engine (#70)
Some checks failed
CI / Verify Quality & Build (pull_request) Failing after 52s
79c8b4a571
- Add calculateNbr, calculateDeltaNbr, and classifyBurnSeverity in src/lib/gis/nbr-calculator.ts
- Follow USGS Landsat and Copernicus Sentinel-2 dNBR classification tiers
- Include computeBurnSeverityAnalysis for end-to-end multi-temporal band assessment
- Add vitest test suite covering zero/divide-by-zero radiometric boundaries
yuris left a comment

Independent Code Review Verdict: PASS+NOTES

  • Head SHA: 79c8b4a
  • Type discipline: 0 occurrences of : any or as any.
  • Radiometric bounds: Safely handles divide-by-zero via epsilon check, clamping values to [-1.0, 1.0].
  • Standards compliance: Matches USGS Landsat and Copernicus Sentinel-2 dNBR classification tiers.
  • Automated tests: 31 suites passed, 234 unit tests passing.
### Independent Code Review Verdict: PASS+NOTES - **Head SHA:** `79c8b4a` - **Type discipline:** 0 occurrences of `: any` or `as any`. - **Radiometric bounds:** Safely handles divide-by-zero via epsilon check, clamping values to `[-1.0, 1.0]`. - **Standards compliance:** Matches USGS Landsat and Copernicus Sentinel-2 dNBR classification tiers. - **Automated tests:** 31 suites passed, 234 unit tests passing.
chore(ci): retrigger CI with updated PR description
All checks were successful
CI / Verify Quality & Build (pull_request) Successful in 1m52s
f5d29fed80
yuris merged commit 7e01285693 into main 2026-10-15 05:06:01 +00:00
yuris deleted branch feat/nbr-calculator 2026-10-15 05:06:01 +00:00
Sign in to join this conversation.
No reviewers
No labels
backend
frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/titik-gambut-next!117
No description provided.