5. Mathematical Reference

This page describes the mathematical operations behind the Slice and Cut operations of MSlice

In general, MSlice handles “reduced” (processed) inelastic neutron scattering data which has been binned (histogrammed) in energy transfer for each detector / position-sensitive-detector (PSD) element. We will use the terminology of the Horace program and refer to these energy-detector-element bins as “pixels”.

Since the detector elements are in the laboratory coordinates, but we often want to plot the data in reciprocal space, a coordinate transformation is needed. This means that the input and output binning grids of the data will not be axis aligned, and will instead look something like this:

_images/rebin_grids.svg

Where the square red grid represents the target (output) bins, and the slanted green grids (parallelograms) represents the original bins (“pixels”). As discussed in the PSD and non-PSD modes section, MSlice makes a distinction between PSD (fine green grid) and non-PSD (coarser green grid) data.

A Slice refers to a rebin into a two dimensional output, whilst a Cut is a rebin _or_ integration into a one dimensional output. For each type of data (PSD and non-PSD) we will describe each operation in turn.

5.1. PSD Slice

For PSD data, MSlice uses centre-point rebinning, treating each input bin (“pixel”) as a point and summing the full signal of each pixel whose centres lie within an output bin (illustrated in the image by the darker green shading in top left, with dots marking centres). Thus the output signal in the (i,j)th bin, Y_{ij}, is:

Y_{ij} = \frac{1}{N_{kl}} \sum_{kl} y_{kl}

where y_{kl} is the input signal in the input (k,l)th bin and the sum runs over the N_{kl} number of bins whose centres lie within the boundaries of the (i,j)th output bin.

The above expression uses the NumEventsNormalization convention of Mantid which is the same as that adopted by the Horace program. The error values are considered to be standard deviations and are summed in quadrature.

5.2. PSD Cut

Since MSlice allows users to specify bins in the non-integrating direction which are not necessarily aligned with respect to the original data, a rebinning step as described above is needed for the Cut operation too.

This leads to the two types of behaviour (“algorithms”) for the Cut operation described in the Cutting Algorithms section:

  • The default Rebin method just uses the rebinning described above with one axis having only a single bin.

  • The Integration method first rebins the data as described above with the integration axis divided into N_{\mathrm{int}} = 100 bins. It then calls the relevant Mantid algorithm (IntegrateMDHistoWorkspace) to integrate (sums the signal) in those 100 bins.

Taking the j index to be over the integration axis, the integrated Cut signal C_i is then given by:

C_i^{\mathrm{integration}} = w_i \sum_{j \in \mathcal{D}} Y_{ij}

where the index j only runs over regions with data \mathcal{D}, and the width w_i = \sum_{j \in \mathcal{D}} w_{ij} where w_{ij} is the width in the jth direction of the (i,j)th bin.

Note that the equivalent expression for a Rebin cut is simply:

C_i^{\mathrm{rebin}} = \sum_{j \in \mathcal{F}} Y_{ij}

where now the index j runs over the full integration range \mathcal{F}. The difference is thus a coordinate-dependent weighting factor w_i. If the integration range does not include regions without data (e.g. \mathcal{D} \equiv \mathcal{F}) then all the w_i will be equal to the full integration width and the difference between C_i^{\mathrm{integration}} and C_i^{\mathrm{rebin}} is a constant.

However, if the integration range covers region with no data (e.g. beyond the kinematic limits) then the two cuts may look very different because C_i^{\mathrm{integration}} will weight regions with data more heavily than regions without data.

5.3. Non-PSD Slice

For non-PSD data, MSlice uses fractional rebinning, where it first calculates the overlap area between the input and output bins, and then sums only the fraction of the signal of the input bins which overlaps the output bin.

The output signal is computed as:

Y_{ij} = \left. \sum_{kl} y_{kl} f_{kl} \right/ \sum_{kl} f_{kl}

and the output uncertainty as:

E_{ij} = \left. \sqrt{\sum_{kl} e^2_{kl} f_{kl}} \right/ \sum_{kl} f_{kl}

where f_{kl} is the fractional overlap of the input (k,l)th bin with the output (i,j)th bin.

This is illustrated in the figure at the start of the page by the square on the right hand side with blue triangular and orange quadrilateral shaded regions. The blue and orange shading illustrates the fractional overlap areas which weights the signal in the top left and top right input bins (large parallelograms) respectively.

5.4. Non-PSD Cuts

Like for PSD data, there are two Cut “algorithms” for non-PSD data also.

The Rebin cut algorithm performs the same operation described in the previous section but with a single bin in the integration axis, yielding

C_i^{\mathrm{rebin}} = \left. \sum_{j \in \mathcal{F}} Y_{ij} \right/ \sum_{j \in \mathcal{F}} F_{ij}

where F_{ij} = \sum_{kl} f_{kl}, and \mathcal{F} indicates the full integration range.

In order to support rebinning in the non-integration axis, the Integration algorithm first rebins the data into the desired bins in the non-integration axis, and 100 bins in the integration axis and then sums them as:

C_i^{\mathrm{integration}} = \left. N_i \sum_{j \in \mathcal{F}} Y_{ij} w_{ij} \right/ \sum_{j \in \mathcal{F}} F_{ij}

where N_i = \sum_{j \in \mathcal{D}} 1 is the number of j bins at a given i with non-zero fraction (e.g. if the integration contains only regions with data then N_i = 100, otherwise N_i will be less), and w_{ij} is the width along the jth axis of the (i,j)th bin. The N_i normalisation is needed because in the limiting case where all the fractions F_{ij} are unity, the denominator would be N_i, so we recover the usual expression for integrating over a distribution. Note that as previously, \mathcal{D} indicates the region within the integration range with data (in this case equivalent to regions with non-zero fractions).

Like with the PSD case there is thus an i dependent scaling factor N_i w (assuming all the bins have the same width) between Cuts computed using the Rebin or Integration algorithm. This scaling factor is a constant if the integration range includes only regions with data (e.g. \mathcal{D} \equiv \mathcal{F}), but will not be constant if the integration overlaps regions without data.

The difference is illustrated below:

_images/rebin_cuts.png

The cuts have been normalised to the peak intensity so that the constant scaling factor between the two algorithms factorises out. In the top cut, integrating over 6 \leq |Q| < 8 \mathrm{\AA}^{-1} there are no regions without data so the two cuts are equivalent except for a constant scaling factor. In the bottom cut, integrating over 8 \leq |Q| < 10 \mathrm{\AA}^{-1} there is a large region with no data, so now cuts from the two techniques differ markedly. At E<0 meV Where the data covers the full integration range, we have N_i = 100 and the two cuts are equivalent. As E increases, N_i decreases until at around 20 meV, it is N_i = 50, and we see that at that point the (normalised) Integration cut is half the intensity of the (normalised) Rebin cut.

5.5. A note on units

One advantage of inelastic neutron scattering over other techniques is that it is (relatively) easy to normalise the measured data to absolute units. At the ISIS Neutron and Muon Source if this normalisation is done, then the signal will be in units of [milibarns per steradian per meV per formula unit] or [mb/sr/meV/f.u.].

An Integration over energy would then yield a differential cross-section in [mb/sr/f.u.], whereas a Rebin over energy would leave the units unchanged at [mb/sr/meV/f.u.].

However, an Integration over |Q| instead of energy will yield units of [mb/Å/sr/meV/f.u.] rather [mb/meV/f.u.] and as such it may be more useful to perform an average Rebin which will leave the units unchanged.

Unfortunately, the input files read by MSlice do not indicate if the signal values saved are in absolute units or not, so MSlice cannot automatically display the correct units on plots - this is left to the user.

5.6. A note on the regions of validity of the two algorithms

As can be seen in the example above, the Integration cut algorithm will produce low signals where there is less data, whereas the Rebin cut algorithm will amplify the signals in such regions. In effect, it assumes that the signal is constant across the integration range and can be extrapolated over regions without data (so the only manifestation of the lack of data are larger errorbars associated with these bins).

This assumption may be valid for density-of-states (DOS) type cuts where one would expect that the signal is approximately constant over |Q| and only varies in energy. Thus for these applications, it may be suitable to chose the Rebin algorithm, and to extrapolate the high-energy, high-|Q| regions which are kinematically inaccessible.

Conversely, for integration over energy - for example over the elastic line to compute a differential cross-section or over a finite energy crystal field excitation to obtain a magnetic cross-section, the Integration algorithm should be chosen else the signal in the cut will vary with the integration range and would not be a cross-section.