Quick Start: Example Time of Flight (ToF) Analysis#

Loading Time-of-Flight Data#

Loading Dialog WIndow with Time-of-Flight Dataset Loaded (Light) Loading Dialog WIndow with Time-of-Flight Dataset Loaded (Dark)

Minimal Files Required For ToF Quick Start Guide#

  • Sample: Typical sample file formats to expect here are .fits and .tif. We also accept .nxs files, however the loading steps are different from those below. See the (loading_nexus - ADD LINK LATER) for more information on loading Nexus files.

  • Open Beam: This is typically a file that has been collected with no sample in the beam path. This is used to normalise the sample data to the open beam - load either a Flat Before or Flat After file.

  • Sample / Spectra Log: For a ToF dataset, this is typically a file that contains the time of flight information for each pixel in the image stack. This is used to map the time of flight data to the image stack.

  • Sample Shutter Counts: This is typically a file that contains the number of counts for each pixel in the image stack when the sample shutter is open. This is used to normalise the sample data to the sample shutter counts.

  • Open Beam Shutter Counts (Flat Before Shutter Counts or Flat After Shutter Counts): Contains the number of counts for each pixel in the related image stack. This is used to normalise the sample data to the open beam shutter counts. It’s important to select the relevant stack based on whether you loaded a Flat Before or Flat After above.

Spectrum Viewer#

Spectrum Viewer Window (Light) Spectrum Viewer Window (Dark)

The spectrum viewer is a tool that allows you to view spectrum data within a Time of flight (TOF) image stack. To open the spectrum viewer go to Workflow > Spectrum Viewer.

Export Spectrum Data:

  1. Resize the ROI to just cover the size of the sample within your data or a particular area of interest within your sample. This will allow you to see the spectrum within the ROI which you will be able to see in the spectrum line plot at the bottom of the window.

  2. Click the Add button on the left to add another ROI which you can position over a particular detail of your choosing on the sample.

  3. Within the ROI Table, double click roi_1 to rename to something more descriptive of what the ROI is covering.

  4. To remove an ROI, you can select the ROI you would like to remove within the ROI Table and click the Remove button on the left.

  5. The location and size of ROIs can be finely tuned using the Roi Properties table below the table of ROIs. The Roi Properties will show the coordinates of the currently selected ROI in the tabel of ROIs.

  6. To export spectrum data, you can click the Export spectrum button and select a location and filename. Two files will be saved to this location <filename>.csv and <filename>_roi_coords.csv. <filename>.csv contains the spectrum data for each ROI. <filename>_roi_coords.csv contains the coordinates of the ROIs in the image stack.

  7. If you have a TOF dataset loaded where you would like to normalise to the open beam, you can do so by toggling the Normalise to open beam checkbox. This will normalise the spectrum to the open beam spectrum. The greyed out drop down menu will become available and you can select which dataset you would like to use as the open beam.

  8. If you have loaded Shutter Count files for your sample and Flat Before Shutter Counts or Flat After Shutter Counts (dependent on if you loaded a Flat Before or Flat After image stack), you can also apply Shutter Count Correction by clicking on the checkbox. Applying shutter count correction will autoscale the normalised sample against the open beam to acheive more accurate results where counts across stacks differ from one another. The greyed out toggle box will become togglable once Normalise to open beam has been toggled to true with a valid open beam dataset selected from the drop-down menu.

  9. You can also modify the Flight path and an Time delay specific to your instrument data under the Time of Flight Poperties section at the bottom of the left hand side of the window. The Flight path is the distance from the sample to the detector in metres. The Time delay is the time delay in microseconds between the start of the ToF measurement and the start of the data acquisition. This is typically used to account for any delays in the data acquisition system.

Export Single or Binned Spectrum Data in RITS Format

  1. To enter IMAGE mode to export single or binned spectrum data in RITS format, you can click the IMAGE tab at the top of the table of ROIs.

  2. Resize the ROI in the same way as before for exporting regular spectrum data to cover an area of the sample you would like to acquire the spectrum for.

  3. Select the output mode from the top drop down menu on the left which replaces the table of ROIs, either Single Spectrum or 2D Binned depending on what you would like to export. 2D binned will bin within the ROI and export the binned data as multi-spectrum data.

    1. If you choose to export as a 2D Binned you can choose the size of your bin in pixels squared from the drop down menu on the left. You can also select the step size of the bin from the drop down menu. If the step size if the same as the bin size, the binned data will be non-overlapping tiled binning. If the step size is smaller than the bin size, the binned data will be overlapping which will achieve a rolling average.

  4. Choose between Propagated and Standard Deviation from the Error Mode drop down box. Propagated will calculate the error from the propagated error of the counts in the spectrum. Standard Deviation will calculate the error from the standard deviation of the counts in the spectrum. The mode you choose will depend on the data you are working with. Optionally, you could export to both modes separately to compare the results.

Spectrum Viewer Window (Light) Spectrum Viewer Window (Dark)

Changing Units

  1. You can change the units of the spectrum data by right clicking on any spectrum plot within the Spectrum Viewer and selecting Units. Available units to convert to are:

  • Image Index: The index of the pixel in the image stack.

  • Wavelength: The wavelength of the neutrons in Angstroms (Selected by default).

  • Energy: The energy of the neutrons in meV.

  • Time of Flight (μs): The time of flight of the neutrons in microseconds.

Spectrum Viewer Unit Conversion in ROI Mode

Fitting

  1. Select the Fitting tab at the top of the Spectrum Viewer window to open the fitting interface. The fitting interface allows you to fit a function to the spectrum data for a selected ROI. The available fitting functions are:

  • Error function: A simple error function model.

  • Santisteban: A Santisteban model, which is a common model used in neutron scattering.

  1. Clicking the From ROI button will create an initial guess and fitting parameters based on the data in the selected ROI. This will populate the fitting parameters table with initial values for the fitting function. The inital fit will be plotted on the spectrum plot for the selected ROI. This initial guess is based on the data in the selected ROI and will be used as a starting point for your selected fitting algorithm.

  2. Clicking the Run fit button will run the fitting algorithm on the selected ROI data using the initial fitting parameters generated by From ROI. The fitted function will be overlayed on the spectrum plot for the selected ROI, allowing you to visually assess the fit.

  3. You can then adjust the initial fitting parameters in the table at the bottom left-hand side of the view to refine the fit further. The fitting parameters table allows you to adjust the following parameters:

Santisteban Fit Example

  • Error Function Parameters

    Error Function (Light) Error Function (Dark)
  • Santisteban Parameters

    Santisteban (Light) Santisteban (Dark)

Error Function Parameters

Santisteban Parameters

  • mu: The mean of the fitting function.

  • sigma: The standard deviation of the fitting function.

  • h: The height or the function or distance from min(func) to max(func).

  • a: The vertical offset of the function, i.e. the value of the bottom of the ROI.

  • t_hkl: The time of flight for the hkl reflection.

  • sigma: The standard deviation of the fitting function.

  • tau: The time constant of the fitting function.

  • h: The height or the function or distance from min(func) to max(func).

  • a: The vertical offset of the function, i.e. the value of the bottom of the ROI.

  • a_0: The baseline transmission i.e. the transmission value before the Bragg edge (high-wavelength side).

  • b_0: The overall baseline transmission (background level), similar to (a_0) in the single-edge case.

  • a_hkl and b_hkl: Describes the jump in the cross-section sigma_hkl.

For more information on the Santisteban fitting function, see the paper Time-of-flight Neutron Transmission Diffraction .

As of now, the fitting interface is still under development and will be improved in future releases. If you have any feedback on the fitting interface, please do get in touch with us via our support email which can be found on our GitHub repository :code`README`.