fix: preserve analysis bands across input workflows
This commit is contained in:
@@ -382,7 +382,12 @@ test("Camera distance shift keeps the scene and scan on one z plane", () => {
|
||||
test("Camera aligns an experiment to an imported scene without changing grid resolution", () => {
|
||||
const experiment = {
|
||||
scan: { z: 2, xMin: -1, xMax: 1, yMin: -1, yMax: 1, columns: 32, rows: 24 },
|
||||
frequencyBands: [
|
||||
{ id: "low", minHz: 600, maxHz: 900, color: "#65f2bf" },
|
||||
{ id: "high", minHz: 1100, maxHz: 1500, color: "#58c7ff" },
|
||||
],
|
||||
};
|
||||
const originalBands = structuredClone(experiment.frequencyBands);
|
||||
const imageScene = {
|
||||
sources: [{ id: "one", position: [0.2, -0.1, 4.5] }],
|
||||
image: { plane: { z: 4.5, xMin: -2, xMax: 3, yMin: -1.5, yMax: 2.5 } },
|
||||
@@ -433,6 +438,11 @@ test("Camera aligns an experiment to an imported scene without changing grid res
|
||||
};
|
||||
assertEqual(alignExperimentToScene(experiment, movingScene), "source-bounds", "trajectory fallback");
|
||||
assertEqual(experiment.scan.z, 5, "trajectory depths contribute to median scan depth");
|
||||
assertEqual(
|
||||
JSON.stringify(experiment.frequencyBands),
|
||||
JSON.stringify(originalBands),
|
||||
"scene alignment preserves every analysis band",
|
||||
);
|
||||
assertNear(experiment.scan.xMin, -2.9, 1e-12, "trajectory x minimum with padding");
|
||||
assertNear(experiment.scan.xMax, 4.9, 1e-12, "trajectory x maximum with padding");
|
||||
assertNear(experiment.scan.yMin, -4.2, 1e-12, "trajectory y minimum with padding");
|
||||
|
||||
Reference in New Issue
Block a user