McXtrace logo

McXtrace - An X-ray ray-trace simulation package

Synchrotron SOLEIL DTU Physics

McXtrace

About McXtrace
 Publications
 Project Partners
 Project People
 Goal

Download
 Components

Mailing list

Search

Documentation
 Manual
 Commands
 Wiki (GitHub)
 Tutorial

Links

Report bugs (GitHub)

Code-repository (GitHub)


McXtrace: Source_lab

[ Identification | Description | Input parameters | Links ]

The Source_lab Component

Laboratory x-ray source, using xraylib for all material data.

Identification

  • Author: Erik B. Knudsen (original Source_lab), xraylib port derived from it
  • Origin: Kgs. Lyngby
  • Date: May 2012 (original), 2026 (xraylib version)

Description

Model of a laboratory x-ray tube, generating x-rays by bombarding a target by electrons.
Given a input energy E0 of the electron beam, x-rays are emitted from the accessible emission lines
The geometry of the tube is assumed to be:
# The electron beam hits a slab of surface material surface at a right angle illuminating an area of width by height,
# where width is measured along the component X-axis.
# The centre of the electron beam at the anode surface is the origin of the component.
# The Z-axis of the component points at the centre of the exit window (focus_xw by focus yh)
placed at a distance dist from the origin.
# The angle between the Z-axis and the anode surface is the take_off angle.
For a detailed sketch of the geometry see the component manual.

The Bremsstrahlung emitted is modelled using the model of Kramer (1923) as restated in International
Tables of Crystallography C 4.1

Characteristic radiation (K-lines Ka1, Ka2, Kb1, Kb3) is modelled by Lorentzian (default) or Gaussian
energy profiles. Line energies, level widths (FWHM = K level width + final level width) and relative
intensities (radiative rates, strongest line = 1) are obtained from xraylib for ANY mono-atomic anode;
no datafile is needed. Lines that fall outside [Emin,Emax] are dropped.

Absorption of emitted x-rays while travelling through the target anode is included, using the xraylib
total mass attenuation coefficient (tabulated once in INITIALIZE on a log grid, with extra points
on both sides of every absorption edge, and interpolated log-log in TRACE).

Example: Source_lab(material="Cu",Emin=1, E0=80)
Legacy:  Source_lab(material_datafile="Cu.txt",Emin=1, E0=80)

Input parameters

Parameters in boldface are required; the others are optional.
NameUnitDescriptionDefault
materialstringAnode element, symbol ("Cu", "W", ...) or atomic number as a string ("29")."Cu"
widthmWidth of electron beam impinging on the anode.1e-3
heightmHeight of electron beam impinging on the anode.1e-3
thicknessmThickness of the anode material slab.100e-6
E0kVAcceleration voltage of xray tube.20
EmaxkeVMaximum energy to sample. Default (Emax=0) is to set it to E0.0
EminkeVMinimum energy to sample.1
focus_xwmWidth of exit window.5e-3
focus_yhmHeight of exit window.5e-3
take_offdegTake off angle of beam centre.6
distmDistance between centre of illuminated target and exit window.1
tube_currentAElectron beam current.1e-3
frac0-1Fraction of statistic to use for Bremsstrahlung.0.1
lorentzian0/1If nonzero Lorentzian (more correct) line profiles are used.1
xwidthmWidth of the anode material slab (0: practically infinite).0
yheightmHeight of the anode material slab (0: practically infinite).0
exit_window_refptmIf set, the AT position and exit window will coincide (legacy behaviour).0
material_datafilestringLegacy parameter, kept for backward compatibility with Source_lab. Only the file NAME is used: the element is taken from it ("Cu.txt", "../data/Mo.txt" -> "Cu", "Mo"); the file is not read. If set, it overrides 'material'.""
AT ( , , ) RELATIVE
ROTATED ( , , ) RELATIVE

Links


[ Identification | Description | Examples | Input parameters | Links ]

Generated on mcxtrace 3.10.2


Last Modified: Monday, 02-Nov-2026 22:21:08 CET
Search website mailinglist archive GitHub repos