# Detectors on BornAgain

file:///usr/share/doc/bornagain/html/ref/instr/det/index.html Recent content in Detectors on BornAgain Hugo en-us

# SphericalDetector

file:///usr/share/doc/bornagain/html/ref/instr/det/spherical.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/ref/instr/det/spherical.html <h2 id="sphericaldetector">SphericalDetector</h2> <p>For SAS and GISAS simulations, the two-dimensional area detector is modelled by the <a href="https://jugit.fz-juelich.de/mlz/bornagain/-/tree/r23/Device/Detector/SphericalDetector.h">SphericalDetector</a> class.</p> <h3 id="geometry">Geometry</h3> <p>A <code>SphericalDetector</code> is a 2D detector defined in angular coordinates. All pixels have equal size.</p> <figure > <a href="file:///usr/share/doc/bornagain/html/img/draw/detector1.svg"> <img src="file:///usr/share/doc/bornagain/html/img/draw/detector1.svg" width="100%"> </a> <figcaption> <p></p> </figcaption> </figure> <p>In BornAgain, detector images are shown as seen from the back of the detector. In this way we ensure that the $\varphi$ or $q_y$ axis has the same orientation as the real-space $y$ axis.</p> <p>For plotting and data import and export, BornAgain pretends that the detector bins correspond to bins of constant width in $\varphi$ or $q_y$ and $\alpha$ or $q_z$, even though this is only true in first approximation.</p>

# 2d detector resolution

file:///usr/share/doc/bornagain/html/ref/instr/det/resolution.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/ref/instr/det/resolution.html <h3 id="resolution-function-of-a-two-dimensional-scattering-detector">Resolution function of a two-dimensional scattering detector</h3> <p>If a detector has a resolution function, then the simulated intensity map is blurred by convolution with that function.</p> <p>Currently, only Gaussian resolution functions are supported.</p> <h2 id="gaussian-distribution">Gaussian distribution</h2> <p>Create a Gaussian resolution function, and attach it to a detector, as follows:</p> <pre tabindex="0"><code>resol = ba.ResolutionFunction2DGaussian(horizontal_width, vertical_width) detector.setResolutionFunction(resol) </code></pre><p>For an example, see <a href="file:///usr/share/doc/bornagain/html/ref/instr/ex/resol/2d">resolution 2d example</a>.</p>

# Offspec detector

file:///usr/share/doc/bornagain/html/ref/instr/det/offspec.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/ref/instr/det/offspec.html <h2 id="off-specular-detector">Off-specular detector</h2> <p>The constructor is</p> <pre tabindex="0"><code>ba.OffspecDetector(n_phi, phi_min, phi_max, n_alpha, alpha_min, alpha_max) </code></pre><p>Scattering intensity is computed for <code>n_phi</code> azimuthal bins, then naively summed.</p> <p>Results may vary widely for even vs odd <code>n_phi</code>. Check! Choose the phi range so narrow, and <code>n_phi</code> so large that results become stable.</p>