sar3d: fixed default scene window X [-2,2], Y [-0.5,2], Z [0,8] m

The grid bounds are now explicit config (sar3d_x/y/z_min/max_m) instead of
being derived from the antenna span and the depth gate. The depth mask
still zeroes voxels outside [min_depth, max_depth], so the wider Z window
just shows the masked wedge. The bound fields are double: the parity tool
recomputes the notebook-derived bounds (notebook_grid_bounds) and passes
them through the live config, and a float roundtrip shifted the axes by
~1e-7 m, flipping depth-mask knife-edge voxels against the reference npz.
Parity on frames 0034-0036 unchanged (1.3e-6, axes bit-match).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
awe
2026-09-25 17:12:18 +03:00
co-authored by Claude Fable 5
parent 60f6c9e567
commit 7329750c0c
16 changed files with 220 additions and 81 deletions
@@ -94,12 +94,15 @@ struct SARConfig {
bool use_compensation = true;
// Высота НИЖНЕГО ряда антенн над землёй; Y=0 сцены — поверхность земли.
double ground_depth_m = 1.25;
// Полнообластная сетка: X — размах антенн ±x_margin_m, Y — высота над
// землёй, Z — полоса, покрывающая радарные глубины [min,max]_depth на всех
// высотах Y (см. build_full_region_grid).
double x_margin_m = 2.0;
// Явные границы сцены [м]: X — поперёк, Y — высота над землёй, Z — вдаль.
// Воксели с радарной глубиной вне [min_depth, max_depth] всё равно
// обнуляются маской, так что Z-окно шире полосы глубин безопасно.
double x_min_m = -2.0;
double x_max_m = 2.0;
double y_min_m = -0.5;
double y_max_m = 2.0;
double z_min_m = 0.0;
double z_max_m = 8.0;
std::array<double, 3> voxel_m{0.025, 0.02, 0.02}; // шаг (X, Y, Z)
// Финализация объёма: нормировка без верхних/нижних norm_edge_margin_m по Y
// (там ложный гребень постоянной дальности), сглаживание по (Z,X) в каждом
@@ -22,11 +22,16 @@ std::vector<double> frame_weights(const std::vector<FrameOffset>& offsets, doubl
// y = (-ground_depth + depth*sin(pitch)) / cos(pitch) (порт bp_plane_y).
double ground_plane_y(double depth, double ground_depth_m, double pitch_rad);
// Полнообластная сетка сцены (порт sar_build_full_region_grid):
// X — размах антенн ±x_margin, Y — [y_min, y_max] над землёй, Z — полоса,
// покрывающая радарные глубины [min_depth, max_depth] на всех высотах Y.
Grid build_full_region_grid(const GeometryConfig&, const BPConfig&, const SARConfig&,
double pitch_deg);
// Сетка сцены по явным границам SARConfig (x/y/z_min..max, шаг voxel_m);
// оси — linspace c числом точек round(span/step)+1, как в ноутбуке.
Grid build_full_region_grid(const SARConfig&);
// Ноутбучные границы (sar_build_full_region_grid): X — размах антенн ±margin,
// Z — полоса, покрывающая радарные глубины [min_depth, max_depth] на всех
// высотах Y. Используются parity-инструментом для сверки с эталонными npz.
void notebook_grid_bounds(const GeometryConfig&, const BPConfig&, const SARConfig&,
double pitch_deg, double x_margin_m,
double& x_min, double& x_max, double& z_min, double& z_max);
// point_to_scene: оси радара → сцена (поворот на pitch + подъём на ground_depth,
// если ground; Y=0 сцены — земля).