dxtbx.model.beam

class dxtbx.model.beam.BeamFactory[source]

Bases: object

A factory class for beam objects, which encapsulate standard beam models. In cases where a full cbf description is available this will be used, otherwise simplified descriptions can be applied.

static complex(sample_to_source: Tuple[float, float, float], polarization_fraction: float, polarization_plane_normal: Tuple[float, float, float], wavelength: float) Beam[source]

Full access to the constructor for cases where we do know everything that we need…

static from_dict(dict: dict, template: dict = None) Beam | PolychromaticBeam[source]

Convert the dictionary to a beam model

static from_phil(params: scope_extract, reference: Beam | PolychromaticBeam | None = None) Beam | PolychromaticBeam[source]

Convert the phil parameters into a beam model

static imgCIF(cif_file: str) Beam[source]

Initialize a detector model from an imgCIF file. N.B. the definition of the polarization plane is not completely helpful in this - it is the angle between the polarization plane and the +Y laboratory frame vector.

static imgCIF_H(cbf_handle: cbf_handle_struct) Beam[source]

Initialize a detector model from an imgCIF file. N.B. the definition of the polarization plane is not completely helpful in this - it is the angle between the polarization plane and the +Y laboratory frame vector. This example works from a cbf_handle, which is already configured.

static make_beam(sample_to_source: Tuple[float, float, float] = None, wavelength: float = None, s0: Tuple[float, float, float] = None, unit_s0: Tuple[float, float, float] = None, divergence: float = None, sigma_divergence: float = None) Beam[source]
static make_polarized_beam(sample_to_source: Tuple[float, float, float] = None, wavelength: float = None, s0: Tuple[float, float, float] = None, unit_s0: Tuple[float, float, float] = None, polarization: Tuple[float, float, float] = None, polarization_fraction: float = None, divergence: float = None, sigma_divergence: float = None, flux: float = None, transmission: float = None, probe: Probe = dxtbx_model_ext.Probe.xray) Beam[source]
static make_polychromatic_beam(direction: Tuple[float, float, float], divergence: float = 0.0, sigma_divergence: float = 0.0, polarization_normal: Tuple[float, float, float] = (0.0, 1.0, 0.0), polarization_fraction: float = 0.5, flux: float = 0.0, transmission: float = 1.0, probe: Probe = dxtbx_model_ext.Probe.xray, sample_to_source_distance: float = 0.0, deg: bool = True, wavelength_range: tuple[float, float] = (0.0, 0.0)) PolychromaticBeam[source]
static simple(wavelength: float) Beam[source]

Construct a beam object on the principle that the beam is aligned with the +z axis, as is quite normal. Also assume the beam has polarization fraction 0.999 and is polarized in the x-z plane, unless it has a wavelength shorter than 0.05 Å in which case we assume electron diffraction and return an unpolarized beam model.

static simple_directional(sample_to_source: Tuple[float, float, float], wavelength: float) Beam[source]

Construct a beam with direction and wavelength.