Public
Edited
Dec 13
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
probe_dictionary = {
if (viz_inputs.visualization_checkboxes.includes("probe")) {
let probe_intensity = fftshift2D(shifted_probes[1].abs_sqr());

return {
label: " Probe intensity",
scheme: "Greys",
domain: [0, probe_max_intensity],
width: probe_intensity.shape[1],
height: probe_intensity.shape[0],
values: probe_intensity.flatten().tolist()
};
}
}
Insert cell
Insert cell
Insert cell
shifted_probes[0].abs()
Insert cell
probe_fft_dictionary = {
if (viz_inputs.visualization_checkboxes.includes("Fourier probe")) {
let probe_angle = fftshift2D(
shifted_probes[0].angle().multiply(shifted_probes[0].abs())
);

return {
label: "Fourier probe angle [rad]",
// scheme: "Rainbow",
//domain: [0, 2 * Math.PI],
interpolate: cmap,
type: "linear",
width: probe_angle.shape[1],
height: probe_angle.shape[0],
values: probe_angle.flatten().tolist()
};
}
}
Insert cell
Insert cell
raster_subplot = (dicts, a, viz_width, viz_height) =>
Plot.plot({
width: viz_width,
height: viz_height,
margin: 0,
x: { axis: null },
y: { axis: null },
color: {
label: dicts[a].label,
domain: dicts[a].domain,
range: dicts[a].range,
interpolate: dicts[a].interpolate,
scheme: dicts[a].scheme,
type: dicts[a].type,
exponent: dicts[a].exponent,
style: { background: "none" }
},
style: { background: "none" },
marks: [
Plot.raster(dicts[a].values, {
width: dicts[a].width,
height: dicts[a].height
}),
Plot.frame({ strokeWidth: 1 })
]
})
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more