README.md 2.42 KB
Newer Older
Ronneburg, Arne's avatar
Ronneburg, Arne committed
1
# NR_analysis 
Ronneburg, Arne's avatar
Ronneburg, Arne committed
2

Ronneburg, Arne's avatar
Ronneburg, Arne committed
3
4
5
6
7
8
9
This repo deals with the evaluation of neutron reflectometry data.

Based on a set of parameters and a defined layer model the reflectivity of the simulated Scattering length density (SLD) profile is calculated (using an algorithm implemented in the refnx-package by Andrew Nelson - check Abeles_Anelson.py). A global optimization algorithm (differential evolution) is used to improve the set of coefficients and reduce the residuum of the theoretical reflectivity curve and the measured data.

Unfortunately, several different SLD-profiles can match exactly the same reflectivity curve, so additional information are necessary to find the "right" profile. Such information always depend on the investigated system, and may involve the prediction of the SLD based on electrochemical measurements or other knowledge about the systems behavior. But also other knowledege, such as the continuity of the SLD-profiles, are used (since this script is made for operando measurements - the timescale of the changes within the system is much larger than the measurement timescale).
In order to find the final solution, a distributed cluster is created. This consists of two parts:
The client_side.py is started on a remote computer and finds the optimized parameters for one dataset (under given parameters, such as the neighbouring coefficients). The result is send back to the main computer (currently used file: Emre_fitting_CV1_cycles_distrib_cluster.py). Here the results are saved, and used for the subsequent set of calculations. In this way, an iterative steps are taken towards the optimization of the overall SLD-map, which is also the reason for the distributed cluster. 
Ronneburg, Arne's avatar
Ronneburg, Arne committed
10
Emre_plotting_data.py is used to analyze the results. Ref_sliced_V3.py is used to check wether the calculated reflectivity is valid also in the case of very rough layers (here a micro-slicing of the profiles is done, and the associated reflectivty is calculated). auxillaryV11.py contains useful functions, e.g. calculate the SLD-profile based on a given set of parameters). diffevopar_mod4c.py is an adaptation of A.Nelsons version of the differential_evolution algorithm (he implemented changes which enable multicore evaluation of the parameter set), which enables the use of a known good solution during the optimization. initiate_population.py creates an inital population for the optimization. Finally, motofit_ersatz_plain.py can be used to fit a single reflectivity pattern.