Reflectivity Algorithms Toolbox (RAT) is a toolbox for analysing neutron reflectivity data at multiple contrasts. It has been designed as the calculation engine for the upcoming RasCAL-2, which will supersede the reflectivity software RasCAL.
It is designed to be flexible, allowing analysis using traditional layer models, but also using user-defined custom models, which can be parameterised by the user however they wish (either as an array of layers, or a continuous SLD profile). It is also incredibly fast; the core algorithm code is native C++, created from the MATLAB source code using MATLAB Coder.
By separating the GUI from the toolbox, users can create and run a full analysis from a script, which can be written in either our MATLAB or Python API. This means that the reflectivity analysis can be integrated alongside other analysis tools written in MATLAB or Python, and this analysis script can be provided alongside publications to ensure reproducible data.
RAT contains a number of improvements over legacy RasCAL, including:
Automatic parallelisation (MPI) either over contrasts or points using a simple flag
Advanced interface microslicing using adaptive resampling
Option to write custom models in MATLAB, Python or C++
Custom models for background and resolution functions (not yet functional)
Fast Bayesian analysis using DREAM or the external Paramonte Sampler
Parallel Bayes using Paramonte via ‘mpiexcec’
An integrated Nested sampler for Bayesian model selection
Fully validated against ORSO examples
Ability to load and run RasCAL-1 projects (usually) without modification
Plotting routines for easy visualisation of data and fits
and more!
Getting started with RAT
Follow these guides to get started:
Installation: Learn how to install RAT.
User Guide: Learn the core principles of RAT with code snippets.
Examples: Jump into some practical examples.
Go deeper into RAT
Learn more by diving into the RAT reference:
MATLAB API Reference: Detailed information about all of RAT’s MATLAB API.
Get more help
The easiest way to get help with the project is to start discussions or open an issue on Github.