SPOTS - Fitting multilayer reflectivity data

1. Introduction

March 2008, Last modified 31 October 2015

The special feature of this program is that it can average the reflectivity from up to three regions with different surface structures. This permits direct calculation of reflectivity when the lateral extent of 'patches' and 'holes' is large compared with the coherence length. (If the dimensions are small then it is possible to simply average the scattering length densities across the surface in the various layers). The program is an extension of drydoc which allows similar uniform models for a uniform interface.

A similar program that includes the imaginary part of the scattering length density, xspots, has been written to treat the case of X-rays where absorption can be significant.

This program provides a means of making interactive, graphical fits to neutron reflection data using multilayer models calculated using optical matrix methods. The parameters may be changed manually to explore the effect of different structural models or varied using a least squares algorithm. A simple structure with up to eight layers can be modelled.

It is assumed that there are similarities in the different regions such that the layer structure, if present is identical. The layers are defined and then the maximum number of layers used for the calculation is defined for each of 3 regions. The fractional coverage of each of the first two regions is input as parameters (labelled FReg1 and FReg2). The fractional coverage of the third region, FReg3 is given by:

FReg3 = 1 - (FReg1 +FReg2).

Note that there are no constraints on the values of FL1 and FL2 and if a scale factor is used in the model there will be correlations as these are simple multiplicative factors.

The program is intended for operation with Windows and can optionally be run with a GUI. The current version of is prepared using the MinGW Fortran compiler. The current version of spots is 1.8 .

The program is written in FORTRAN and uses the FITFUN fitting package and PGPLOT (T. J. Pearson, Caltech) graphics as modified by R. E. Ghosh from the ILL, Grenoble, France.

Installation It is recommended to run the program using clickfit and the utility 'Prop' available from the ILL. Instruction for download and use of Prop are available from the ILL WWW site.

Information about other fitting programs that will treat profiles, multiple data sets and other specific problems is available on the web at:

2. Use of Program

Instructions on the use of FITFUNS can be found in the documentation at the ILL, Grenoble.

The main options for the program are chosen from a 'Prelude' dialogue box that allows selection of the data format, number of layers, use of resolution function etc.

The default choices in the prelude can be changed by editing the appropriate .fcl file. Once the choices are made, the main program is controlled from a different interactive window:

The individual variables can be selected with a mouse and a new dialogue box appears that allows new values for parameter and the step size to be given. Other functions can be selected from the buttons or pull down menus. When display of data or a fit is calculated, it is shown in a separate graphics window:

2.1 Data Files

Ten ASCII data formats can be read in the current version. These are:

The data format is selected in either the opening dialogue or the Clickfit 'Prelude'. A fuller description of the data formats is available at The four column data set input has been added in August 2007. The 4th column provides information about Q resolution of the data.

2.2 Hints

2.3 Definitions

The program assumes that data for scattering length density is provided in units of 1 x 10-6 Å-2. If the momentum transfer, Q, in the input data files is in Å-1 then the thickness of layers must be given in Å.

The following summary of definitions may be useful:

The following diagram indicates this arrangement schematically for the simplified case of two regions (Flay1 + Flay2 = 1) and hence Flay3 = 0.

The roughness for the top material and subsequent layers is given in Angstrom.

2.4 Customising

The last parameters, the ranges for fitting and the limits for graphs are saved in a parameter file if the 'Save' option is used. These are the defaults when the program is restarted.

Further customisation of the defaults is possible by editing the clickfit configuration file that is used to start the program. An example (spots.fcl) is shown below:

prld|title|Spots - A.R. Rennie  Version 1.8   30 October 2015
prld|Give data weighting 0-none;1-statistical |float|0| 0 | 1 |
prld|Data type .dat 0; RAL 1; Afit 2; NIST 3; .TXT (ANSTO) 4; .OUT (ILL) 5; New .his 6; .mft 7; 3-col no header 8; mantid .mft 9 |float|9| 0 | 9 |
prld|Fit data as R*Q**4 0-no, 1 yes |float|0| 0 | 1 |
prld|Include resolution 0-none; 1 const dQ/Q; 2 const dQ; 3 dQ/Q + dQ; 4 input from data file |float|0| 0|4|
prld|Resolution: for dQ/Q constant give % resolution |float|5.0|.1|30|
prld|Resolution: for Delta-Q constant give value (A-1)|float|0.01| 1e-5 | 0.1 |
rcmd|wntle|Reading new data
rcmd|title|Reading reflectivity data
rcmd|Data filename.ext|filer|a28708.dat|
main|wntle|spots - fitting a profile model with large patches to reflection data
hcmd|title|spots - Fit with a gui
hcmd|View file/View helpfile |filed|spots.hhh
jcmd|wntle|model output
jcmd|title|Write out model for later comparison with data
jcmd|Write out reflectivity file (1) or Interface as BSD file (2) |float|1|1|2|
jcmd|Reflectivity file: Minimum Q value A-1 |float|0.0|0|4
jcmd|Reflectivity file: Maximum Q value A-1 |float|0.4|0|4
jcmd|Reflectivity file: Number of points in output |float|50|0|512
jcmd|Filename for output (with extension)|filew|spots.dat
jcmd|Title for reflectivity results|text|Output from spots
rstx|attempt restart function (dummy at present - rsta control name)

The default data types, resolution and even input data file name can be altered by editing the file.

2.5 Updates

Some information on updates may allow users to decide whether they need to download a ne version of the program.

A variant of this program is xspots that calculates with data that includes the imaginary part of the scattering length density and xmspots that can include simultaneous fits to multiple data sets.

3 References

A description of the methods used in these calculations is given in the Rutherford Appleton Laboratory Report: 'Adaptation of Methods in Multilayer Optics for the Calculation of Specular Neutron Reflection' by J. Penfold, No. RAL-88-088. Other details on the calculation of reflectivity profiles can be found in the books by O. S. Heavens, 'Optical Properties of Thin Solid Films', Dover and J. Lekner, 'Theory of Reflection', Nijhof.

Professor Adrian R. Rennie
Department of Physics, Uppsala University, Uppsala, Sweden


Program and documentation: © Copyright A. R. Rennie Last updated 31 October 2015