fitplugin  Bumps plugin definition for reflectivity models¶
Align the sample profiles and compute the residual difference from the measured reflectivity for a set of points. 

Plot the aligned profiles and the distribution of the residuals for profiles and residuals returned from calc_errors. 
Reflectivity plugin for fitting GUI.
Note that the fitting infrastructure is still heavily tied to the reflectivity modeling program, and this represents only the first tiny steps to separating the two.
 refl1d.fitplugin.calc_errors(problem, points)[source]¶
Align the sample profiles and compute the residual difference from the measured reflectivity for a set of points.
The points should be sampled from the posterior probability distribution computed from MCMC, bootstrapping or sampled from the error ellipse calculated at the minimum.
Each of the returned arguments is a dictionary mapping model number to error sample data as follows:
Returns (profiles, slabs, Q, residuals).
profiles
Arrays of (z, rho, irho) for nonmagnetic models or arrays of (z, rho, irho, rhoM, thetaM) for magnetic models. There will be one set of arrays returned per error sample.
slabs
Array of slab thickness for the layers in the models. There will be one array returned per error sample. Using slab thickness, profiles can be aligned on interface boundaries and layer centers.
Q
Array of Q values for the data points in the model. The data points are the same for all error samples, so only one Q array is needed per model.
residuals
Array of (theorydata)/uncertainty for each data point in the measurement. There will be one array returned per error sample.
 refl1d.fitplugin.show_errors(errors, contours=(68, 95), npoints=200, align='auto', plots=1, save=None)[source]¶
Plot the aligned profiles and the distribution of the residuals for profiles and residuals returned from calc_errors.
contours can be a list of percentiles or []. If percentiles are given, then show uncertainty using a contour plot with the given levels, otherwise just overplot sample lines. contours defaults to [68, 95, 100].
npoints is the number of points to use when generating the profile contour. Since the z values for the various lines do not correspond, the contour generator interpolates the entire profile range with linear spacing using this number of points.
align is the interface number plus fractional distance within the layer following the interface. For example, use 0 for the substrate interface, use 1 for the surface interface, or use 2.5 for the center of the second slab above the substrate. If align=’auto’ then choose an offset that minimizes the crosscorrelation between the first profile and the current profile.
plots is the number of plots to use (1, 2, or ‘n’).
save is the basename of the plot to save. This should usually be “<store>/<model>”. The program will add ‘err#.png’ where ‘#’ is the number of the plot.