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)


The Source_at McXtrace Component

3.2  The Source_flat McXtrace Component

Release: McXtrace 0.1_alpha

A flat rectangular or circular surface emitting x-rays

Identification

  • Author: Erik Knudsen

  • Origin: Risoe

  • Date: September 25, 2009

Description

A circular or rectangular xray source. Spectrum may be either gaussian or uniform around a central wavelength/energy or read from a datafile. Xrays are considered emitted uniformly into 4pi, but a square target retricts the beam to that window and scales the beam intensity accordingly. If an input spectrum datafile (spectrum_file) is not specified, the beam is restricted to emit photons between E0+-dE keV, or lambda0+-dlambda Å, whichever is given. The input spectrum file should be formatted such that x-ray energy/wavelength is in the first column and the intensity in the second. Any preceding lines starting with # are considered part of the file header. If a datafile is given, a nonzero E0 value indicates that is is parametrized by energy (in keV) as opposed to wavelength (in Å). Wavelength is the default. Flux is set in the unit photons/s

Example: Source_flat(xwidth=1e-3,yheight=1e-3, focus_xw=0.5e-2, focus_yh=0.45e-2,dist=1, E0=E0, dE=DE)

Input parameters

Parameters in boldface are required; the others are optional.

Name

Unit

Description

Default

radius

m

Radius of circle in (x,y,0) plane where x-rays are generated.

0

yheight

m

Height of rectangle in (x,y,0) plane where x-rays are generated.

0

xwidth

m

Width of rectangle in (x,y,0) plane where x-rays are generated. Overrides xmin and xmax.

0

xmin

m

Lower bound of x-interval where photons are generated.

0

xmax

m

Upper bound of x-interval where photons are generated.

0

dist

m

Distance to target along z axis.

0

focus_xw

m

Width of target

.045

focus_yh

m

Height of target

.12

E0

keV

Mean energy of xrays.

0

dE

keV

Energy half spread of x-rays (flat or gaussian sigma).

0

lambda0

Å

Mean wavelength of x-rays.

0

dlambda

Å

Wavelength half spread of x-rays.

0

flux

pht/s

Total flux radiated from the source

0

gauss

1

Gaussian (1) or Flat (0) energy/wavelength distribution

0

randomphase

If nonzero, the phase of the emotted photon is random, i.e. source is fully incoherent. otherwise the value of phase is used.

1

phase

rad

Set phase to something given.

0

spectrum_file

string

Filename for optional spectrum-file

””

Links

  • Component source code found in file Source_flat.comp.

A flat surface emitting photons with a spectrum either uniform, gaussian or generated from a datafile

A simple source model, with a flat surface emitting photons. The surface in the \(xy\)-plane is specified as a rectangle with dimensions \(\mathit {xwidth}\times \mathit {yheight}\) \(\mathrm {m}^{2}\), or as a circle with radius \(\mathrm {m}\). The initial x-ray position is chosen randomly in the source surface — its wavevector is chosen randomly (exactly as in the case of Source_pt) (section 3.1) in the defining aperture with height focus_yh and width focus_xw placed at \((0,0,\mathit {dist})\).

Just as for Source_pt the aperture is for efficiency purposes and, if misused, may cause biasing.

With the exception of source size related parameters, all other parameters are identical to Source_pt Note that this also applies to coherence and photon phase. If randomphase\(=0\) then a photon emitted from \((x_0,y_0,0)\) will in phase with a photon emitted from \((x_1,y_1,0)\). I.e. full transversal coherence.


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