diff --git a/templates/imdroid_radar.html b/templates/imdroid_radar.html
index 7ca5a4b..6454fcd 100644
--- a/templates/imdroid_radar.html
+++ b/templates/imdroid_radar.html
@@ -128,6 +128,7 @@
maybeCalcSector();
maybePlotSquare();
maybeCalcNearbyRain();
+ maybeCalcTileRegionStats();
}
async function loadTileAt(z, y, x, dtStr) {
@@ -160,6 +161,7 @@
maybeCalcSector();
maybePlotSquare();
maybeCalcNearbyRain();
+ maybeCalcTileRegionStats();
}
function fmtDTLocal(dt){
@@ -436,6 +438,75 @@
}catch(e){ /* ignore */ }
}
+ // 计算并展示:扇形区域与8km圆形区域的 >=40 和 >=30 dBZ 点数与累计值
+ function maybeCalcTileRegionStats(){
+ try{
+ const s40CntEl = document.getElementById('sector_ge40_cnt');
+ if(!s40CntEl) return; // 元素不存在则不计算
+ // 先清空展示
+ const ids=[
+ 'sector_ge40_cnt','sector_ge40_sum','sector_ge30_cnt','sector_ge30_sum',
+ 'circle_ge40_cnt','circle_ge40_sum','circle_ge30_cnt','circle_ge30_sum'
+ ];
+ ids.forEach(id=>{ const el=document.getElementById(id); if(el) el.textContent='-'; });
+
+ if(!gTileValues || !gXs || !gYs || gStLat===null || gStLon===null) return;
+ const h=gTileValues.length, w=gTileValues[0].length;
+
+ // 扇形区域定义:风向 ±30°,半径 = 3 小时移动距离
+ const hasWind = (gWindFromDeg!==null && gWindSpeedMS!==null && gWindSpeedMS>0);
+ const halfAngle=30;
+ const rangeM = hasWind ? (gWindSpeedMS*3*3600) : 0;
+
+ // 圆形区域:半径 8km
+ const circleR = 8000;
+
+ let sec40Cnt=0, sec40Sum=0, sec30Cnt=0, sec30Sum=0;
+ let cir40Cnt=0, cir40Sum=0, cir30Cnt=0, cir30Sum=0;
+
+ for(let r=0;r=40){ cir40Cnt++; cir40Sum+=dbz; }
+ if(dbz>=30){ cir30Cnt++; cir30Sum+=dbz; }
+ }
+
+ // 扇形区域统计(需要风向风速)
+ if(hasWind){
+ if(dist<=rangeM){
+ const brg=bearingDeg(gStLat,gStLon,lat,lon);
+ if(angDiff(brg,gWindFromDeg)<=halfAngle){
+ if(dbz>=40){ sec40Cnt++; sec40Sum+=dbz; }
+ if(dbz>=30){ sec30Cnt++; sec30Sum+=dbz; }
+ }
+ }
+ }
+ }
+ }
+
+ // 更新展示
+ const set = (id, val)=>{ const el=document.getElementById(id); if(el) el.textContent=String(val); };
+ if(hasWind){
+ set('sector_ge40_cnt', sec40Cnt); set('sector_ge40_sum', sec40Sum.toFixed(1));
+ set('sector_ge30_cnt', sec30Cnt); set('sector_ge30_sum', sec30Sum.toFixed(1));
+ } else {
+ // 无风场信息时显示提示
+ set('sector_ge40_cnt', '无风场'); set('sector_ge40_sum', '-');
+ set('sector_ge30_cnt', '无风场'); set('sector_ge30_sum', '-');
+ }
+ set('circle_ge40_cnt', cir40Cnt); set('circle_ge40_sum', cir40Sum.toFixed(1));
+ set('circle_ge30_cnt', cir30Cnt); set('circle_ge30_sum', cir30Sum.toFixed(1));
+ }catch(e){ /* ignore */ }
+ }
+
async function main() {
await loadStations();
// 初始化时间范围为最近24小时
@@ -605,6 +676,7 @@
+
@@ -615,6 +687,14 @@
正方形裁减区域
+
+
扇形区域统计
+
≥40 dBZ:点数 -,累计 -
+
| ≥30 dBZ:点数 -,累计 -
+
圆形区域统计
+
≥40 dBZ:点数 -,累计 -
+
| ≥30 dBZ:点数 -,累计 -
+