EMBL Hamburg Biological
Small Angle Scattering

IMSIM manual


Post all your questions about IMSIM to the ATSAS Forum.

© ATSAS Team, 2018-2020

Table of Contents


The following sections shortly describe how to run IMSIM from the command-line on any of the supported platforms, details the required input and output files.


Simulation of two-dimensional small angle X-ray scattering patterns and, further, one dimensional profiles from biological macromolecules in solution. IMSIM implements a statistical approach yielding two-dimensional images in TIFF, CBF or EDF format, which may be readily processed by existing radial averaging tools. The resulting Intensities and error estimates of one-dimensional patterns obtained from the radial average of the two-dimensional images exhibit the same statistical properties as observed with actual experimental data. The effects due to changes of concentration, exposure time, flux, wavelength, sample-detector distance, detector dimensions, pixel size, and the mask as well as incident beam position can be considered for the simulation.

Running imsim



OPTIONS known by IMSIM are described in next section, the required argument is described in the section on input files.

Command-Line Arguments and Options

IMSIM accepts the following command line arguments:

ABSFILE Calculated scattering intensity in I[cm-1] / conc[mg/ml], e.g. by CRYSOL

IMSIM accepts the following command line options:

Short OptionLong OptionDescription
--seed=<INT> Set the seed for the random number generator (default: current time)
--background=<FILE> Calculated background intensity in I[cm-1] / conc[mg/ml] (default: built-in flat background)
--detector=<NAME> Detector name, defines pixel size and mask dimensions (default: Pilatus1M)1
--detector-distance=<m> Sample-detector-distance in meter (default: 1.0)
--flux=<N> Number of incoming virtual photons per second (default: 10^12)
-p --scattering-probability=<P> Probability that a virtual photons scatters (default: 1e-6)
--exptime=<T> Exposure time in seconds (default: 1)
-c --concentration=<C> Factor proportional to concentration of sample (default: 0)2
--wavelength=<m> X-ray wavelength in meter (default: 0.1e-9)
--axis Do not simulate but write axis for radial averaging with IM2DAT
--mask Do not simulate but write a centered detector mask for radial averaging IM2DAT
--mask-offset-x=<X> Mask offset in horizontal direction (default: 0)3
--mask-offset-y=<Y> Mask offset in vertical direction (default: 0)3
--header Do not simulate but write header information for IM2DAT
-o --output=<FILE> Output file name (default: basename of the input file, extension depends on other options)
--format=<FORMAT> Output format, one of: TIFF, EDF, CBF, MSK, ... (default depends on other options)
-v --version Print version information and exit.
-h --help Print a summary of arguments and options and exit.

1 Valid detector names are: Pilatus100k, Pilatus300k, Pilatus1M, Pilatus2M, Pilatus6M, Eiger500k, Eiger1M, Eiger4M, Eiger9M, Eiger16M.

2 A concentration of 0.0 corresponds to background simulation.

3 An offset of (0.0, 0.0) corresponds to an incident beam at the center of the simulated detector image; a mask-offset-y of half the detector height would correspond to an incident beam centered at the top edge of the detector.

Runtime Output

There is no output of IMSIM at run-time. For data output see output files.

imsim Input Files

Sufficiently densely calculated scattering pattern on absolute scale I[cm-1] / conc[mg/ml]. This may be obtained e.g. from CRYSOL. See also the example.

imsim Output Files

The output depends on the options selected:

  • option: axis: an angular axis file suitable for the use with IM2DAT is generated. Default output filename is the basename of the input data with extension .dat. May be redefined with option output.
  • option: mask: a beamstop and detector mask definition for the use with IM2DAT is generated. Default output filename is the basename of the input data with extension .msk. May be redefined with option output.
  • option: header: an optional key-value file for the use with IM2DAT is generated. Default output filename is the basename of the input data with extension .txt. May be redefined with option output.
  • otherwise:


To simulate scattering data based on an available tomic model, first run CRYSOL, then use the resulting .abs file as an input for the simulation (sim.sh: helper script for bash-shells on Linux, Mac and Linux Subsystem for Windows; the setup corresponds roughly to the 3m position at EMBL BioSAXS beamline P12 in Hamburg, Germany). Note that the maximum scattering vector (option sm/smax in CRYSOL) must be sufficiently large to allow for the whole data range to be mapped to the detector. Here, for 1V18:

$ crysol --smax 1.0 --ns 5001 --lm 50 1V18.pdb
$ bash sim.sh 1V1800.abs

The results as shown in PRIMUS/qt:

results of example script, exported from PRIMUS/qt

Plot of imulated data files of sample and background on logarithmic scale. In addition their corresponding concentration-normalized subtractions for c=0.5, c=2.0 and c=8.0 are displayed.

  Last modified: January 7, 2020

© BioSAXS group 2020