print

Analysis Programs for Reflectivity Data at the ILL

cosmos

COSMOS is a program that will take raw TOF data for multiple angles, it will calibrate to the incident wavelength distribution and the detector efficiency, and will output reflectivity vs. Q. An article about the mathematical body of the program can be found here.

Start the program by typing COSMOS in the LAMP manipulations window.

Note that, due to width specifications, a column is usually hidden to the right of the window.  Use the slider bar at the bottom of the COSMOS window to find it.

Data path:
Enter the path to your data and the path to output files here.  If you're trying to access data while at the ILL, here's a couple of useful paths:

While using LAMP on the D17 instrument:     /users/data/
If trying to access data from the D17 PC:       \\serdon\illdata\yyc\d17\exp_x-xx-xxx\rawdata\
(yy = year, c = cycle.  e.g. second cycle, 2005, = 052)
(exp_x-xx-xxx is your experimental number e.g. exp_9-11-1234)

Don't forget the last slash!

Output directory:

This is the directory where COSMOS will save the reduced ascii files and the cosmos setting files.
We recommend to use the 'processed' folder related to your experiment:       \\serdon\illdata\yyc\d17\exp_x-xx-xxx\processed\

(yy = year, c = cycle.  e.g. second cycle, 2005, = 052)
(exp_x-xx-xxx is your experimental number e.g. exp_9-11-1234)

Don't forget the last slash!

Output basename:

This is the name for the settings file.
Output file format:

Click here the data output formats you want to be saved.

MFT file contents:

This is the instrument parameters you want to be saved in the file header of the .mft file format.

Clicking this tab will open a window that allows you to select the areas of the detector where COSMOS will search for the specular reflection.  This is a useful option if there is strong, structured off-specular scattering, or for weak reflectivity.

Pixel range:  

Specify here the first and last x-pixels in the detector range to be used, separated by a comma.
The D17 detector has 256 pixels in the x-direction.  Look closely, and you will see that the first and last 20 or so pixels have zero intensity.  In other words, the x-range is larger than the range on the detector.  For this reason, it is best to always have an x-range of something like 30 ≥ x ≥ 245.

Search Range for Peak:  

Specify the ranges (x detector pixels) of the detector that will be used to find the specular reflectivity. 

Search Range for Peak (TOF channels):

The minimum and maximum y-detecor pixels that will be used to find the specular reflectivity.
In time-of-flight, the specular reflectivity corresponds to a vertical line on the detector.  COSMOS will look for a peak within the range that is defined in x integrating over the range defined in y (TOF channels).

Leaving the fields blank means that no limits will be adopted.

Inserting auto in the TOF channels field means that the reflectivity will be calculated over the wavelength range defined  in the Calculation tab.

The calculation options tab controls the parameters used for finding and integrating the specular peak intensity, specifying the available wavelength range, subtracting background, and rebinning the data.

Clicking this tab will show something like the image on the right.

You have the possibility to enter different parameters for each of the measured angles.

Information on the individual fields is given below.

Calculation method: Here you can choose to add foreground intensities along lines of constant wavelength, which is the right choice if the sample is flat and the incoming beam divergence is higher than the detector resolution (incoherent method), or you can choose to add foreground intensities along lines of constant qz, which is the right choice if the sample is bent or the detector resolution is higher than the incoming beam divergence. In any case COSMOS will warn you in hte log tab if you have choosen an inapropriate method. Details can be found in: Cubitt et al., J. Appl. Cryst. 48, 2006-2011 (2015).

Foreground Width:  COSMOS will look for the specular ridge, and will integrate the intensity over the number of x-pixels given by the number in this box.  For example, if the number is 13, COSMOS will find the pixel corresponding to the centre of the specular ridge at x-pixel N and will integrate the intensity in x-pixels N — 6 <  x <  N + 6. You can also choose an asymmetric foreground width by typing in two numbers separated by a comma: e.g., if the numbers are 6,5, COSMOS will integrate the intensity in x-pixels N — 6 <  x <  N + 5.

Background Range:  The range of x-pixels used to calculate the background is calculated from the limits of the foreground width.  A single number will estimate the background from the pixels immediately from the limits of the foreground width.  Two numbers, separated by a comma, estimate the background over a range of pixels given by the first number, spaced from the limit of the foreground by the second number.
For example, a specular peak centred at pixel N and a  foreground width of 13 will have a left limit of N – 6.
A left range of 5 will use pixels N – 11 < x < N – 7 to estimate the background.
A left range of 5,5 will use pixels N – 16 < x < N – 12 to estimate the background.

Lambda Range: The wavelength range, calculated from the time-of-flight and from the incident angle of the beam, that will be used for the reflectivity.  A wavelength range of 2 to 20 Å is normally reasonable.

Background Method:  The two options to choose between are:

Average – This will simply take the mean of the intensity in the background range, and subtracts this mean from each point under the specular peak.  This should be fine if the background is roughly flat over the pixel range, and the peak shape of the specular scattering, projected on to the x-pixel axis, is symmetric.
Fit – This assumes that the background is linear around the range of the peak.  A straight line is fitted through the background points, and the background contribution for each point under the reflection is calculated based on the resulting equation.  This may give better results if the peak shape of the specular scattering, projected on to the x-pixel axis, is not very symmetric.

Grouping:  This will rebin the data, producing a smoother plot.
If 'Grouping' is selected, COSMOS applies a grouping based on the calculated resolution of D17, δQ.  This resolution changes as a function of Q.  The value entered is multiplied by δQ(Q) and, after grouping, will give the new distance between one point and its neighbour.

e.g.: The raw data for a particular measurement:
Q1 = 0.0100003,  δQ1 = 0.000264723
Q2 = 0.0100197
Q2 – Q1 = 0.0000194

(estimates come from unbinned data.  δQ is the estimated FWHM of the resolution)
Assume that a Parameter value of 0.2 is chosen.
The step size between Q1 and the rebinned neighbour, Q2’, wil be 0.2× δQ1.
i.e. Q2’ – Q1 = 0.2 × 0.000264723 = 0.0000529446
The data within this interval will be averaged to a single point.
 
Discard Low Statistics Data:  This runs a routine that cleans up noisy data.
After the data at all angles have been combined and sorted by ascending Q, the routine searches through neighbouring pairs of data.  The criteria for considering rejection is when the q-resolution range for Q on one of the data points fits entirely within the q-resolution range for the other.

e.g.  consider two points:
Q1 = 0.010, δQ1 = 10–4
Q2 = 0.011, δQ2 = 0.005

The tolerance range for Q1 (0.0099 ‹ Q1 ‹ 0.0101) is within the tolerance range for Q2 (0.006 ‹ Q1 ‹ 0.017).  This satisfies the criteria for rejection.

The routine then rejects the data point with the largest error on the reflectivity. NOTE: Using this routine you effectively discard information. We therefore do not recommend to use this option for data to be fitted. This option is reserved for cosmetics in Figures only.

The Machine tab contains very important parameters that come from the calibration of time-of-flight parameters on D17.  Make sure that they are correct with respect to your measurement! 

You can ask your local contact for the correct parameters.

Usually, the correct values should be saved in the data file.  In this case you just untick the 'Override numors values' box.

d0,d1:  This is the distance between the choppers and the sample position, given in metres.
Opening Offset:  If the choppers are phased to this value, the beam has no direct line of sight from the guide to the sample position.

Poff Offset:  This is a parameter giving twice the angle between a pickup on the chopper (from which the time-of-flight is calculated) and the opening edge of the chopper.

TOF delay:  This is the electronic delay time between the pick-up pulse of the master chopper and the start of the detector acquisition in seconds.
Sample position offset:  This is an offset of the sample position from the center of the goniometer stage on FIGARO. Positive direction is away from the reactor, so typically this should be a negative number if the sample is placed closer to the sample slit. This is usefull to minimize the gravity effect. Note: This option is not implemented for D17!

Pixel Width:  This is the width of an x-pixel, given in metres.
Sample-to-detector distance: This is the distance from the sample centre to the detector in metres. In case of FIGARO this is the distance for the direct beam configuration.

Distances: These are the distances of the detector translation stages on FIGARO from which COSMOS calculates the actual sample-to-detector distance for any configuration. This is needed as the FIGARO detector is not rotating around the sample, but can be placed in any position.

Take values from numor: Here one can type in an experimental file number and COSMOS will read the machine parameters from this file when clicking on 'Take'.

Override numor values:  The above values should be saved in the data file, and they should be read automatically when COSMOS is run.  If you suspect that the values are wrong, you may click this option and manually enter the values.

You have the possibility to have different values for each angle measured.

On D17 these values are usually the same for all angles.  They will sometimes change between cycles if there has been an intervention on the instrument.  The only time you would need to have different values for different angles would be if you wanted to analyse sets of data from the same sample, measured in separate experiments (this is generally inadvisable anyway).
On FIGARO these values will change between angles.  Make sure you keep a record of the right values.

Ask your local contact and/or the instrument responsible for more details.