Array of Two Cylindrical Detectors for Localization of Radioactive Sources

2x1 cylindrical array and a shield (W or Pb) between the detectors

The count ratio between the back and front detectors reveals the direction of the source.

Enter the coefficients for the model:

packages = ["matplotlib"] import micropip import asyncio from js import console, document, fetch from pyodide.ffi import create_proxy import matplotlib.pyplot as plt async def load_script(url): response = await fetch(url) if not response.ok: raise RuntimeError(f"Failed to fetch {url}: {response.status}") script_content = await response.text() exec(script_content, globals()) async def main(): await micropip.install("matplotlib") await load_script('2x1_cylindricalModel.py') console.log("2x1_cylindricalModel module loaded.") parameterPlotting = globals()['parameterPlotting'] console.log("Setting up plot function...") def plot_model(event=None): console.log("Button clicked.") try: r = float(document.getElementById("r-input").value) w = float(document.getElementById("w-input").value) h = float(document.getElementById("h-input").value) console.log(f"Values entered: r={r}, w={w}, h={h}") plot_div = document.getElementById("plot") plot_div.innerHTML = "" fig = parameterPlotting(r, w, h) display(fig, target="plot") except Exception as e: console.error(f"Error plotting model: {e}") plot_proxy = create_proxy(plot_model) button = document.getElementById("plot-button") button.addEventListener("click", plot_proxy) console.log("Setup complete.") # Plot the model with default values when the page loads plot_model() asyncio.ensure_future(main())