fix H5 scaling and 3D view, carousel reset

This commit is contained in:
2026-03-30 21:39:44 -07:00
parent c5c861717a
commit 8a70b0af05
7 changed files with 218 additions and 29 deletions

View File

@@ -3,7 +3,7 @@ import base64
import io
import numpy as np
from backend.node_registry import register_node
from backend.execution_context import emit_mesh
from backend.execution_context import emit_mesh, emit_warning
from backend.data_types import (
COLORMAPS,
DataField,
@@ -164,6 +164,14 @@ class View3D:
data = field.data
yres, xres = data.shape
phys_ratio = field.xreal / field.yreal if field.yreal else 1.0
pixel_ratio = xres / yres if yres else 1.0
if abs(phys_ratio / pixel_ratio - 1.0) > 0.02:
emit_warning(
f"Non-square pixels ({xres}\u00d7{yres} px). "
f"The 3D surface shows the physical scan area, not the pixel grid."
)
step_y = max(1, yres // resolution)
step_x = max(1, xres // resolution)
z = data[::step_y, ::step_x].astype(np.float32)