Pass either OffspecDetector or SlitOffspecDetector to the same OffspecSimulation(scan, sample, detector) constructor.

Two-dimensional map

detector = ba.OffspecDetector(n_alpha, alpha_min, alpha_max, phi_min, phi_max)

Every incident scan point is combined with every outgoing-angle bin. OffspecSimulation(scan, sample, detector).simulate() returns a 2D map.

One-dimensional scan

Use SlitOffspecDetector for a 1D curve. For example, at constant 2θ:

scan = ba.AlphaScan(alpha_i)
alpha_f = two_theta - alpha_i
detector = ba.SlitOffspecDetector(alpha_f, alpha_width, phi_min, phi_max)

alpha_width is the full outgoing-angle acceptance of the slit.

Acceptance and beam spread

All angles are in radians. Both detectors integrate over the azimuthal range [phi_min, phi_max]. For SlitOffspecDetector, beam-distribution samples share their nominal scan point’s fixed detector position.

Enable simulation.options().setIncludeSpecular(True) to include the reflected beam when it falls inside the detector acceptance.

Examples