SasView Tutorials
Title of Tutorial
www.sasview.org
Preamble
SasView was originally developed by the University of Tennessee as part of the Distributed Data Analysis of Neutron Scattering Experiments (DANSE) project funded by the US National Science Foundation (NSF), but is currently being developed as an Open Source project hosted on GitHub and managed by a consortium of scattering facilities. Participating facilities include (in alphabetical order): the Australian National Science & Technology Centre for Neutron Scattering, the Diamond Light Source, the European Spallation Source, Federal Institute for Materials Research and Testing, the Institut Laue Langevin, the ISIS Pulsed Neutron & Muon Source, the National Institute of Standards & Technology Center for Neutron Research, the Oak Ridge National Laboratory Neutron Sciences Directorate, and the Technical University Delft Reactor Institute.
SasView is distributed under a 'Three-clause' BSD licence which you may read here:
https://github.com/SasView/sasview/blob/master/LICENSE.TXT
SasView is free to download and use, including for commercial purposes.
© 2009-2021 UMD, UTK, NIST, ORNL, ISIS, ESS, ANSTO, ILL, TUD, DLS, BAM
If you make use of SasView
If you use SasView to do productive scientific research that leads to a publication, we ask that you acknowledge use of the program with the following text:
This work benefited from the use of the SasView application, originally developed under NSF Award DMR-0520547. SasView also contains code developed with funding from the EU Horizon 2020 programme under the SINE2020 project Grant No 654000.
Contributors to this Tutorial
Author Name (author.name@email.address)
Revisions
Last revised: 31 Dec 2021
Learning Objective
This tutorial will ...
Running SasView
Windows
Either select SasView from ‘Start’ > ‘All Programs’ or, if you asked the installer to create one, double-click on the SasView desktop icon.
Mac OS
Go in to your ‘Applications’ folder and select SasView.
(Also see the Appendix)
SasView should start and present you with a screen something like this (there will be small differences between Windows and Mac OS versions of the program):
4
3
2
1
A Quick Tour of the SasView GUI
There are five elements to the initial SasView screen:
A Menu Bar
A Data Explorer panel
A Fit Page
The Log Explorer
We shall now look at each of these in turn. You may wish to follow the remainder of this document with an instance of SasView running so that you can activate menus and buttons.
Menu Bar
As in many other applications the Menu Bar gives access to features of the program.
File
Here you can load one of more individual data files, or an entire folder of data files into SasView. You can also save a current analysis or entire SasView session to file and then re-load them.
Edit
Here you can copy/paste analysis parameters between analysis pages - useful when configuring multiple Fit Pages for, say, simultaneous fitting – or export the parameters to file.
If an analysis has been performed Report Results will prepare a report that can be saved/printed.
Calculated models can be frozen – copied as datasets for further operations.
View
Here you can hide/show the Toolbar and the Data Explorer and the Log Explorer.
Tools
Here you will find a collection of various utilities:
Data Operation
Allows you to add, subtract, multiply, divide, or append two separate datasets.
SLD Calculator
Calculates the neutron scattering length densities and electron densities of a given chemical formula.
Density/Volume Calculator
Converts between the molar volume and mass density of a given chemical formula.
Slit Size Calculator
Calculates the slit length for smearing purposes (as half the FWHM) from a SAXS beam profile.
Note: this tool has only been validated for Anton-Paar SAXSess beam profile data.
Kiessig Thickness Calculator
Calculates the Kiessig thickness from the Q-value of a fringe in a reflectivity profile, or the d-spacing from the Q-value of a peak in SAXS/SANS data, as 2π/Q.
Q Resolution Estimator
Estimates the Q-resolution of SAXS/SANS data from given instrumental parameter values, assuming that the detector is flat and normal to the incident beam.
Generic Scattering Calculator
Attempts to simulate the SANS expected from a specified shape/structure or scattering length density profile. The tool can handle both the nuclear and magnetic contributions to the scattering.
Python Shell/Editor
Opens a Python 3.6 shell and editor; useful for editing and testing plug-in fitting models.
Image Viewer
This tool loads and displays 2D SAS image data as X-Y pixel coordinates versus whatever the ‘intensity’ value is per pixel). The supported input image formats are: BMP (bitmap format), GIF (graphical interchange format), JPG (joint photographic experts group format), PNG (portable network graphics format), and TIF (tagged image format).
The displayed 2D plot can then can be copied, printed, or re-saved as any of the above formats or as PS (postscript), EPS (encapsulated postscript), PDF (portable document format), RAW/RGBA (raw rgba bitmap), or SVG (scaleable vector graphics).
If the min/max Q limits of the X-Y axes are known this tool will also convert the image to pseudo-data, for example, for 2D fitting or further manipulation.
Analysis
Here you can also select the type of analysis you wish to perform:
Fitting
Performs optimised model-fitting on one of more datasets, with or without constraints, polydispersity or orientation distributions, or resolution smearing.
Pr Inversion
Calculates the distance distribution function – or ‘P(r) curve’ - for a dataset.
Invariant
Calculates the Porod Invariant (sometimes denoted as Q*) - or ‘Total Scattering’ - for a dataset.
Correlation Function
Calculates the 1D density correlation function for a dataset.
If the data is from a sample that can be described by idealised lamellar morphology this analysis will also attempt to extract some morphological information from the correlation function; eg, lamellar spacing, crystallinity, etc.
Fitting
Provides access to advanced model-fitting options.
Here you can set up parameter constraints between Fit Pages or simultaneous fits, change the default fitting optimiser used by SasView, test/enable/disable fitting computations using OpenCL (a means of speeding up some complex fits by taking advantage of any high-performance graphics card processor installed in your computer), and create/manipulate/delete plug-in fitting models.
You can also re-organise the library of fitting models to your own preference using the Category Manager.
Window
Here you can switch between, and arrange, the various SasView windows that are in use.
You can also minimize and/or close all open SasView plots.
Help
Here you can access the extensive SasView help Documentation and these Tutorials.
You can also check to see if there is a more recent release of SasView, or browse the Model Marketplace to look for additional fitting models (these options will require an internet connection).
Data Explorer
From the Data Explorer panel you can load data into SasView, plot it and delete it, and choose which type of analysis you wish to perform on the data.
There are two types of data in SasView: data that has been loaded in, and fitting model calculations made by SasView itself. Snapshots of the latter appear as ‘Theory’ datasets in the Data Explorer Theory tab.
The Data Explorer is also where you can decide whether to fit one dataset interactively or have SasView fit multiple datasets automatically (‘Batch Mode’).
Fit Page
A Fit Page is the functional hub of SasView, and you can have as many as you have datasets to fit!
The Fit Page is where you select the model – formally the form factor, P(Q) – you wish to fit to the data and, if applicable, where you can also choose to include a structure factor, S(Q), contribution.
If the chosen model has parameters that are allowed to be polydisperse (ie, have a distribution of values about a mean value), and/or that requires orientation angles to describe scattering from aligned objects, these can all be set from the Fit Page.
The Fit page is also where you can instruct SasView about how it should take account of ‘Instrumental Smearing’ (uncertainties on the Q values), ‘Weighting’ (uncertainties on the intensity values), the Q-range over which to fit the data (since it may be advantageous to exclude the extreme low-Q or extreme high-Q), how many datapoints to use in the fitting model calculation, and whether these datapoints should be equally spaced in Q (default) or logarithmically distributed (often useful for highlighting features at low-Q).
Fits are initiated by clicking the Fit button. But the Fit Page can be used in a simulation mode when no data has been loaded by selecting a model and some parameters and clicking the Calculate button.
Log Explorer
The Log Explorer provides access to a chronological history of (in increasing order of severity) information, warning, and error messages output by the SasView program. It is used to report selected information directly to the SasView GUI in real time; for example, whether or not a fit is in progress and how long until it completes, or whether a fit completed successfully or the fitting optimiser failed to converge on a satisfactory solution.
The SasView Log File
SasView also creates/appends to a log file whenever the program is used. Whilst the information it contains may not always be straightforward to understand, if you are having serious problems with the program it would be a good idea to attach this file to any request for help from the SasView Development Team!
The log file is located in your user account ‘home’ folder, so on:
Windows
C:\Users\{your_userid}\sasview.log
Mac OS and Linux
~/sasview.log
Further Information
For further information, please consult the
SasView Tutorial Series
or
http://www.sasview.org
or email
help@sasview.org
1/8