diff --git a/CHANGELOG b/CHANGELOG
index a39c2dc3cf3ddbb02711ae82d7e893a91faf34d4..35da0dcc9c9618e0b635ed0ef7235dda59c1c4d5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,54 @@
-> API changes:
-     1) Python: major changes in SpecularSimulation interface. Please consult web-documentation for details.
-     2) GUI: project compatibility with previous versions is broken.
+BornAgain-1.16.0, released 2019.07.31
+  > API changes:
+    1) Python: major changes in SpecularSimulation interface. Please consult web-documentation for details.
+    2) GUI: project compatibility with previous versions is broken.
+  > Summary:
+    1) Hadnling intensity uncertainties in experimental data
+    2) Support for arbitrary resolutions in reflectometry
+    3) SLD/refractive index profiles across sample layers
+    4) Importing reflectometry data as Qz-Intensity by default
+    5) Various bug fixes
+
+  * Bug #2306: Weird intensity results in DepthProbeSimulation
+  * Bug #2310: GUI: disappeared button to rotate dataset in RealDataView
+  * Bug #2312: GUI crash on attempt to save a project on Mac
+  * Bug #2321: Setting 'Min' or 'Max' for fitparameter Beam Intensity doesn't work
+  * Bug #2322: GUI: Ensure usage of identical colormap for real data and simulation in fitview
+  * Bug #2324: Save to TIFF is broken
+  * Bug #2328: Crashing during GISAS fitting
+  * Bug #2329: OffSpecSimulation does not work with rectangular detector
+  * Bug #2330: "Save" fails when there are Cyrillic characters on the path.
+  * Bug #2337: Layout weights are not exported to Python from GUI
+  * Bug #2338: Numerical instability in roughness calculations
+  * Bug #2342: Unit test failure on user system with Qt 5.6.2
+  * Bug #2344: GUI: impossible to set limits for intensity as a fit parameter
+  * Bug #2370: Crash on reflectometry simulation for nonsensible values of theta
+  * Bug #2371: Ctrl+S doesn't work for saving project on win
+  * Bug #2379: Layer of zero thickness affects SLD profile
+  * Bug #2382: Memory leakage during Python fitting
+  * Bug #2388: Footprint Correction example failing due to newly introduced accessor methods
+  * Feature #1861: Provide evaluation of SLD profile across the sample layers
+  * Feature #2047: Fix compilation failures if fftw3, libtiff or Python are static.
+  * Feature #2285: Name layers in GUI by their material name
+  * Feature #2311: Provide possibility to load 2D ASCII data for files with .dat extention
+  * Feature #2315: Provide support for pointwise resolution in reflectometry
+  * Feature #2316: Provide support for handling intensity uncertainties in experimental data
+  * Feature #2331: Unit labels
+  * Feature #2333: GUI: Switch resolutions/divergences in specular instrument to the new resolution machinery
+  * Feature #2346: Enable qspace visualisation for large inclinations
+  * Feature #2365: GUI: rename "Import" button to "Data"
+  * Feature #2373: Remove choice between decoupling approximation and SSCA in GUI layouts
+  * Feature #2374: Clean Functionality to Import Typical Reflectometry ASCII Formats
+  * Feature #2377: Implement layer editor prototype on the basis of the the new model-view framework
+  * Documentation #2223: Update BornAgain Windows installation documentation on the webpage.
+  * Documentation #2283: Fix starting value of prism_base_edge in fit example
+  * Documentation #2308: Fix Windows PyCharm tutorial
+  * Documentation #2325: Proofread Windows installation tutorials
+  * Documentation #2381: Examples present on the website and missing on the BA repo 
+  * Refactoring #2361: Use **kwargs in python plotting routines
+  * Testing #2210: Test 1d data import on known file formats
+  * Testing #2287: Reflectometry cross-validation
+  * Envelope task #2192: 1D data import functionality
 
 BornAgain-1.15.0, released 2019.02.25
   > API changes:
diff --git a/Core/Particle/Particle.cpp b/Core/Particle/Particle.cpp
index ddd0191e308ec0677527ef4138f8072e74a3ced0..7ad9883a7cdc1cc84f7b9175323651f63f7e0d8d 100644
--- a/Core/Particle/Particle.cpp
+++ b/Core/Particle/Particle.cpp
@@ -69,6 +69,8 @@ SlicedParticle Particle::createSlicedParticle(ZLimits limits) const
         P_rotation.reset(mP_rotation->clone());
     std::unique_ptr<IFormFactor> P_temp_ff(
                 mP_form_factor->createSlicedFormFactor(limits, *P_rotation, m_position));
+    if (!P_temp_ff)
+        return {};
     std::unique_ptr<FormFactorDecoratorMaterial> P_ff(new FormFactorDecoratorMaterial(*P_temp_ff));
     double volume = P_temp_ff->volume();
     Material transformed_material(
diff --git a/Core/Particle/ParticleCoreShell.cpp b/Core/Particle/ParticleCoreShell.cpp
index 01c24ce0e78fff3765862035378d75bf9255af07..e5efd5fd197435badbfb7233cb5bc87ca0ae31e4 100644
--- a/Core/Particle/ParticleCoreShell.cpp
+++ b/Core/Particle/ParticleCoreShell.cpp
@@ -53,8 +53,6 @@ SlicedParticle ParticleCoreShell::createSlicedParticle(ZLimits limits) const
     P_core->rotate(*P_rotation);
     P_core->translate(m_position);
     auto sliced_core = P_core->createSlicedParticle(limits);
-    if (!sliced_core.mP_slicedff || sliced_core.m_regions.size()!=1)
-        return {};
 
     // shell
     std::unique_ptr<Particle> P_shell(mp_shell->clone());
@@ -64,6 +62,14 @@ SlicedParticle ParticleCoreShell::createSlicedParticle(ZLimits limits) const
     if (!sliced_shell.mP_slicedff)
         return {};
 
+    SlicedParticle result;
+    // if core out of limits, return sliced shell
+    if (!sliced_core.mP_slicedff) {
+        result.mP_slicedff.reset(sliced_shell.mP_slicedff.release());
+        result.m_regions.push_back(sliced_shell.m_regions.back());
+        return result;
+    }
+
     // set core ambient material
     if (sliced_shell.m_regions.size()!=1)
         return {};
@@ -71,7 +77,6 @@ SlicedParticle ParticleCoreShell::createSlicedParticle(ZLimits limits) const
     sliced_core.mP_slicedff->setAmbientMaterial(shell_material);
 
     // construct sliced particle
-    SlicedParticle result;
     sliced_shell.m_regions.back().m_volume -= sliced_core.m_regions.back().m_volume;
     result.mP_slicedff.reset(new FormFactorCoreShell(sliced_core.mP_slicedff.release(),
                                                      sliced_shell.mP_slicedff.release()));
diff --git a/Core/Scattering/IFormFactor.cpp b/Core/Scattering/IFormFactor.cpp
index 5d8723f467dcb85a9511a87618c3bdd36b4b5467..e904de763ed58bf491f8fb1e491f04d7f94eb70a 100644
--- a/Core/Scattering/IFormFactor.cpp
+++ b/Core/Scattering/IFormFactor.cpp
@@ -25,6 +25,8 @@
 namespace {
 bool ShapeIsContainedInLimits(const IFormFactor& formfactor, ZLimits limits,
                               const IRotation& rot, kvector_t translation);
+bool ShapeOutsideLimits(const IFormFactor& formfactor, ZLimits limits,
+                        const IRotation& rot, kvector_t translation);
 }
 
 IFormFactor::~IFormFactor() {}
@@ -34,6 +36,8 @@ IFormFactor* IFormFactor::createSlicedFormFactor(ZLimits limits, const IRotation
 {
     if (ShapeIsContainedInLimits(*this, limits, rot, translation))
         return CreateTransformedFormFactor(*this, rot, translation);
+    if (ShapeOutsideLimits(*this, limits, rot, translation))
+        return nullptr;
     if (canSliceAnalytically(rot))
         return sliceFormFactor(limits, rot, translation);
     throw std::runtime_error(getName() + "::createSlicedFormFactor error: not supported for "
@@ -96,4 +100,17 @@ bool ShapeIsContainedInLimits(const IFormFactor& formfactor, ZLimits limits,
         return false;
     return true;
 }
+bool ShapeOutsideLimits(const IFormFactor& formfactor, ZLimits limits,
+                        const IRotation& rot, kvector_t translation)
+{
+    double zbottom = formfactor.bottomZ(rot) + translation.z();
+    double ztop = formfactor.topZ(rot) + translation.z();
+    OneSidedLimit lower_limit = limits.lowerLimit();
+    OneSidedLimit upper_limit = limits.upperLimit();
+    if (!upper_limit.m_limitless && zbottom >= upper_limit.m_value)
+        return true;
+    if (!lower_limit.m_limitless && ztop <= lower_limit.m_value)
+        return true;
+    return false;
+}
 }
diff --git a/Doc/Doxygen/Doxyfile b/Doc/Doxygen/Doxyfile
index ae8b57cd8a512c9e5973501af8d33abf2754c9ba..2d00a79a9a0efa197652e0f476079ef43bb31f15 100644
--- a/Doc/Doxygen/Doxyfile
+++ b/Doc/Doxygen/Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME           = "BornAgain"
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER         = 1.15.99
+PROJECT_NUMBER         = 1.16.0
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a
diff --git a/Examples/python/simulation/ex06_Reflectometry/FootprintCorrection.py b/Examples/python/simulation/ex06_Reflectometry/FootprintCorrection.py
index 553354c8d15df0e3b6236083c1b82b6033f84d8f..8cf816685870090a3dbb912edfd11025a81e90c0 100644
--- a/Examples/python/simulation/ex06_Reflectometry/FootprintCorrection.py
+++ b/Examples/python/simulation/ex06_Reflectometry/FootprintCorrection.py
@@ -58,10 +58,7 @@ def run_simulation(simulation):
 
 
 def get_plot_data(sim_result):
-    data = sim_result.data()
-    intensity = data.getArray()
-    x_axis = data.getAxis(0).getBinCenters()
-    return x_axis, intensity
+    return sim_result.axis(), sim_result.array()
 
 
 def plot(sim_result_1, sim_result_2):
diff --git a/GUI/coregui/CMakeLists.txt b/GUI/coregui/CMakeLists.txt
index c770b293322b2f54788227a1b64449282284f124..62899ff3d6312d55f068b677b1f901f130ecd157 100644
--- a/GUI/coregui/CMakeLists.txt
+++ b/GUI/coregui/CMakeLists.txt
@@ -144,6 +144,11 @@ if(WIN32)
     ${QTDIR}/plugins/imageformats/qsvg.dll
     DESTINATION bin/imageformats COMPONENT Libraries)
 
+    install(FILES
+    ${QTDIR}/bin/libEGL.dll
+    ${QTDIR}/bin/libGLESv2.dll
+    DESTINATION ${destination_lib} COMPONENT Libraries)
+
     set(QT_VISTA_STYLE "${QTDIR}/plugins/styles/qwindowsvistastyle.dll")
     if(EXISTS "${QT_VISTA_STYLE}")
         install(FILES
diff --git a/VERSION.cmake b/VERSION.cmake
index fd5e4db2d9a8e5f17a8d984bebf3dea589180b25..aa80bfa961889b98ae167fa4bee8a1e9f260a09c 100644
--- a/VERSION.cmake
+++ b/VERSION.cmake
@@ -1,3 +1,3 @@
 set(BornAgain_VERSION_MAJOR 1)
-set(BornAgain_VERSION_MINOR 15)
-set(BornAgain_VERSION_PATCH 99)
+set(BornAgain_VERSION_MINOR 16)
+set(BornAgain_VERSION_PATCH 0)
diff --git a/auto/Wrap/doxygen_core.i b/auto/Wrap/doxygen_core.i
index d6d1321808f76fb7e8e55c69d6baa94c8cdeb531..815783d628e54388bd9fa488fe5c7f28f482c506 100644
--- a/auto/Wrap/doxygen_core.i
+++ b/auto/Wrap/doxygen_core.i
@@ -171,6 +171,12 @@ C++ includes: SimulationResult.h
 ";
 
 
+// File: structArrayUtils_1_1CreateDataImpl_1_1baseClass.xml
+
+
+// File: structArrayUtils_1_1CreateDataImpl_1_1baseClass_3_01std_1_1vector_3_01T_00_01A_01_4_01_4.xml
+
+
 // File: classBaseMaterialImpl.xml
 %feature("docstring") BaseMaterialImpl "";
 
@@ -750,21 +756,21 @@ C++ includes: BoxCompositionBuilder.h
 ";
 
 
-// File: structIntegratorMCMiser_1_1CallBackHolder.xml
-%feature("docstring") IntegratorMCMiser::CallBackHolder "
+// File: structIntegratorReal_1_1CallBackHolder.xml
+%feature("docstring") IntegratorReal::CallBackHolder "
 
 structure holding the object and possible extra parameters
 
-C++ includes: IntegratorMCMiser.h
+C++ includes: IntegratorReal.h
 ";
 
 
-// File: structIntegratorReal_1_1CallBackHolder.xml
-%feature("docstring") IntegratorReal::CallBackHolder "
+// File: structIntegratorMCMiser_1_1CallBackHolder.xml
+%feature("docstring") IntegratorMCMiser::CallBackHolder "
 
 structure holding the object and possible extra parameters
 
-C++ includes: IntegratorReal.h
+C++ includes: IntegratorMCMiser.h
 ";
 
 
@@ -783,6 +789,71 @@ C++ includes: TwoDimLatticeBuilder.h
 ";
 
 
+// File: classChi2Metric.xml
+%feature("docstring") Chi2Metric "
+
+Implementation of the standard  $ \\\\chi^2 $ metric derived from maximum likelihood with Gaussian uncertainties. With default L2 norm corresponds to the formula  \\\\[\\\\chi^2 = \\\\sum \\\\frac{(I - D)^2}{\\\\delta_D^2}\\\\]
+
+C++ includes: ObjectiveMetric.h
+";
+
+%feature("docstring")  Chi2Metric::Chi2Metric "Chi2Metric::Chi2Metric()
+";
+
+%feature("docstring")  Chi2Metric::clone "Chi2Metric * Chi2Metric::clone() const override
+";
+
+%feature("docstring")  Chi2Metric::computeFromArrays "double Chi2Metric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > uncertainties, std::vector< double > weight_factors) const override
+
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors and uncertainties. All arrays involved in the computation must be of the same size.
+
+Parameters:
+-----------
+
+sim_data: 
+array with simulated intensities.
+
+exp_data: 
+array with intensity values obtained from an experiment.
+
+uncertainties: 
+array with experimental data uncertainties.
+
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
+";
+
+%feature("docstring")  Chi2Metric::computeFromArrays "double Chi2Metric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > weight_factors) const override
+
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors. All arrays involved in the computation must be of the same size.
+
+Parameters:
+-----------
+
+sim_data: 
+array with simulated intensities.
+
+exp_data: 
+array with intensity values obtained from an experiment.
+
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
+";
+
+
+// File: classChiModuleWrapper.xml
+%feature("docstring") ChiModuleWrapper "
+
+Metric wrapper for back-compaptibility with old scripts. 
+";
+
+%feature("docstring")  ChiModuleWrapper::ChiModuleWrapper "ChiModuleWrapper::ChiModuleWrapper(std::unique_ptr< IChiSquaredModule > module)
+";
+
+%feature("docstring")  ChiModuleWrapper::compute "double ChiModuleWrapper::compute(const std::vector< SimDataPair > &fit_objects, size_t n_pars) const override
+";
+
+
 // File: classChiSquaredModule.xml
 %feature("docstring") ChiSquaredModule "
 
@@ -1058,6 +1129,10 @@ C++ includes: RipplesBuilder.h
 ";
 
 
+// File: classArrayUtils_1_1CreateDataImpl.xml
+%feature("docstring") ArrayUtils::CreateDataImpl "";
+
+
 // File: classCrystal.xml
 %feature("docstring") Crystal "
 
@@ -1277,13 +1352,6 @@ C++ includes: ParticleDistributionsBuilder.h
 ";
 
 
-// File: classExceptions_1_1DeadReferenceException.xml
-%feature("docstring") Exceptions::DeadReferenceException "";
-
-%feature("docstring")  Exceptions::DeadReferenceException::DeadReferenceException "Exceptions::DeadReferenceException::DeadReferenceException(const std::string &message)
-";
-
-
 // File: classDecouplingApproximationStrategy.xml
 %feature("docstring") DecouplingApproximationStrategy "
 
@@ -1336,7 +1404,7 @@ C++ includes: DepthProbeComputation.h
 // File: classDepthProbeComputationTerm.xml
 %feature("docstring") DepthProbeComputationTerm "";
 
-%feature("docstring")  DepthProbeComputationTerm::DepthProbeComputationTerm "DepthProbeComputationTerm::DepthProbeComputationTerm(const MultiLayer *p_multi_layer, const IFresnelMap *p_fresnel_map)
+%feature("docstring")  DepthProbeComputationTerm::DepthProbeComputationTerm "DepthProbeComputationTerm::DepthProbeComputationTerm(const ProcessedSample *p_sample)
 ";
 
 %feature("docstring")  DepthProbeComputationTerm::~DepthProbeComputationTerm "DepthProbeComputationTerm::~DepthProbeComputationTerm()
@@ -1446,9 +1514,6 @@ Set calculation flag (if it's false, zero intensity is assigned to the element)
 Calls the  INodeVisitor's visit method. 
 ";
 
-%feature("docstring")  DepthProbeSimulation::numberOfSimulationElements "size_t DepthProbeSimulation::numberOfSimulationElements() const override
-";
-
 %feature("docstring")  DepthProbeSimulation::result "SimulationResult DepthProbeSimulation::result() const override
 
 Returns the results of the simulation in a format that supports unit conversion and export to numpy arrays 
@@ -1474,6 +1539,11 @@ Returns a pointer to incident angle axis.
 Returns a pointer to z-position axis. 
 ";
 
+%feature("docstring")  DepthProbeSimulation::intensityMapSize "size_t DepthProbeSimulation::intensityMapSize() const override
+
+Returns the total number of the intensity values in the simulation result. 
+";
+
 %feature("docstring")  DepthProbeSimulation::createUnitConverter "std::unique_ptr< IUnitConverter > DepthProbeSimulation::createUnitConverter() const
 ";
 
@@ -2257,7 +2327,7 @@ C++ includes: TwoDimLatticeBuilder.h
 // File: classFitObjective.xml
 %feature("docstring") FitObjective "
 
-Main class to hold pairs of simulation Holds vector of FitObject's (simulation and real data) to fit
+Holds vector of   SimDataPairs (experimental data and simulation results) for use in fitting.
 
 C++ includes: FitObjective.h
 ";
@@ -2268,27 +2338,61 @@ C++ includes: FitObjective.h
 %feature("docstring")  FitObjective::~FitObjective "FitObjective::~FitObjective()
 ";
 
-%feature("docstring")  FitObjective::addSimulationAndData "void FitObjective::addSimulationAndData(simulation_builder_t builder, const OutputData< double > &data, double weight=1.0)
+%feature("docstring")  FitObjective::addSimulationAndData "void FitObjective::addSimulationAndData(simulation_builder_t builder, const OutputData< double > &data, std::unique_ptr< OutputData< double >> uncertainties, double weight=1.0)
 
 Constructs simulation/data pair for later fit.
 
 Parameters:
 -----------
 
-simulation: 
+builder: 
 simulation builder capable of producing simulations
 
 data: 
-experimental data
+experimental data array
+
+uncertainties: 
+data uncertainties array
 
 weight: 
-weight of dataset in chi2 calculations 
+weight of dataset in metric calculations 
 ";
 
-%feature("docstring")  FitObjective::addSimulationAndData "void FitObjective::addSimulationAndData(PyBuilderCallback &callback, const std::vector< double > &data, double weight=1.0)
+%feature("docstring")  FitObjective::addSimulationAndData "void FitObjective::addSimulationAndData(PyBuilderCallback &callback, const T &data, double weight=1.0)
+
+Constructs simulation/data pair for later fit.
+
+Parameters:
+-----------
+
+callback: 
+simulation builder capable of producing simulations
+
+data: 
+experimental data array
+
+weight: 
+weight of dataset in metric calculations 
 ";
 
-%feature("docstring")  FitObjective::addSimulationAndData "void FitObjective::addSimulationAndData(PyBuilderCallback &callback, const std::vector< std::vector< double >> &data, double weight=1.0)
+%feature("docstring")  FitObjective::addSimulationAndData "void FitObjective::addSimulationAndData(PyBuilderCallback &callback, const T &data, const T &uncertainties, double weight=1.0)
+
+Constructs simulation/data pair for later fit.
+
+Parameters:
+-----------
+
+callback: 
+simulation builder capable of producing simulations
+
+data: 
+experimental data array
+
+uncertainties: 
+data uncertainties array
+
+weight: 
+weight of dataset in metric calculations 
 ";
 
 %feature("docstring")  FitObjective::evaluate "double FitObjective::evaluate(const Fit::Parameters &params)
@@ -2300,63 +2404,49 @@ weight of dataset in chi2 calculations
 %feature("docstring")  FitObjective::numberOfFitElements "size_t FitObjective::numberOfFitElements() const
 ";
 
-%feature("docstring")  FitObjective::experimental_array "std::vector< double > FitObjective::experimental_array() const
+%feature("docstring")  FitObjective::simulationResult "SimulationResult FitObjective::simulationResult(size_t i_item=0) const
 
-Returns one dimensional array representing experimental data. Masked areas and the area outside of region of interest are not included. Data from different datasets merged together. 
+Returns simulation result in the form of  SimulationResult. 
 ";
 
-%feature("docstring")  FitObjective::simulation_array "std::vector< double > FitObjective::simulation_array() const
+%feature("docstring")  FitObjective::experimentalData "SimulationResult FitObjective::experimentalData(size_t i_item=0) const
 
-Returns one dimensional array representing simulated intensities data. Masked areas and the area outside of region of interest are not included. Data from different datasets merged together. 
+Returns experimental data in the form of  SimulationResult. 
 ";
 
-%feature("docstring")  FitObjective::weights_array "std::vector< double > FitObjective::weights_array() const
+%feature("docstring")  FitObjective::uncertaintyData "SimulationResult FitObjective::uncertaintyData(size_t i_item=0) const
 
-Returns one dimensional array representing weights of bin intensity for residuals. 
+Returns experimental data uncertainties in the form of  SimulationResult. 
 ";
 
-%feature("docstring")  FitObjective::simulationResult "SimulationResult FitObjective::simulationResult(size_t i_item=0) const
-
-Returns simulation result.
-
-Parameters:
------------
+%feature("docstring")  FitObjective::relativeDifference "SimulationResult FitObjective::relativeDifference(size_t i_item=0) const
 
-i_item: 
-the index of fit pair 
+Returns relative difference between simulation and experimental data in the form of  SimulationResult. 
 ";
 
-%feature("docstring")  FitObjective::experimentalData "SimulationResult FitObjective::experimentalData(size_t i_item=0) const
-
-Returns experimental data.
-
-Parameters:
------------
+%feature("docstring")  FitObjective::absoluteDifference "SimulationResult FitObjective::absoluteDifference(size_t i_item=0) const
 
-i_item: 
-the index of fit pair 
+Returns absolute value of difference between simulation and experimental data in the form of  SimulationResult. 
 ";
 
-%feature("docstring")  FitObjective::relativeDifference "SimulationResult FitObjective::relativeDifference(size_t i_item=0) const
+%feature("docstring")  FitObjective::experimental_array "std::vector< double > FitObjective::experimental_array() const
 
-Returns relative difference between simulation and experimental data.
+Returns one dimensional array representing merged experimental data. The area outside of the region of interest is not included, masked data is nullified. 
+";
 
-Parameters:
------------
+%feature("docstring")  FitObjective::simulation_array "std::vector< double > FitObjective::simulation_array() const
 
-i_item: 
-the index of fit pair 
+Returns one dimensional array representing merged simulated intensities data. The area outside of the region of interest is not included, masked data is nullified. 
 ";
 
-%feature("docstring")  FitObjective::absoluteDifference "SimulationResult FitObjective::absoluteDifference(size_t i_item=0) const
+%feature("docstring")  FitObjective::uncertainties "std::vector< double > FitObjective::uncertainties() const
 
-Returns absolute value of difference between simulation and experimental data.
+Returns one-dimensional array representing merged data uncertainties. The area outside of the region of interest is not included, masked data is nullified. 
+";
 
-Parameters:
------------
+%feature("docstring")  FitObjective::weights_array "std::vector< double > FitObjective::weights_array() const
 
-i_item: 
-the index of fit pair 
+Returns one-dimensional array representing merged user weights. The area outside of the region of interest is not included, masked data is nullified. 
 ";
 
 %feature("docstring")  FitObjective::initPrint "void FitObjective::initPrint(int every_nth)
@@ -2370,7 +2460,7 @@ every_nth:
 Print every n'th iteration. 
 ";
 
-%feature("docstring")  FitObjective::initPlot "void FitObjective::initPlot(int every_nth, fit_observer_t observer)
+%feature("docstring")  FitObjective::initPlot "void FitObjective::initPlot(int every_nth, PyObserverCallback &callback)
 
 Initializes plotting during the fitting using Python callable.
 
@@ -2381,12 +2471,6 @@ every_nth:
 Called on every n'th iteration. 
 ";
 
-%feature("docstring")  FitObjective::initPlot "void FitObjective::initPlot(int every_nth, PyObserverCallback &callback)
-";
-
-%feature("docstring")  FitObjective::isCompleted "bool FitObjective::isCompleted() const
-";
-
 %feature("docstring")  FitObjective::iterationInfo "IterationInfo FitObjective::iterationInfo() const
 ";
 
@@ -2401,6 +2485,50 @@ Should be explicitely called on last iteration to notify all observers.
 %feature("docstring")  FitObjective::fitObjectCount "unsigned FitObjective::fitObjectCount() const
 ";
 
+%feature("docstring")  FitObjective::run_simulations "void FitObjective::run_simulations(const Fit::Parameters &params)
+";
+
+%feature("docstring")  FitObjective::setChiSquaredModule "void FitObjective::setChiSquaredModule(const IChiSquaredModule &module)
+";
+
+%feature("docstring")  FitObjective::setObjectiveMetric "void FitObjective::setObjectiveMetric(const std::string &metric)
+";
+
+%feature("docstring")  FitObjective::setObjectiveMetric "void FitObjective::setObjectiveMetric(const std::string &metric, const std::string &norm)
+
+Sets objective metric to the  FitObjective.
+
+Parameters:
+-----------
+
+metric: 
+metric name
+
+norm: 
+metric norm name (defaults to L2-norm) 
+";
+
+%feature("docstring")  FitObjective::containsUncertainties "bool FitObjective::containsUncertainties(size_t i_item) const
+
+Returns true if the specified DataPair element contains uncertainties. 
+";
+
+%feature("docstring")  FitObjective::allPairsHaveUncertainties "bool FitObjective::allPairsHaveUncertainties() const
+
+Returns true if all the data pairs in  FitObjective instance contain uncertainties. 
+";
+
+%feature("docstring")  FitObjective::dataPair "const SimDataPair & FitObjective::dataPair(size_t i_item=0) const
+
+Returns a reference to i-th  SimDataPair. 
+";
+
+%feature("docstring")  FitObjective::initPlot "void FitObjective::initPlot(int every_nth, fit_observer_t observer)
+";
+
+%feature("docstring")  FitObjective::isCompleted "bool FitObjective::isCompleted() const
+";
+
 %feature("docstring")  FitObjective::interruptFitting "void FitObjective::interruptFitting()
 ";
 
@@ -2410,10 +2538,7 @@ Should be explicitely called on last iteration to notify all observers.
 %feature("docstring")  FitObjective::isFirstIteration "bool FitObjective::isFirstIteration() const
 ";
 
-%feature("docstring")  FitObjective::run_simulations "void FitObjective::run_simulations(const Fit::Parameters &params)
-";
-
-%feature("docstring")  FitObjective::setChiSquaredModule "void FitObjective::setChiSquaredModule(const IChiSquaredModule &module)
+%feature("docstring")  FitObjective::setObjectiveMetric "void FitObjective::setObjectiveMetric(std::unique_ptr< ObjectiveMetric > metric)
 ";
 
 
@@ -2839,6 +2964,9 @@ C++ includes: FormFactorCoherentPart.h
 %feature("docstring")  FormFactorCoherentPart::FormFactorCoherentPart "FormFactorCoherentPart::FormFactorCoherentPart(const FormFactorCoherentPart &other)
 ";
 
+%feature("docstring")  FormFactorCoherentPart::FormFactorCoherentPart "FormFactorCoherentPart::FormFactorCoherentPart(FormFactorCoherentPart &&other)
+";
+
 %feature("docstring")  FormFactorCoherentPart::~FormFactorCoherentPart "FormFactorCoherentPart::~FormFactorCoherentPart()
 ";
 
@@ -2866,12 +2994,6 @@ C++ includes: FormFactorCoherentSum.h
 %feature("docstring")  FormFactorCoherentSum::FormFactorCoherentSum "FormFactorCoherentSum::FormFactorCoherentSum(double abundance)
 ";
 
-%feature("docstring")  FormFactorCoherentSum::~FormFactorCoherentSum "FormFactorCoherentSum::~FormFactorCoherentSum()
-";
-
-%feature("docstring")  FormFactorCoherentSum::clone "FormFactorCoherentSum * FormFactorCoherentSum::clone() const
-";
-
 %feature("docstring")  FormFactorCoherentSum::addCoherentPart "void FormFactorCoherentSum::addCoherentPart(const FormFactorCoherentPart &part)
 ";
 
@@ -2881,9 +3003,6 @@ C++ includes: FormFactorCoherentSum.h
 %feature("docstring")  FormFactorCoherentSum::evaluatePol "Eigen::Matrix2cd FormFactorCoherentSum::evaluatePol(const SimulationElement &sim_element) const
 ";
 
-%feature("docstring")  FormFactorCoherentSum::setSpecularInfo "void FormFactorCoherentSum::setSpecularInfo(const IFresnelMap *p_fresnel_map, size_t layer_index)
-";
-
 %feature("docstring")  FormFactorCoherentSum::relativeAbundance "double FormFactorCoherentSum::relativeAbundance() const
 ";
 
@@ -5782,11 +5901,6 @@ Calls the  INodeVisitor's visit method.
 Put into a clean state for running a simulation. 
 ";
 
-%feature("docstring")  GISASSimulation::numberOfSimulationElements "size_t GISASSimulation::numberOfSimulationElements() const override
-
-Gets the number of elements this simulation needs to calculate. 
-";
-
 %feature("docstring")  GISASSimulation::result "SimulationResult GISASSimulation::result() const override
 
 Returns the results of the simulation in a format that supports unit conversion and export to numpy arrays 
@@ -5797,6 +5911,11 @@ Returns the results of the simulation in a format that supports unit conversion
 Sets beam parameters from here (forwarded to  Instrument) 
 ";
 
+%feature("docstring")  GISASSimulation::intensityMapSize "size_t GISASSimulation::intensityMapSize() const override
+
+Returns the total number of the intensity values in the simulation result. 
+";
+
 
 // File: classGISASSpecularComputation.xml
 %feature("docstring") GISASSpecularComputation "
@@ -5806,7 +5925,7 @@ Computes the specular signal in the bin where q_parallel = 0. Used by  DWBACompu
 C++ includes: GISASSpecularComputation.h
 ";
 
-%feature("docstring")  GISASSpecularComputation::GISASSpecularComputation "GISASSpecularComputation::GISASSpecularComputation(const MultiLayer *p_multi_layer, const IFresnelMap *p_fresnel_map)
+%feature("docstring")  GISASSpecularComputation::GISASSpecularComputation "GISASSpecularComputation::GISASSpecularComputation(const IFresnelMap *p_fresnel_map)
 ";
 
 %feature("docstring")  GISASSpecularComputation::compute "void GISASSpecularComputation::compute(SimulationElement &elem) const
@@ -5829,7 +5948,12 @@ C++ includes: PercusYevickBuilder.h
 
 
 // File: classHash2Doubles.xml
-%feature("docstring") Hash2Doubles "";
+%feature("docstring") Hash2Doubles "
+
+Provides a hash function for a pair of doubles, for use in  ScalarFresnelMap.
+
+C++ includes: Hash2Doubles.h
+";
 
 %feature("docstring")  Hash2Doubles::Hash2Doubles "Hash2Doubles::Hash2Doubles()
 ";
@@ -6459,7 +6583,7 @@ Controlled by the multi-threading machinery in Simulation::runSingleSimulation()
 C++ includes: IComputation.h
 ";
 
-%feature("docstring")  IComputation::IComputation "IComputation::IComputation(const SimulationOptions &options, ProgressHandler &progress, const MultiLayer &sample)
+%feature("docstring")  IComputation::IComputation "IComputation::IComputation(const MultiLayer &sample, const SimulationOptions &options, ProgressHandler &progress)
 ";
 
 %feature("docstring")  IComputation::~IComputation "IComputation::~IComputation()
@@ -6876,7 +7000,7 @@ Returns number of registered objects.
 // File: classIFootprintFactor.xml
 %feature("docstring") IFootprintFactor "
 
-Defines the base for classes to calculate beam footprint factor
+Abstract base for classes that calculate the beam footprint factor
 
 C++ includes: IFootprintFactor.h
 ";
@@ -7110,9 +7234,10 @@ Retrieves the amplitude coefficients for a (time-reversed) outgoing wavevector.
 Retrieves the amplitude coefficients for an incoming wavevector. 
 ";
 
-%feature("docstring")  IFresnelMap::setMultilayer "void IFresnelMap::setMultilayer(const MultiLayer &multilayer)
+%feature("docstring")  IFresnelMap::setSlices "void IFresnelMap::setSlices(const std::vector< Slice > &slices)
+";
 
-Sets the multilayer to be used for the Fresnel calculations. 
+%feature("docstring")  IFresnelMap::slices "const std::vector< Slice > & IFresnelMap::slices() const
 ";
 
 %feature("docstring")  IFresnelMap::disableCaching "void IFresnelMap::disableCaching()
@@ -7722,7 +7847,7 @@ C++ includes: IInterferenceFunctionStrategy.h
 %feature("docstring")  IInterferenceFunctionStrategy::~IInterferenceFunctionStrategy "IInterferenceFunctionStrategy::~IInterferenceFunctionStrategy()
 ";
 
-%feature("docstring")  IInterferenceFunctionStrategy::init "void IInterferenceFunctionStrategy::init(const SafePointerVector< FormFactorCoherentSum > &weighted_formfactors, const IInterferenceFunction *p_iff)
+%feature("docstring")  IInterferenceFunctionStrategy::init "void IInterferenceFunctionStrategy::init(const std::vector< FormFactorCoherentSum > &weighted_formfactors, const IInterferenceFunction *p_iff)
 
 Initializes the object with form factors and an interference function. 
 ";
@@ -7825,9 +7950,6 @@ C++ includes: ILayout.h
 Returns a clone of this  ISample object. 
 ";
 
-%feature("docstring")  ILayout::cloneWithOffset "virtual ILayout* ILayout::cloneWithOffset(double offset) const =0
-";
-
 %feature("docstring")  ILayout::accept "virtual void ILayout::accept(INodeVisitor *visitor) const =0
 
 Calls the  INodeVisitor's visit method. 
@@ -7838,6 +7960,11 @@ Calls the  INodeVisitor's visit method.
 Returns information on all particles (type and abundance) and generates new particles if an  IAbstractParticle denotes a collection 
 ";
 
+%feature("docstring")  ILayout::interferenceFunction "virtual const IInterferenceFunction* ILayout::interferenceFunction() const =0
+
+Returns the interference function. 
+";
+
 %feature("docstring")  ILayout::getTotalAbundance "virtual double ILayout::getTotalAbundance() const =0
 
 Get total abundance of all particles. 
@@ -7863,14 +7990,14 @@ Returns the relative weight of this layout.
 Sets the relative weight of this layout. 
 ";
 
-%feature("docstring")  ILayout::getApproximation "EInterferenceApproximation ILayout::getApproximation() const
 
-Gets the used approximation for particles and interference functions. 
-";
+// File: classIMetricWrapper.xml
+%feature("docstring") IMetricWrapper "";
 
-%feature("docstring")  ILayout::setApproximation "void ILayout::setApproximation(EInterferenceApproximation approximation)
+%feature("docstring")  IMetricWrapper::~IMetricWrapper "IMetricWrapper::~IMetricWrapper()
+";
 
-Sets the used approximation for particles and interference functions. 
+%feature("docstring")  IMetricWrapper::compute "virtual double IMetricWrapper::compute(const std::vector< SimDataPair > &fit_objects, size_t n_pars) const =0
 ";
 
 
@@ -10069,7 +10196,12 @@ Returns map of fit parameter names and its current values.
 
 
 // File: classIterationStrategy.xml
-%feature("docstring") IterationStrategy "";
+%feature("docstring") IterationStrategy "
+
+Abstract base class of  PreorderStrategy and  PostorderStrategy, for use in  INodeVisitor.
+
+C++ includes: IterationStrategy.h
+";
 
 %feature("docstring")  IterationStrategy::~IterationStrategy "virtual IterationStrategy::~IterationStrategy()
 ";
@@ -10137,7 +10269,7 @@ C++ includes: NodeIterator.h
 %feature("docstring")  IteratorState::IteratorState "IteratorState::IteratorState(const INode *single_element)
 ";
 
-%feature("docstring")  IteratorState::IteratorState "IteratorState::IteratorState(std::vector< const INode * > samples)
+%feature("docstring")  IteratorState::IteratorState "IteratorState::IteratorState(std::vector< const INode *> samples)
 ";
 
 %feature("docstring")  IteratorState::~IteratorState "virtual IteratorState::~IteratorState()
@@ -10191,6 +10323,11 @@ C++ includes: IUnitConverter.h
 %feature("docstring")  IUnitConverter::createConvertedAxis "virtual std::unique_ptr<IAxis> IUnitConverter::createConvertedAxis(size_t i_axis, AxesUnits units) const =0
 ";
 
+%feature("docstring")  IUnitConverter::createConvertedData "std::unique_ptr< OutputData< double > > IUnitConverter::createConvertedData(const OutputData< double > &data, AxesUnits units) const
+
+Creates  OutputData array in converter units. 
+";
+
 
 // File: classIVarianceFunction.xml
 %feature("docstring") IVarianceFunction "
@@ -10423,7 +10560,7 @@ thickness:
 thickness of a layer in nanometers 
 ";
 
-%feature("docstring")  Layer::~Layer "Layer::~Layer()
+%feature("docstring")  Layer::~Layer "Layer::~Layer() override
 ";
 
 %feature("docstring")  Layer::clone "Layer * Layer::clone() const override final
@@ -10431,9 +10568,6 @@ thickness of a layer in nanometers
 Returns a clone of this  ISample object. 
 ";
 
-%feature("docstring")  Layer::cloneInvertB "Layer * Layer::cloneInvertB() const
-";
-
 %feature("docstring")  Layer::accept "void Layer::accept(INodeVisitor *visitor) const override final
 
 Calls the  INodeVisitor's visit method. 
@@ -10478,24 +10612,6 @@ Returns a vector of children (const).
 %feature("docstring")  Layer::numberOfSlices "unsigned int Layer::numberOfSlices() const
 ";
 
-%feature("docstring")  Layer::slice "SafePointerVector< Layer > Layer::slice(ZLimits limits, ELayerType layer_type) const
-";
-
-%feature("docstring")  Layer::scalarReducedPotential "complex_t Layer::scalarReducedPotential(kvector_t k, double n_ref) const
-
-Return the potential term that is used in the one-dimensional Fresnel calculations. 
-";
-
-%feature("docstring")  Layer::polarizedReducedPotential "Eigen::Matrix2cd Layer::polarizedReducedPotential(kvector_t k, double n_ref) const
-
-Return the potential term that is used in the one-dimensional Fresnel calculations in the presence of magnetization 
-";
-
-%feature("docstring")  Layer::initBField "void Layer::initBField(kvector_t h_field, double b_z)
-
-Initializes the magnetic B field from a given ambient field strength H. 
-";
-
 
 // File: classLayerFillLimits.xml
 %feature("docstring") LayerFillLimits "
@@ -10699,7 +10815,7 @@ Methods to generate a simulation strategy for a  ParticleLayoutComputation.
 C++ includes: LayoutStrategyBuilder.h
 ";
 
-%feature("docstring")  LayoutStrategyBuilder::LayoutStrategyBuilder "LayoutStrategyBuilder::LayoutStrategyBuilder(const MultiLayer *p_multilayer, const ILayout *p_layout, const IFresnelMap *p_fresnel_map, bool polarized, const SimulationOptions &sim_params, size_t layer_index)
+%feature("docstring")  LayoutStrategyBuilder::LayoutStrategyBuilder "LayoutStrategyBuilder::LayoutStrategyBuilder(const ProcessedLayout *p_layout, const SimulationOptions &sim_params, bool polarized)
 ";
 
 %feature("docstring")  LayoutStrategyBuilder::~LayoutStrategyBuilder "LayoutStrategyBuilder::~LayoutStrategyBuilder()
@@ -10708,9 +10824,6 @@ C++ includes: LayoutStrategyBuilder.h
 %feature("docstring")  LayoutStrategyBuilder::releaseStrategy "IInterferenceFunctionStrategy * LayoutStrategyBuilder::releaseStrategy()
 ";
 
-%feature("docstring")  LayoutStrategyBuilder::regionMap "std::map< size_t, std::vector< HomogeneousRegion > > LayoutStrategyBuilder::regionMap() const
-";
-
 
 // File: classLine.xml
 %feature("docstring") Line "
@@ -10804,6 +10917,58 @@ C++ includes: LLData.h
 ";
 
 
+// File: classLogMetric.xml
+%feature("docstring") LogMetric "
+
+Implementation of the standard  $ \\\\chi^2 $ metric with intensity  $I$ and experimental data  $D$ being replaced by  $ \\\\log_{10} I $ and  $\\\\log_{10} D$ accordingly. With default L2 norm corresponds to the formula  \\\\[\\\\chi^2 = \\\\sum \\\\frac{(\\\\log_{10} I - log_{10} D)^2 D^2 \\\\ln^2{10}}{\\\\delta_D^2}\\\\]
+
+C++ includes: ObjectiveMetric.h
+";
+
+%feature("docstring")  LogMetric::LogMetric "LogMetric::LogMetric()
+";
+
+%feature("docstring")  LogMetric::clone "LogMetric * LogMetric::clone() const override
+";
+
+%feature("docstring")  LogMetric::computeFromArrays "double LogMetric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > uncertainties, std::vector< double > weight_factors) const override
+
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors and uncertainties. All arrays involved in the computation must be of the same size.
+
+Parameters:
+-----------
+
+sim_data: 
+array with simulated intensities.
+
+exp_data: 
+array with intensity values obtained from an experiment.
+
+uncertainties: 
+array with experimental data uncertainties.
+
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
+";
+
+%feature("docstring")  LogMetric::computeFromArrays "double LogMetric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > weight_factors) const override
+
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors. All arrays involved in the computation must be of the same size.
+
+Parameters:
+-----------
+
+sim_data: 
+array with simulated intensities.
+
+exp_data: 
+array with intensity values obtained from an experiment.
+
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
+";
+
+
 // File: classLorentzFisherPeakShape.xml
 %feature("docstring") LorentzFisherPeakShape "
 
@@ -11121,9 +11286,7 @@ C++ includes: MatrixFresnelMap.h
 Retrieves the amplitude coefficients for a (time-reversed) outgoing wavevector. 
 ";
 
-%feature("docstring")  MatrixFresnelMap::setMultilayer "void MatrixFresnelMap::setMultilayer(const MultiLayer &multilayer) final override
-
-Sets the multilayer to be used for the Fresnel calculations. 
+%feature("docstring")  MatrixFresnelMap::setSlices "void MatrixFresnelMap::setSlices(const std::vector< Slice > &slices) final override
 ";
 
 
@@ -11175,6 +11338,15 @@ The following functions return the transmitted and reflected amplitudes for diff
 Returns z-part of the two wavevector eigenmodes. 
 ";
 
+%feature("docstring")  MatrixRTCoefficients::calculateTRMatrices "void MatrixRTCoefficients::calculateTRMatrices()
+";
+
+%feature("docstring")  MatrixRTCoefficients::calculateTRWithoutMagnetization "void MatrixRTCoefficients::calculateTRWithoutMagnetization()
+";
+
+%feature("docstring")  MatrixRTCoefficients::initializeBottomLayerPhiPsi "void MatrixRTCoefficients::initializeBottomLayerPhiPsi()
+";
+
 
 // File: classMesoCrystal.xml
 %feature("docstring") MesoCrystal "
@@ -11229,7 +11401,7 @@ C++ includes: MesoCrystalBuilder.h
 // File: structMillerIndex.xml
 %feature("docstring") MillerIndex "
 
-MillerIndex represents arbitrary directions in reciprocal space by allowing floating point index values
+A direction in reciprocal space, specified by double-valued indices hkl.
 
 C++ includes: ILatticeOrientation.h
 ";
@@ -11239,9 +11411,16 @@ C++ includes: ILatticeOrientation.h
 
 
 // File: classMillerIndexOrientation.xml
-%feature("docstring") MillerIndexOrientation "";
+%feature("docstring") MillerIndexOrientation "
+
+Specifies a rotation of a lattice through the Miller indices of two coordinate axes.
+
+C++ includes: ILatticeOrientation.h
+";
 
 %feature("docstring")  MillerIndexOrientation::MillerIndexOrientation "MillerIndexOrientation::MillerIndexOrientation(QComponent q1, MillerIndex index1, QComponent q2, MillerIndex index2)
+
+This constructor is best explained by an example. Arguments QX, (1,1,0), QY, (0,2,1) mean: Rotate the lattice such that the axis [110] points into x direction, and the axis [021], projected into the yz plane, points into z direction. 
 ";
 
 %feature("docstring")  MillerIndexOrientation::~MillerIndexOrientation "MillerIndexOrientation::~MillerIndexOrientation() override
@@ -11269,7 +11448,7 @@ C++ includes: ILatticeOrientation.h
 
 Our sample model: a stack of layers one below the other.Example of system of 4 layers (3 interfaces):
 
-ambience layer #0 z=getLayerBottomZ(0)=0.0 ------ interface #0 Fe, 20A layer #1 z=getLayerBottomZ(1)=-20.0 ------ interface #1 Cr, 40A layer #2 z=getLayerBottomZ(2)=-60.0 ------ interface #2 substrate layer #3 z=getLayerBottomZ(3)=-60.0
+ambience layer #0 ------ interface #0 z=0.0 Fe, 20A layer #1 ------ interface #1 z=-20.0 Cr, 40A layer #2 ------ interface #2 z=-60.0 substrate layer #3
 
 C++ includes: MultiLayer.h
 ";
@@ -11277,7 +11456,12 @@ C++ includes: MultiLayer.h
 %feature("docstring")  MultiLayer::MultiLayer "MultiLayer::MultiLayer()
 ";
 
-%feature("docstring")  MultiLayer::~MultiLayer "MultiLayer::~MultiLayer()
+%feature("docstring")  MultiLayer::~MultiLayer "MultiLayer::~MultiLayer() override
+";
+
+%feature("docstring")  MultiLayer::clone "MultiLayer * MultiLayer::clone() const final override
+
+Returns a clone of multilayer with clones of all layers and interfaces between layers 
 ";
 
 %feature("docstring")  MultiLayer::accept "void MultiLayer::accept(INodeVisitor *visitor) const final override
@@ -11288,9 +11472,6 @@ Calls the  INodeVisitor's visit method.
 %feature("docstring")  MultiLayer::numberOfLayers "size_t MultiLayer::numberOfLayers() const
 ";
 
-%feature("docstring")  MultiLayer::numberOfInterfaces "size_t MultiLayer::numberOfInterfaces() const
-";
-
 %feature("docstring")  MultiLayer::addLayer "void MultiLayer::addLayer(const Layer &layer)
 
 Adds object to multilayer.
@@ -11303,252 +11484,205 @@ Adds layer with default (zero) roughness.
 Adds layer with top roughness. 
 ";
 
-%feature("docstring")  MultiLayer::layer "const Layer* MultiLayer::layer(size_t i_layer) const
+%feature("docstring")  MultiLayer::layer "const Layer * MultiLayer::layer(size_t i_layer) const
 
 Returns layer with given index. 
 ";
 
-%feature("docstring")  MultiLayer::layerInterface "const LayerInterface* MultiLayer::layerInterface(size_t i_interface) const
+%feature("docstring")  MultiLayer::layerInterface "const LayerInterface * MultiLayer::layerInterface(size_t i_interface) const
 
-Returns layer with given index. 
-";
-
-%feature("docstring")  MultiLayer::layerTopZ "double MultiLayer::layerTopZ(size_t i_layer) const
-
-Returns z-coordinate of the layer's bottom. 
+Returns interface with given index. 
 ";
 
-%feature("docstring")  MultiLayer::layerBottomZ "double MultiLayer::layerBottomZ(size_t i_layer) const
+%feature("docstring")  MultiLayer::setCrossCorrLength "void MultiLayer::setCrossCorrLength(double crossCorrLength)
 
-Returns z-coordinate of the layer's bottom. 
+Sets cross correlation length of roughnesses between interfaces. 
 ";
 
-%feature("docstring")  MultiLayer::layerThickness "double MultiLayer::layerThickness(size_t i_layer) const
+%feature("docstring")  MultiLayer::crossCorrLength "double MultiLayer::crossCorrLength() const
 
-Returns thickness of layer. 
+Returns cross correlation length of roughnesses between interfaces. 
 ";
 
-%feature("docstring")  MultiLayer::layerTopInterface "const LayerInterface * MultiLayer::layerTopInterface(size_t i_layer) const
-
-Returns top interface of layer.
+%feature("docstring")  MultiLayer::setExternalField "void MultiLayer::setExternalField(kvector_t ext_field)
 
-Returns pointer to the top interface of the layer. nInterfaces = nLayers-1, first layer in multilayer doesn't have interface. 
+Sets the external field applied to the multilayer (units: A/m) 
 ";
 
-%feature("docstring")  MultiLayer::layerBottomInterface "const LayerInterface * MultiLayer::layerBottomInterface(size_t i_layer) const
-
-Returns bottom interface of layer.
+%feature("docstring")  MultiLayer::externalField "kvector_t MultiLayer::externalField() const
 
-Returns pointer to the bottom interface of the layer. 
+Returns the external field applied to the multilayer (units: A/m) 
 ";
 
-%feature("docstring")  MultiLayer::layerMaterial "Material MultiLayer::layerMaterial(size_t i_layer) const
+%feature("docstring")  MultiLayer::getChildren "std::vector< const INode * > MultiLayer::getChildren() const final override
 
-Returns layer material. 
+Returns a vector of children (const). 
 ";
 
-%feature("docstring")  MultiLayer::setLayerMaterial "void MultiLayer::setLayerMaterial(size_t i_layer, Material material)
 
-Changes a layer's material. 
-";
+// File: classMultiLayerWithRoughnessBuilder.xml
+%feature("docstring") MultiLayerWithRoughnessBuilder "
 
-%feature("docstring")  MultiLayer::clone "MultiLayer * MultiLayer::clone() const final override
+Builds sample: layers with correlated roughness.
 
-Returns a clone of multilayer with clones of all layers and recreated interfaces between layers 
+C++ includes: MultiLayerWithRoughnessBuilder.h
 ";
 
-%feature("docstring")  MultiLayer::cloneInvertB "MultiLayer * MultiLayer::cloneInvertB() const
-
-Returns a clone with inverted magnetic fields. 
+%feature("docstring")  MultiLayerWithRoughnessBuilder::MultiLayerWithRoughnessBuilder "MultiLayerWithRoughnessBuilder::MultiLayerWithRoughnessBuilder()
 ";
 
-%feature("docstring")  MultiLayer::cloneSliced "std::unique_ptr< MultiLayer > MultiLayer::cloneSliced(bool use_average_layers) const
-
-Returns a clone of multilayer where the original layers may be sliced into several sublayers for usage with the graded layer approximation 
+%feature("docstring")  MultiLayerWithRoughnessBuilder::buildSample "MultiLayer * MultiLayerWithRoughnessBuilder::buildSample() const
 ";
 
-%feature("docstring")  MultiLayer::setCrossCorrLength "void MultiLayer::setCrossCorrLength(double crossCorrLength)
 
-Sets cross correlation length of roughnesses between interfaces. 
-";
+// File: classMultipleLayoutBuilder.xml
+%feature("docstring") MultipleLayoutBuilder "
 
-%feature("docstring")  MultiLayer::crossCorrLength "double MultiLayer::crossCorrLength() const
+Builds sample: mixture of cylinders and prisms without interference, using multiple particle layouts
 
-Returns cross correlation length of roughnesses between interfaces. 
+C++ includes: MultipleLayoutBuilder.h
 ";
 
-%feature("docstring")  MultiLayer::setExternalField "void MultiLayer::setExternalField(kvector_t ext_field)
-
-Sets the external field applied to the multilayer (units: A/m) 
+%feature("docstring")  MultipleLayoutBuilder::MultipleLayoutBuilder "MultipleLayoutBuilder::MultipleLayoutBuilder()
 ";
 
-%feature("docstring")  MultiLayer::externalField "kvector_t MultiLayer::externalField() const
-
-Returns the external field applied to the multilayer (units: A/m) 
+%feature("docstring")  MultipleLayoutBuilder::buildSample "MultiLayer * MultipleLayoutBuilder::buildSample() const
 ";
 
-%feature("docstring")  MultiLayer::crossCorrSpectralFun "double MultiLayer::crossCorrSpectralFun(const kvector_t kvec, size_t j, size_t k) const
 
-Fourier transform of the correlation function of roughnesses between the interfaces
+// File: structArrayUtils_1_1CreateDataImpl_1_1nDim.xml
 
-Fourier transform of the correlation function of roughnesses between the interfaces j,k - indexes of layers in multilayer whose bottom interfaces we are considering 
-";
 
-%feature("docstring")  MultiLayer::indexOfLayer "size_t MultiLayer::indexOfLayer(const Layer *p_layer) const
+// File: structArrayUtils_1_1CreateDataImpl_1_1nDim_3_01std_1_1vector_3_01T_00_01A_01_4_01_4.xml
 
-returns layer index 
-";
 
-%feature("docstring")  MultiLayer::requiresMatrixRTCoefficients "bool MultiLayer::requiresMatrixRTCoefficients() const
+// File: classNodeIterator.xml
+%feature("docstring") NodeIterator "
 
-returns true if contains magnetic materials and matrix calculations are required 
-";
+Iterator through  INode tree of objects.
 
-%feature("docstring")  MultiLayer::bottomZToLayerIndex "size_t MultiLayer::bottomZToLayerIndex(double z_value) const
+Usage example: SampleTreeIterator<Strategy> it(&sample); it.first(); while( !it.is_done() ) {  INode *p_sample = it.get_current(); it.next(); }
 
-returns layer index corresponding to given global z coordinate The top interface position of a layer is considered to belong to the layer above 
+C++ includes: NodeIterator.h
 ";
 
-%feature("docstring")  MultiLayer::topZToLayerIndex "size_t MultiLayer::topZToLayerIndex(double z_value) const
-
-returns layer index corresponding to given global z coordinate The top interface position of a layer is considered to belong to the layer beneath 
+%feature("docstring")  NodeIterator::NodeIterator "NodeIterator< Strategy >::NodeIterator(const INode *root)
 ";
 
-%feature("docstring")  MultiLayer::containsMagneticMaterial "bool MultiLayer::containsMagneticMaterial() const
+%feature("docstring")  NodeIterator::~NodeIterator "virtual NodeIterator< Strategy >::~NodeIterator()
 ";
 
-%feature("docstring")  MultiLayer::containsCompatibleMaterials "bool MultiLayer::containsCompatibleMaterials() const
-
-Returns true if the multilayer contains non-default materials of one type only. 
+%feature("docstring")  NodeIterator::first "void NodeIterator< Strategy >::first()
 ";
 
-%feature("docstring")  MultiLayer::initBFields "void MultiLayer::initBFields()
-
-precalculate the magnetic B fields in each layer 
+%feature("docstring")  NodeIterator::next "void NodeIterator< Strategy >::next()
 ";
 
-%feature("docstring")  MultiLayer::hasRoughness "bool MultiLayer::hasRoughness() const
+%feature("docstring")  NodeIterator::getCurrent "const INode * NodeIterator< Strategy >::getCurrent()
 ";
 
-%feature("docstring")  MultiLayer::totalNofLayouts "size_t MultiLayer::totalNofLayouts() const
+%feature("docstring")  NodeIterator::isDone "bool NodeIterator< Strategy >::isDone() const
 ";
 
-%feature("docstring")  MultiLayer::getChildren "std::vector< const INode * > MultiLayer::getChildren() const final override
-
-Returns a vector of children (const). 
+%feature("docstring")  NodeIterator::depth "int NodeIterator< Strategy >::depth() const
 ";
 
 
-// File: structMultilayerInfo.xml
-%feature("docstring") MultilayerInfo "
-
-Container struct for information regarding a multilayer: Fresnel coefficients and the multilayer itself. Used by the components of  DWBASingleComputation, which adds up the contributions from particles, roughness and specular signal
-
-C++ includes: MultilayerInfo.h
-";
+// File: classExceptions_1_1NotImplementedException.xml
+%feature("docstring") Exceptions::NotImplementedException "";
 
-%feature("docstring")  MultilayerInfo::MultilayerInfo "MultilayerInfo::MultilayerInfo(const MultiLayer *p_multilayer, const IFresnelMap *p_fresnel_map)
+%feature("docstring")  Exceptions::NotImplementedException::NotImplementedException "Exceptions::NotImplementedException::NotImplementedException(const std::string &message)
 ";
 
 
-// File: classMultiLayerSlicer.xml
-%feature("docstring") MultiLayerSlicer "
-
-Helper class to test slicing functionality of  MultiLayer.
+// File: classExceptions_1_1NullPointerException.xml
+%feature("docstring") Exceptions::NullPointerException "";
 
-C++ includes: MultiLayerSlicer.h
+%feature("docstring")  Exceptions::NullPointerException::NullPointerException "Exceptions::NullPointerException::NullPointerException(const std::string &message)
 ";
 
-%feature("docstring")  MultiLayerSlicer::MultiLayerSlicer "MultiLayerSlicer::MultiLayerSlicer(const MultiLayer &multilayer)
-";
 
-%feature("docstring")  MultiLayerSlicer::~MultiLayerSlicer "MultiLayerSlicer::~MultiLayerSlicer()
-";
+// File: classObjectiveMetric.xml
+%feature("docstring") ObjectiveMetric "
 
-%feature("docstring")  MultiLayerSlicer::slicedThicknesses "std::vector< double > MultiLayerSlicer::slicedThicknesses() const
+Base class for metric implementations.
 
-Returns thicknesses of slices after slicing. 
+C++ includes: ObjectiveMetric.h
 ";
 
-%feature("docstring")  MultiLayerSlicer::slicedRepresentation "std::string MultiLayerSlicer::slicedRepresentation() const
+%feature("docstring")  ObjectiveMetric::ObjectiveMetric "ObjectiveMetric::ObjectiveMetric(std::function< double(double)> norm)
+";
 
-Returns a string representation of the sliced  MultiLayer. 
+%feature("docstring")  ObjectiveMetric::clone "ObjectiveMetric* ObjectiveMetric::clone() const override=0
 ";
 
+%feature("docstring")  ObjectiveMetric::compute "double ObjectiveMetric::compute(const SimDataPair &data_pair, bool use_weights) const
 
-// File: classMultiLayerWithRoughnessBuilder.xml
-%feature("docstring") MultiLayerWithRoughnessBuilder "
+Computes metric value from  SimDataPair object. Calls computeFromArrays internally.
 
-Builds sample: layers with correlated roughness.
+Parameters:
+-----------
 
-C++ includes: MultiLayerWithRoughnessBuilder.h
-";
+data_pair: 
+ SimDataPair object. Can optionally contain data uncertainties
 
-%feature("docstring")  MultiLayerWithRoughnessBuilder::MultiLayerWithRoughnessBuilder "MultiLayerWithRoughnessBuilder::MultiLayerWithRoughnessBuilder()
+use_weights: 
+boolean, defines if data uncertainties should be taken into account 
 ";
 
-%feature("docstring")  MultiLayerWithRoughnessBuilder::buildSample "MultiLayer * MultiLayerWithRoughnessBuilder::buildSample() const
-";
+%feature("docstring")  ObjectiveMetric::computeFromArrays "virtual double ObjectiveMetric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > uncertainties, std::vector< double > weight_factors) const =0
 
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors and uncertainties. All arrays involved in the computation must be of the same size.
 
-// File: classMultipleLayoutBuilder.xml
-%feature("docstring") MultipleLayoutBuilder "
+Parameters:
+-----------
 
-Builds sample: mixture of cylinders and prisms without interference, using multiple particle layouts
+sim_data: 
+array with simulated intensities.
 
-C++ includes: MultipleLayoutBuilder.h
-";
+exp_data: 
+array with intensity values obtained from an experiment.
 
-%feature("docstring")  MultipleLayoutBuilder::MultipleLayoutBuilder "MultipleLayoutBuilder::MultipleLayoutBuilder()
-";
+uncertainties: 
+array with experimental data uncertainties.
 
-%feature("docstring")  MultipleLayoutBuilder::buildSample "MultiLayer * MultipleLayoutBuilder::buildSample() const
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
 ";
 
+%feature("docstring")  ObjectiveMetric::computeFromArrays "virtual double ObjectiveMetric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > weight_factors) const =0
 
-// File: classNodeIterator.xml
-%feature("docstring") NodeIterator "
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors. All arrays involved in the computation must be of the same size.
 
-Iterator through  INode tree of objects.
+Parameters:
+-----------
 
-Usage example: SampleTreeIterator<Strategy> it(&sample); it.first(); while( !it.is_done() ) {  INode *p_sample = it.get_current(); it.next(); }
+sim_data: 
+array with simulated intensities.
 
-C++ includes: NodeIterator.h
-";
+exp_data: 
+array with intensity values obtained from an experiment.
 
-%feature("docstring")  NodeIterator::NodeIterator "NodeIterator< Strategy >::NodeIterator(const INode *root)
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
 ";
 
-%feature("docstring")  NodeIterator::~NodeIterator "virtual NodeIterator< Strategy >::~NodeIterator()
+%feature("docstring")  ObjectiveMetric::setNorm "void ObjectiveMetric::setNorm(std::function< double(double)> norm)
 ";
 
-%feature("docstring")  NodeIterator::first "void NodeIterator< Strategy >::first()
-";
+%feature("docstring")  ObjectiveMetric::norm "auto ObjectiveMetric::norm() const
 
-%feature("docstring")  NodeIterator::next "void NodeIterator< Strategy >::next()
+Returns a copy of the normalization function used. 
 ";
 
-%feature("docstring")  NodeIterator::getCurrent "const INode * NodeIterator< Strategy >::getCurrent()
-";
 
-%feature("docstring")  NodeIterator::isDone "bool NodeIterator< Strategy >::isDone() const
-";
+// File: classObjectiveMetricWrapper.xml
+%feature("docstring") ObjectiveMetricWrapper "";
 
-%feature("docstring")  NodeIterator::depth "int NodeIterator< Strategy >::depth() const
+%feature("docstring")  ObjectiveMetricWrapper::ObjectiveMetricWrapper "ObjectiveMetricWrapper::ObjectiveMetricWrapper(std::unique_ptr< ObjectiveMetric > module)
 ";
 
-
-// File: classExceptions_1_1NotImplementedException.xml
-%feature("docstring") Exceptions::NotImplementedException "";
-
-%feature("docstring")  Exceptions::NotImplementedException::NotImplementedException "Exceptions::NotImplementedException::NotImplementedException(const std::string &message)
-";
-
-
-// File: classExceptions_1_1NullPointerException.xml
-%feature("docstring") Exceptions::NullPointerException "";
-
-%feature("docstring")  Exceptions::NullPointerException::NullPointerException "Exceptions::NullPointerException::NullPointerException(const std::string &message)
+%feature("docstring")  ObjectiveMetricWrapper::compute "double ObjectiveMetricWrapper::compute(const std::vector< SimDataPair > &fit_objects, size_t n_pars) const override
 ";
 
 
@@ -11588,11 +11722,6 @@ Calls the  INodeVisitor's visit method.
 Put into a clean state for running a simulation. 
 ";
 
-%feature("docstring")  OffSpecSimulation::numberOfSimulationElements "size_t OffSpecSimulation::numberOfSimulationElements() const final
-
-Gets the number of elements this simulation needs to calculate. 
-";
-
 %feature("docstring")  OffSpecSimulation::result "SimulationResult OffSpecSimulation::result() const override
 
 Returns the results of the simulation in a format that supports unit conversion and export to numpy arrays 
@@ -11611,6 +11740,11 @@ Returns axis of the beam.
 %feature("docstring")  OffSpecSimulation::createUnitConverter "std::unique_ptr< IUnitConverter > OffSpecSimulation::createUnitConverter() const
 ";
 
+%feature("docstring")  OffSpecSimulation::intensityMapSize "size_t OffSpecSimulation::intensityMapSize() const override
+
+Returns the total number of the intensity values in the simulation result. 
+";
+
 
 // File: classOffSpecularConverter.xml
 %feature("docstring") OffSpecularConverter "
@@ -12102,6 +12236,18 @@ C++ includes: OutputDataReadStrategy.h
 ";
 
 
+// File: classOutputDataReadReflectometryStrategy.xml
+%feature("docstring") OutputDataReadReflectometryStrategy "
+
+Strategy to read Reflectometry data from ASCII file.
+
+C++ includes: OutputDataReadStrategy.h
+";
+
+%feature("docstring")  OutputDataReadReflectometryStrategy::readOutputData "OutputData< double > * OutputDataReadReflectometryStrategy::readOutputData(std::istream &input_stream)
+";
+
+
 // File: classOutputDataWriteFactory.xml
 %feature("docstring") OutputDataWriteFactory "
 
@@ -12606,7 +12752,7 @@ C++ includes: ParticleLayout.h
 %feature("docstring")  ParticleLayout::ParticleLayout "ParticleLayout::ParticleLayout(const IAbstractParticle &particle, double abundance=-1.0)
 ";
 
-%feature("docstring")  ParticleLayout::~ParticleLayout "ParticleLayout::~ParticleLayout()
+%feature("docstring")  ParticleLayout::~ParticleLayout "ParticleLayout::~ParticleLayout() override
 ";
 
 %feature("docstring")  ParticleLayout::clone "ParticleLayout * ParticleLayout::clone() const final override
@@ -12614,9 +12760,6 @@ C++ includes: ParticleLayout.h
 Returns a clone of this  ISample object. 
 ";
 
-%feature("docstring")  ParticleLayout::cloneWithOffset "ParticleLayout * ParticleLayout::cloneWithOffset(double offset) const final override
-";
-
 %feature("docstring")  ParticleLayout::accept "void ParticleLayout::accept(INodeVisitor *visitor) const final override
 
 Calls the  INodeVisitor's visit method. 
@@ -12647,6 +12790,11 @@ rotation:
 Returns information on all particles (type and abundance) and generates new particles if an  IAbstractParticle denotes a collection 
 ";
 
+%feature("docstring")  ParticleLayout::interferenceFunction "const IInterferenceFunction * ParticleLayout::interferenceFunction() const final override
+
+Returns the interference function. 
+";
+
 %feature("docstring")  ParticleLayout::getTotalAbundance "double ParticleLayout::getTotalAbundance() const final override
 
 Get total abundance of all particles. 
@@ -12687,7 +12835,7 @@ Computes the scattering contribution from one particle layout. Used by  DWBAComp
 C++ includes: ParticleLayoutComputation.h
 ";
 
-%feature("docstring")  ParticleLayoutComputation::ParticleLayoutComputation "ParticleLayoutComputation::ParticleLayoutComputation(const MultiLayer *p_multilayer, const IFresnelMap *p_fresnel_map, const ILayout *p_layout, size_t layer_index, const SimulationOptions &options, bool polarized)
+%feature("docstring")  ParticleLayoutComputation::ParticleLayoutComputation "ParticleLayoutComputation::ParticleLayoutComputation(const ProcessedLayout *p_layout, const SimulationOptions &options, bool polarized)
 ";
 
 %feature("docstring")  ParticleLayoutComputation::~ParticleLayoutComputation "ParticleLayoutComputation::~ParticleLayoutComputation()
@@ -12703,7 +12851,12 @@ Merges its region map into the given one (notice non-const reference parameter)
 
 
 // File: structParticleLimits.xml
-%feature("docstring") ParticleLimits "";
+%feature("docstring") ParticleLimits "
+
+Vertical extension of a particle, specified by bottom and top z coordinate.
+
+C++ includes: IParticle.h
+";
 
 
 // File: classPlainMultiLayerBySLDBuilder.xml
@@ -12782,6 +12935,75 @@ Creates a new clipped axis.
 ";
 
 
+// File: classPoissonLikeMetric.xml
+%feature("docstring") PoissonLikeMetric "
+
+Implementation of  $ \\\\chi^2 $ metric with standard deviation  $\\\\sigma = max(\\\\sqrt{I}, 1)$, where  $I$ is the simulated intensity. With default L2 norm corresponds to the formula  \\\\[\\\\chi^2 = \\\\sum \\\\frac{(I - D)^2}{max(I, 1)}\\\\] for unweighted experimental data. Falls to standard  Chi2Metric when data uncertainties are taken into account.
+
+C++ includes: ObjectiveMetric.h
+";
+
+%feature("docstring")  PoissonLikeMetric::PoissonLikeMetric "PoissonLikeMetric::PoissonLikeMetric()
+";
+
+%feature("docstring")  PoissonLikeMetric::clone "PoissonLikeMetric * PoissonLikeMetric::clone() const override
+";
+
+%feature("docstring")  PoissonLikeMetric::computeFromArrays "double PoissonLikeMetric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > weight_factors) const override
+
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors. All arrays involved in the computation must be of the same size.
+
+Parameters:
+-----------
+
+sim_data: 
+array with simulated intensities.
+
+exp_data: 
+array with intensity values obtained from an experiment.
+
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
+";
+
+%feature("docstring")  PoissonLikeMetric::computeFromArrays "double Chi2Metric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > uncertainties, std::vector< double > weight_factors) const override
+
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors and uncertainties. All arrays involved in the computation must be of the same size.
+
+Parameters:
+-----------
+
+sim_data: 
+array with simulated intensities.
+
+exp_data: 
+array with intensity values obtained from an experiment.
+
+uncertainties: 
+array with experimental data uncertainties.
+
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
+";
+
+%feature("docstring")  PoissonLikeMetric::computeFromArrays "double Chi2Metric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > weight_factors) const override
+
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors. All arrays involved in the computation must be of the same size.
+
+Parameters:
+-----------
+
+sim_data: 
+array with simulated intensities.
+
+exp_data: 
+array with intensity values obtained from an experiment.
+
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
+";
+
+
 // File: classPoissonNoiseBackground.xml
 %feature("docstring") PoissonNoiseBackground "
 
@@ -12959,10 +13181,7 @@ Parameters:
 -----------
 
 V: 
-oriented vertex list
-
-_sym_S2: 
-true if face has a perpedicular two-fold symmetry axis 
+oriented vertex list 
 ";
 
 %feature("docstring")  PolyhedralFace::area "double PolyhedralFace::area() const
@@ -13056,6 +13275,115 @@ C++ includes: FormFactorPolyhedron.h
 ";
 
 
+// File: classProcessedLayout.xml
+%feature("docstring") ProcessedLayout "
+
+Data structure that contains preprocessed data for a single layout.
+
+If particles in the layout crossed the limits of the layer slices, these particles will be sliced themselves.
+
+C++ includes: ProcessedLayout.h
+";
+
+%feature("docstring")  ProcessedLayout::ProcessedLayout "ProcessedLayout::ProcessedLayout(const ILayout &layout, const std::vector< Slice > &slices, double z_ref, const IFresnelMap *p_fresnel_map, bool polarized)
+";
+
+%feature("docstring")  ProcessedLayout::ProcessedLayout "ProcessedLayout::ProcessedLayout(ProcessedLayout &&other)
+";
+
+%feature("docstring")  ProcessedLayout::~ProcessedLayout "ProcessedLayout::~ProcessedLayout()
+";
+
+%feature("docstring")  ProcessedLayout::numberOfSlices "size_t ProcessedLayout::numberOfSlices() const
+";
+
+%feature("docstring")  ProcessedLayout::surfaceDensity "double ProcessedLayout::surfaceDensity() const
+";
+
+%feature("docstring")  ProcessedLayout::formFactorList "const std::vector< FormFactorCoherentSum > & ProcessedLayout::formFactorList() const
+";
+
+%feature("docstring")  ProcessedLayout::interferenceFunction "const IInterferenceFunction * ProcessedLayout::interferenceFunction() const
+";
+
+%feature("docstring")  ProcessedLayout::regionMap "std::map< size_t, std::vector< HomogeneousRegion > > ProcessedLayout::regionMap() const
+";
+
+
+// File: classProcessedSample.xml
+%feature("docstring") ProcessedSample "
+
+Data structure that contains all the necessary data for scattering calculations.
+
+If the usage of average materials is requested, layers and particles are sliced into multiple slices and the average material is calculated for each slice.
+
+C++ includes: ProcessedSample.h
+";
+
+%feature("docstring")  ProcessedSample::ProcessedSample "ProcessedSample::ProcessedSample(const MultiLayer &sample, const SimulationOptions &options)
+";
+
+%feature("docstring")  ProcessedSample::~ProcessedSample "ProcessedSample::~ProcessedSample()
+";
+
+%feature("docstring")  ProcessedSample::numberOfSlices "size_t ProcessedSample::numberOfSlices() const
+";
+
+%feature("docstring")  ProcessedSample::slices "const std::vector< Slice > & ProcessedSample::slices() const
+";
+
+%feature("docstring")  ProcessedSample::averageSlices "const std::vector< Slice > & ProcessedSample::averageSlices() const
+";
+
+%feature("docstring")  ProcessedSample::layouts "const std::vector< ProcessedLayout > & ProcessedSample::layouts() const
+";
+
+%feature("docstring")  ProcessedSample::fresnelMap "const IFresnelMap * ProcessedSample::fresnelMap() const
+";
+
+%feature("docstring")  ProcessedSample::crossCorrelationLength "double ProcessedSample::crossCorrelationLength() const
+";
+
+%feature("docstring")  ProcessedSample::externalField "kvector_t ProcessedSample::externalField() const
+";
+
+%feature("docstring")  ProcessedSample::bottomRoughness "const LayerRoughness * ProcessedSample::bottomRoughness(size_t i) const
+";
+
+%feature("docstring")  ProcessedSample::sliceTopZ "double ProcessedSample::sliceTopZ(size_t i) const
+";
+
+%feature("docstring")  ProcessedSample::sliceBottomZ "double ProcessedSample::sliceBottomZ(size_t i) const
+";
+
+%feature("docstring")  ProcessedSample::containsMagneticMaterial "bool ProcessedSample::containsMagneticMaterial() const
+";
+
+%feature("docstring")  ProcessedSample::hasRoughness "bool ProcessedSample::hasRoughness() const
+";
+
+%feature("docstring")  ProcessedSample::crossCorrSpectralFun "double ProcessedSample::crossCorrSpectralFun(const kvector_t kvec, size_t j, size_t k) const
+
+Fourier transform of the correlation function of roughnesses between the interfaces 
+";
+
+
+// File: classProfileHelper.xml
+%feature("docstring") ProfileHelper "";
+
+%feature("docstring")  ProfileHelper::ProfileHelper "ProfileHelper::ProfileHelper(const ProcessedSample &sample)
+";
+
+%feature("docstring")  ProfileHelper::~ProfileHelper "ProfileHelper::~ProfileHelper()
+";
+
+%feature("docstring")  ProfileHelper::calculateProfile "std::vector< complex_t > ProfileHelper::calculateProfile(const std::vector< double > &z_values) const
+";
+
+%feature("docstring")  ProfileHelper::defaultLimits "std::pair< double, double > ProfileHelper::defaultLimits() const
+";
+
+
 // File: classProgressHandler.xml
 %feature("docstring") ProgressHandler "
 
@@ -13831,6 +14159,75 @@ Number of detector bins.
 ";
 
 
+// File: classRelativeDifferenceMetric.xml
+%feature("docstring") RelativeDifferenceMetric "
+
+Implementation of relative difference metric. With default L2 norm and weighting off corresponds to the formula  \\\\[Result = \\\\sum \\\\frac{(I - D)^2}{(I + D)^2}\\\\] where  $I$ is the simulated intensity,  $D$ - experimental data. If weighting is on, falls back to the standard  $\\\\chi^2$ metric.
+
+C++ includes: ObjectiveMetric.h
+";
+
+%feature("docstring")  RelativeDifferenceMetric::RelativeDifferenceMetric "RelativeDifferenceMetric::RelativeDifferenceMetric()
+";
+
+%feature("docstring")  RelativeDifferenceMetric::clone "RelativeDifferenceMetric * RelativeDifferenceMetric::clone() const override
+";
+
+%feature("docstring")  RelativeDifferenceMetric::computeFromArrays "double RelativeDifferenceMetric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > weight_factors) const override
+
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors. All arrays involved in the computation must be of the same size.
+
+Parameters:
+-----------
+
+sim_data: 
+array with simulated intensities.
+
+exp_data: 
+array with intensity values obtained from an experiment.
+
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
+";
+
+%feature("docstring")  RelativeDifferenceMetric::computeFromArrays "double Chi2Metric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > uncertainties, std::vector< double > weight_factors) const override
+
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors and uncertainties. All arrays involved in the computation must be of the same size.
+
+Parameters:
+-----------
+
+sim_data: 
+array with simulated intensities.
+
+exp_data: 
+array with intensity values obtained from an experiment.
+
+uncertainties: 
+array with experimental data uncertainties.
+
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
+";
+
+%feature("docstring")  RelativeDifferenceMetric::computeFromArrays "double Chi2Metric::computeFromArrays(std::vector< double > sim_data, std::vector< double > exp_data, std::vector< double > weight_factors) const override
+
+Computes metric value from data arrays. Negative values in exp_data are ignored as well as non-positive weight_factors. All arrays involved in the computation must be of the same size.
+
+Parameters:
+-----------
+
+sim_data: 
+array with simulated intensities.
+
+exp_data: 
+array with intensity values obtained from an experiment.
+
+weight_factors: 
+user-defined weighting factors. Used linearly, no matter which norm is chosen. 
+";
+
+
 // File: classResolutionFunction2DGaussian.xml
 %feature("docstring") ResolutionFunction2DGaussian "
 
@@ -14127,13 +14524,42 @@ Computes the diffuse reflection from the rough interfaces of a multilayer. Used
 C++ includes: RoughMultiLayerComputation.h
 ";
 
-%feature("docstring")  RoughMultiLayerComputation::RoughMultiLayerComputation "RoughMultiLayerComputation::RoughMultiLayerComputation(const MultiLayer *p_multi_layer, const IFresnelMap *p_fresnel_map)
+%feature("docstring")  RoughMultiLayerComputation::RoughMultiLayerComputation "RoughMultiLayerComputation::RoughMultiLayerComputation(const ProcessedSample *p_sample)
 ";
 
 %feature("docstring")  RoughMultiLayerComputation::compute "void RoughMultiLayerComputation::compute(SimulationElement &elem) const
 ";
 
 
+// File: classRQ4Metric.xml
+%feature("docstring") RQ4Metric "
+
+Implementation of relative difference metric. With default L2 norm and weighting off corresponds to the formula  \\\\[Result = \\\\sum (I \\\\cdot Q^4 - D \\\\cdot Q^4)^2\\\\] where  $Q$ is the scattering vector magnitude. If weighting is on, coincides with the metric provided by  Chi2Metric class.
+
+C++ includes: ObjectiveMetric.h
+";
+
+%feature("docstring")  RQ4Metric::RQ4Metric "RQ4Metric::RQ4Metric()
+";
+
+%feature("docstring")  RQ4Metric::clone "RQ4Metric * RQ4Metric::clone() const override
+";
+
+%feature("docstring")  RQ4Metric::compute "double RQ4Metric::compute(const SimDataPair &data_pair, bool use_weights) const override
+
+Computes metric value from  SimDataPair object. Calls computeFromArrays internally.
+
+Parameters:
+-----------
+
+data_pair: 
+ SimDataPair object. Can optionally contain data uncertainties
+
+use_weights: 
+boolean, defines if data uncertainties should be taken into account 
+";
+
+
 // File: classExceptions_1_1RuntimeErrorException.xml
 %feature("docstring") Exceptions::RuntimeErrorException "";
 
@@ -14157,6 +14583,9 @@ C++ includes: SafePointerVector.h
 %feature("docstring")  SafePointerVector::SafePointerVector "SafePointerVector< T >::SafePointerVector(const SafePointerVector &other)
 ";
 
+%feature("docstring")  SafePointerVector::SafePointerVector "SafePointerVector< T >::SafePointerVector(SafePointerVector &&other)
+";
+
 %feature("docstring")  SafePointerVector::~SafePointerVector "SafePointerVector< T >::~SafePointerVector()
 ";
 
@@ -14557,6 +14986,12 @@ C++ includes: ScanResolution.h
 %feature("docstring")  ScanResolution::generateSamples "virtual DistrOutput ScanResolution::generateSamples(const std::vector< double > &mean) const =0
 ";
 
+%feature("docstring")  ScanResolution::stdDevs "virtual std::vector<double> ScanResolution::stdDevs(double mean, size_t n_times) const =0
+";
+
+%feature("docstring")  ScanResolution::stdDevs "virtual std::vector<double> ScanResolution::stdDevs(const std::vector< double > &mean) const =0
+";
+
 %feature("docstring")  ScanResolution::empty "bool ScanResolution::empty() const
 ";
 
@@ -14566,22 +15001,35 @@ Prints object definition in python format.
 ";
 
 
-// File: classExceptions_1_1SelfReferenceException.xml
-%feature("docstring") Exceptions::SelfReferenceException "";
+// File: classSimDataPair.xml
+%feature("docstring") SimDataPair "
+
+Holds pair of simulation/experimental data to fit.
 
-%feature("docstring")  Exceptions::SelfReferenceException::SelfReferenceException "Exceptions::SelfReferenceException::SelfReferenceException(const std::string &message)
+C++ includes: SimDataPair.h
 ";
 
+%feature("docstring")  SimDataPair::SimDataPair "SimDataPair::SimDataPair(simulation_builder_t builder, const OutputData< double > &data, std::unique_ptr< OutputData< double >> uncertainties, double user_weight=1.0)
+
+Constructs simulation/data pair for later fit.
+
+Parameters:
+-----------
+
+simulation: 
+simulation builder capable of producing simulations
 
-// File: classSimDataPair.xml
-%feature("docstring") SimDataPair "
+data: 
+experimental data
 
-Holds pair of simulation/experimental data to fit.
+uncertainties: 
+uncertainties associated with experimental data
 
-C++ includes: SimDataPair.h
+user_weight: 
+weight of dataset in objective metric computations 
 ";
 
-%feature("docstring")  SimDataPair::SimDataPair "SimDataPair::SimDataPair(simulation_builder_t builder, const OutputData< double > &data, double weight=1.0)
+%feature("docstring")  SimDataPair::SimDataPair "SimDataPair::SimDataPair(simulation_builder_t builder, const OutputData< double > &data, std::unique_ptr< OutputData< double >> uncertainties, std::unique_ptr< OutputData< double >> user_weights)
 
 Constructs simulation/data pair for later fit.
 
@@ -14594,56 +15042,80 @@ simulation builder capable of producing simulations
 data: 
 experimental data
 
-weight: 
-weight of dataset in chi2 calculations 
+uncertainties: 
+uncertainties associated with experimental data
+
+user_weights: 
+user weights associated with experimental data 
 ";
 
-%feature("docstring")  SimDataPair::~SimDataPair "SimDataPair::~SimDataPair() override
+%feature("docstring")  SimDataPair::SimDataPair "SimDataPair::SimDataPair(SimDataPair &&other)
 ";
 
-%feature("docstring")  SimDataPair::clone "SimDataPair * SimDataPair::clone() const override
+%feature("docstring")  SimDataPair::~SimDataPair "SimDataPair::~SimDataPair()
 ";
 
-%feature("docstring")  SimDataPair::numberOfFitElements "size_t SimDataPair::numberOfFitElements() const
+%feature("docstring")  SimDataPair::runSimulation "void SimDataPair::runSimulation(const Fit::Parameters &params)
+";
 
-Returns the size of the data. It is equal to the number of non-masked detector channels which will participate in chi2 calculations. 
+%feature("docstring")  SimDataPair::containsUncertainties "bool SimDataPair::containsUncertainties() const
 ";
 
-%feature("docstring")  SimDataPair::weight "double SimDataPair::weight() const
+%feature("docstring")  SimDataPair::numberOfFitElements "size_t SimDataPair::numberOfFitElements() const
+
+Returns the number of elements in the fit area. 
 ";
 
 %feature("docstring")  SimDataPair::simulationResult "SimulationResult SimDataPair::simulationResult() const
 
-Returns simulation result. 
+Returns the result of last computed simulation. 
 ";
 
 %feature("docstring")  SimDataPair::experimentalData "SimulationResult SimDataPair::experimentalData() const
 
-Returns experimental data. 
+Returns the experimental data cut to the ROI area. 
+";
+
+%feature("docstring")  SimDataPair::uncertainties "SimulationResult SimDataPair::uncertainties() const
+
+Returns the data uncertainties cut to the ROI area If no uncertainties present, returns zero-filled  SimulationResult. 
+";
+
+%feature("docstring")  SimDataPair::userWeights "SimulationResult SimDataPair::userWeights() const
+
+Returns the user uncertainties cut to the ROI area. 
 ";
 
 %feature("docstring")  SimDataPair::relativeDifference "SimulationResult SimDataPair::relativeDifference() const
 
-Returns relative difference between simulation and experimental data. 
+Returns relative difference between simulation and experimental data.
+
+Returns the relative difference between simulated and expeimental data cut to the ROI area 
 ";
 
 %feature("docstring")  SimDataPair::absoluteDifference "SimulationResult SimDataPair::absoluteDifference() const
+
+Returns the absolute difference between simulated and expeimental data cut to the ROI area 
 ";
 
-%feature("docstring")  SimDataPair::runSimulation "void SimDataPair::runSimulation(const Fit::Parameters &params)
+%feature("docstring")  SimDataPair::simulation_array "std::vector< double > SimDataPair::simulation_array() const
+
+Returns the flattened simulated intensities cut to the ROI area 
 ";
 
 %feature("docstring")  SimDataPair::experimental_array "std::vector< double > SimDataPair::experimental_array() const
 
-Returns one dimensional array representing experimental data. Masked areas and the area outside of region of interest are not included. 
+Returns the flattened experimental data cut to the ROI area 
 ";
 
-%feature("docstring")  SimDataPair::simulation_array "std::vector< double > SimDataPair::simulation_array() const
+%feature("docstring")  SimDataPair::uncertainties_array "std::vector< double > SimDataPair::uncertainties_array() const
 
-Returns one dimensional array representing simulated intensities data. Masked areas and the area outside of region of interest are not included. 
+Returns the flattened experimental uncertainties cut to the ROI area. If no uncertainties are available, returns a zero-filled array sized to the ROI area. 
 ";
 
-%feature("docstring")  SimDataPair::weights_array "std::vector< double > SimDataPair::weights_array() const
+%feature("docstring")  SimDataPair::user_weights_array "std::vector< double > SimDataPair::user_weights_array() const
+
+Returns a flat array of user weights cut to the ROI area. 
 ";
 
 
@@ -14756,7 +15228,9 @@ The  MultiLayer object will not be owned by the  Simulation object.
 %feature("docstring")  Simulation::background "const IBackground* Simulation::background() const
 ";
 
-%feature("docstring")  Simulation::numberOfSimulationElements "virtual size_t Simulation::numberOfSimulationElements() const =0
+%feature("docstring")  Simulation::intensityMapSize "virtual size_t Simulation::intensityMapSize() const =0
+
+Returns the total number of the intensity values in the simulation result. 
 ";
 
 %feature("docstring")  Simulation::result "virtual SimulationResult Simulation::result() const =0
@@ -14813,7 +15287,7 @@ C++ includes: Simulation2D.h
 %feature("docstring")  Simulation2D::Simulation2D "Simulation2D::Simulation2D(const std::shared_ptr< IMultiLayerBuilder > p_sample_builder)
 ";
 
-%feature("docstring")  Simulation2D::~Simulation2D "virtual Simulation2D::~Simulation2D()=default
+%feature("docstring")  Simulation2D::~Simulation2D "Simulation2D::~Simulation2D() override=default
 ";
 
 %feature("docstring")  Simulation2D::clone "Simulation2D* Simulation2D::clone() const override=0
@@ -15149,7 +15623,7 @@ C++ includes: SimulationResult.h
 %feature("docstring")  SimulationResult::SimulationResult "SimulationResult::SimulationResult(SimulationResult &&other)
 ";
 
-%feature("docstring")  SimulationResult::data "OutputData< double > * SimulationResult::data(AxesUnits units=AxesUnits::DEFAULT) const
+%feature("docstring")  SimulationResult::data "std::unique_ptr< OutputData< double > > SimulationResult::data(AxesUnits units=AxesUnits::DEFAULT) const
 ";
 
 %feature("docstring")  SimulationResult::histogram2d "Histogram2D * SimulationResult::histogram2d(AxesUnits units=AxesUnits::DEFAULT) const
@@ -15168,7 +15642,7 @@ Returns underlying unit converter.
 %feature("docstring")  SimulationResult::size "size_t SimulationResult::size() const
 ";
 
-%feature("docstring")  SimulationResult::array "PyObject * SimulationResult::array() const
+%feature("docstring")  SimulationResult::array "PyObject * SimulationResult::array(AxesUnits units=AxesUnits::DEFAULT) const
 
 returns intensity data as Python numpy array 
 ";
@@ -15273,6 +15747,60 @@ C++ includes: SlicedCylindersBuilder.h
 ";
 
 
+// File: classSlice.xml
+%feature("docstring") Slice "
+
+Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
+
+C++ includes: Slice.h
+";
+
+%feature("docstring")  Slice::Slice "Slice::Slice(double thickness, const Material &material)
+";
+
+%feature("docstring")  Slice::Slice "Slice::Slice(double thickness, const Material &material, const LayerRoughness &top_roughness)
+";
+
+%feature("docstring")  Slice::Slice "Slice::Slice(const Slice &other)
+";
+
+%feature("docstring")  Slice::Slice "Slice::Slice(Slice &&other)
+";
+
+%feature("docstring")  Slice::~Slice "Slice::~Slice()
+";
+
+%feature("docstring")  Slice::setMaterial "void Slice::setMaterial(const Material &material)
+";
+
+%feature("docstring")  Slice::material "Material Slice::material() const
+";
+
+%feature("docstring")  Slice::thickness "double Slice::thickness() const
+";
+
+%feature("docstring")  Slice::topRoughness "const LayerRoughness * Slice::topRoughness() const
+";
+
+%feature("docstring")  Slice::scalarReducedPotential "complex_t Slice::scalarReducedPotential(kvector_t k, double n_ref) const
+
+Return the potential term that is used in the one-dimensional Fresnel calculations. 
+";
+
+%feature("docstring")  Slice::polarizedReducedPotential "Eigen::Matrix2cd Slice::polarizedReducedPotential(kvector_t k, double n_ref) const
+
+Return the potential term that is used in the one-dimensional Fresnel calculations in the presence of magnetization 
+";
+
+%feature("docstring")  Slice::initBField "void Slice::initBField(kvector_t h_field, double b_z)
+
+Initializes the magnetic B field from a given ambient field strength H. 
+";
+
+%feature("docstring")  Slice::invertBField "void Slice::invertBField()
+";
+
+
 // File: classSlicedCompositionBuilder.xml
 %feature("docstring") SlicedCompositionBuilder "
 
@@ -15379,7 +15907,7 @@ C++ includes: SpecularComputationTerm.h
 %feature("docstring")  SpecularComputationTerm::setProgressHandler "void SpecularComputationTerm::setProgressHandler(ProgressHandler *p_progress)
 ";
 
-%feature("docstring")  SpecularComputationTerm::compute "void SpecularComputationTerm::compute(SpecularSimulationElement &elem, const MultiLayer &sample) const
+%feature("docstring")  SpecularComputationTerm::compute "void SpecularComputationTerm::compute(SpecularSimulationElement &elem, const std::vector< Slice > &slices) const
 ";
 
 
@@ -15431,24 +15959,6 @@ Return default axes units.
 ";
 
 
-// File: classSpecularMagnetic.xml
-%feature("docstring") SpecularMagnetic "
-
-Implements the matrix formalism for the calculation of wave amplitudes of the coherent wave solution in a multilayer with magnetization.
-
-C++ includes: SpecularMagnetic.h
-";
-
-
-// File: classSpecularMatrix.xml
-%feature("docstring") SpecularMatrix "
-
-Implements method 'execute' to compute refraction angles and transmission/reflection coefficients for coherent wave propagation in a multilayer.
-
-C++ includes: SpecularMatrix.h
-";
-
-
 // File: classSpecularSimulation.xml
 %feature("docstring") SpecularSimulation "
 
@@ -15482,9 +15992,6 @@ Put into a clean state for running a simulation.
 Calls the  INodeVisitor's visit method. 
 ";
 
-%feature("docstring")  SpecularSimulation::numberOfSimulationElements "size_t SpecularSimulation::numberOfSimulationElements() const override
-";
-
 %feature("docstring")  SpecularSimulation::result "SimulationResult SpecularSimulation::result() const override
 
 Returns the results of the simulation in a format that supports unit conversion and export to numpy arrays. If simulation was not run, returns an array of proper size filled with zeros. 
@@ -15505,6 +16012,11 @@ Returns a pointer to coordinate axis.
 Returns a pointer to footprint factor holder. 
 ";
 
+%feature("docstring")  SpecularSimulation::intensityMapSize "size_t SpecularSimulation::intensityMapSize() const override
+
+Returns the total number of the intensity values in the simulation result. 
+";
+
 %feature("docstring")  SpecularSimulation::dataHandler "const ISpecularScan* SpecularSimulation::dataHandler() const
 
 Returns internal data handler. 
@@ -15558,7 +16070,7 @@ Set calculation flag (if it's false, zero intensity is assigned to the element)
 %feature("docstring")  SpecularSimulationElement::isCalculated "bool SpecularSimulationElement::isCalculated() const
 ";
 
-%feature("docstring")  SpecularSimulationElement::produceKz "std::vector< complex_t > SpecularSimulationElement::produceKz(const MultiLayer &sample)
+%feature("docstring")  SpecularSimulationElement::produceKz "std::vector< complex_t > SpecularSimulationElement::produceKz(const std::vector< Slice > &slices)
 
 Returns kz values for Abeles computation of reflection/transition coefficients. 
 ";
@@ -15740,10 +16252,10 @@ C++ includes: SSCAHelper.h
 %feature("docstring")  SSCAHelper::SSCAHelper "SSCAHelper::SSCAHelper(double kappa)
 ";
 
-%feature("docstring")  SSCAHelper::init "void SSCAHelper::init(const SafePointerVector< FormFactorCoherentSum > &ff_wrappers)
+%feature("docstring")  SSCAHelper::init "void SSCAHelper::init(const std::vector< FormFactorCoherentSum > &ff_wrappers)
 ";
 
-%feature("docstring")  SSCAHelper::getCharacteristicSizeCoupling "complex_t SSCAHelper::getCharacteristicSizeCoupling(double qp, const SafePointerVector< FormFactorCoherentSum > &ff_wrappers) const
+%feature("docstring")  SSCAHelper::getCharacteristicSizeCoupling "complex_t SSCAHelper::getCharacteristicSizeCoupling(double qp, const std::vector< FormFactorCoherentSum > &ff_wrappers) const
 ";
 
 %feature("docstring")  SSCAHelper::getCharacteristicDistribution "complex_t SSCAHelper::getCharacteristicDistribution(double qp, const IInterferenceFunction *p_iff) const
@@ -15752,10 +16264,10 @@ C++ includes: SSCAHelper.h
 %feature("docstring")  SSCAHelper::calculatePositionOffsetPhase "complex_t SSCAHelper::calculatePositionOffsetPhase(double qp, double radial_extension) const
 ";
 
-%feature("docstring")  SSCAHelper::getMeanFormfactorNorm "complex_t SSCAHelper::getMeanFormfactorNorm(double qp, const std::vector< complex_t > &precomputed_ff, const SafePointerVector< FormFactorCoherentSum > &ff_wrappers) const
+%feature("docstring")  SSCAHelper::getMeanFormfactorNorm "complex_t SSCAHelper::getMeanFormfactorNorm(double qp, const std::vector< complex_t > &precomputed_ff, const std::vector< FormFactorCoherentSum > &ff_wrappers) const
 ";
 
-%feature("docstring")  SSCAHelper::getMeanFormfactors "void SSCAHelper::getMeanFormfactors(double qp, Eigen::Matrix2cd &ff_orig, Eigen::Matrix2cd &ff_conj, const InterferenceFunctionUtils::matrixFFVector_t &precomputed_ff, const SafePointerVector< FormFactorCoherentSum > &ff_wrappers) const
+%feature("docstring")  SSCAHelper::getMeanFormfactors "void SSCAHelper::getMeanFormfactors(double qp, Eigen::Matrix2cd &ff_orig, Eigen::Matrix2cd &ff_conj, const InterferenceFunctionUtils::matrixFFVector_t &precomputed_ff, const std::vector< FormFactorCoherentSum > &ff_wrappers) const
 ";
 
 
@@ -15786,6 +16298,16 @@ C++ includes: TwoDimLatticeBuilder.h
 ";
 
 
+// File: classThickAbsorptiveSampleBuilder.xml
+%feature("docstring") ThickAbsorptiveSampleBuilder "";
+
+%feature("docstring")  ThickAbsorptiveSampleBuilder::ThickAbsorptiveSampleBuilder "ThickAbsorptiveSampleBuilder::ThickAbsorptiveSampleBuilder()
+";
+
+%feature("docstring")  ThickAbsorptiveSampleBuilder::buildSample "MultiLayer * ThickAbsorptiveSampleBuilder::buildSample() const override
+";
+
+
 // File: structThreadInfo.xml
 %feature("docstring") ThreadInfo "
 
@@ -16070,6 +16592,11 @@ Calculates maximum on-axis value in given units.
 Creates axis in converted units. 
 ";
 
+%feature("docstring")  UnitConverter1D::createConvertedData "std::unique_ptr< OutputData< double > > UnitConverter1D::createConvertedData(const OutputData< double > &data, AxesUnits units) const override
+
+Creates  OutputData array in converter units. 
+";
+
 
 // File: classUnitConverterConvSpec.xml
 %feature("docstring") UnitConverterConvSpec "
@@ -16424,10 +16951,10 @@ C++ includes: WavevectorInfo.h
 ";
 
 
-// File: classFourierTransform_1_1Workspace.xml
+// File: classConvolve_1_1Workspace.xml
 
 
-// File: classConvolve_1_1Workspace.xml
+// File: classFourierTransform_1_1Workspace.xml
 
 
 // File: classZLimits.xml
@@ -16457,88 +16984,103 @@ C++ includes: ZLimits.h
 ";
 
 
-// File: namespace_0D107.xml
+// File: namespace_0D104.xml
+
+
+// File: namespace_0D106.xml
+
+
+// File: namespace_0D108.xml
+
+
+// File: namespace_0D112.xml
 
 
 // File: namespace_0D12.xml
 
 
-// File: namespace_0D122.xml
+// File: namespace_0D129.xml
 
 
-// File: namespace_0D131.xml
+// File: namespace_0D138.xml
 
 
-// File: namespace_0D133.xml
+// File: namespace_0D143.xml
 
 
-// File: namespace_0D136.xml
+// File: namespace_0D152.xml
 
 
-// File: namespace_0D18.xml
+// File: namespace_0D154.xml
+
 
+// File: namespace_0D158.xml
 
-// File: namespace_0D189.xml
+
+// File: namespace_0D18.xml
 
 
 // File: namespace_0D20.xml
 
 
-// File: namespace_0D216.xml
+// File: namespace_0D200.xml
 
 
-// File: namespace_0D218.xml
+// File: namespace_0D227.xml
 
 
-// File: namespace_0D230.xml
+// File: namespace_0D235.xml
 
 
-// File: namespace_0D234.xml
+// File: namespace_0D241.xml
 
 
-// File: namespace_0D293.xml
+// File: namespace_0D245.xml
 
 
-// File: namespace_0D301.xml
+// File: namespace_0D295.xml
 
 
-// File: namespace_0D305.xml
+// File: namespace_0D304.xml
 
 
-// File: namespace_0D307.xml
+// File: namespace_0D312.xml
 
 
-// File: namespace_0D319.xml
+// File: namespace_0D316.xml
+
+
+// File: namespace_0D318.xml
 
 
 // File: namespace_0D32.xml
 
 
-// File: namespace_0D325.xml
+// File: namespace_0D330.xml
 
 
-// File: namespace_0D346.xml
+// File: namespace_0D336.xml
 
 
-// File: namespace_0D350.xml
+// File: namespace_0D357.xml
 
 
-// File: namespace_0D352.xml
+// File: namespace_0D361.xml
 
 
-// File: namespace_0D354.xml
+// File: namespace_0D363.xml
 
 
-// File: namespace_0D364.xml
+// File: namespace_0D365.xml
 
 
-// File: namespace_0D379.xml
+// File: namespace_0D375.xml
 
 
-// File: namespace_0D383.xml
+// File: namespace_0D390.xml
 
 
-// File: namespace_0D391.xml
+// File: namespace_0D394.xml
 
 
 // File: namespace_0D40.xml
@@ -16547,52 +17089,55 @@ C++ includes: ZLimits.h
 // File: namespace_0D402.xml
 
 
-// File: namespace_0D404.xml
+// File: namespace_0D413.xml
 
 
-// File: namespace_0D412.xml
+// File: namespace_0D415.xml
 
 
 // File: namespace_0D42.xml
 
 
-// File: namespace_0D425.xml
+// File: namespace_0D423.xml
 
 
-// File: namespace_0D434.xml
+// File: namespace_0D436.xml
 
 
-// File: namespace_0D436.xml
+// File: namespace_0D445.xml
 
 
-// File: namespace_0D470.xml
+// File: namespace_0D447.xml
 
 
-// File: namespace_0D477.xml
+// File: namespace_0D481.xml
 
 
-// File: namespace_0D515.xml
+// File: namespace_0D488.xml
 
 
-// File: namespace_0D523.xml
+// File: namespace_0D526.xml
 
 
-// File: namespace_0D525.xml
+// File: namespace_0D534.xml
 
 
-// File: namespace_0D527.xml
+// File: namespace_0D536.xml
+
+
+// File: namespace_0D538.xml
 
 
 // File: namespace_0D6.xml
 
 
-// File: namespace_0D609.xml
+// File: namespace_0D620.xml
 
 
-// File: namespace_0D613.xml
+// File: namespace_0D624.xml
 
 
-// File: namespace_0D635.xml
+// File: namespace_0D648.xml
 
 
 // File: namespace_0D98.xml
@@ -16604,20 +17149,18 @@ C++ includes: ZLimits.h
 Returns shape nrows, ncols of 2D array. 
 ";
 
-%feature("docstring")  ArrayUtils::createNumpyArray "PyObject * ArrayUtils::createNumpyArray(const std::vector< double > &data)
-";
-
-%feature("docstring")  ArrayUtils::createData1D "decltype(auto) ArrayUtils::createData1D(const T &vec)
+%feature("docstring")  ArrayUtils::createData "CreateDataImpl::ReturnType<T> ArrayUtils::createData(const T &vec)
 
-Creates  OutputData from 1D vector.
+Creates  OutputData array from input vector.
 
 Parameters:
 -----------
 
 vec: 
-std::vector<double>
+input vector 
+";
 
-std::unique_ptr< OutputData<double>> 
+%feature("docstring")  ArrayUtils::createNumpyArray "PyObject * ArrayUtils::createNumpyArray(const std::vector< double > &data)
 ";
 
 %feature("docstring")  ArrayUtils::createVector1D "decltype(auto) ArrayUtils::createVector1D(const T &data)
@@ -16633,19 +17176,6 @@ vec:
 vector<double> 
 ";
 
-%feature("docstring")  ArrayUtils::createData2D "decltype(auto) ArrayUtils::createData2D(const T &vec)
-
-Creates  OutputData from 2D vector.
-
-Parameters:
------------
-
-vec: 
-std::vector<std::vector<double>>
-
-std::unique_ptr< OutputData<double>> 
-";
-
 %feature("docstring")  ArrayUtils::createVector2D "decltype(auto) ArrayUtils::createVector2D(const T &data)
 
 Creates 2D vector from  OutputData.
@@ -16720,21 +17250,11 @@ Returns file extension after stripping '.gz' if any.
 Returns file main extension (without .gz). 
 ";
 
-%feature("docstring")  DataFormatUtils::isBinaryFile "bool DataFormatUtils::isBinaryFile(const std::string &file_name)
-
-returns true if file name corresponds to a binary file 
-";
-
 %feature("docstring")  DataFormatUtils::isIntFile "bool DataFormatUtils::isIntFile(const std::string &file_name)
 
 returns true if file name corresponds to  BornAgain native format (compressed or not) 
 ";
 
-%feature("docstring")  DataFormatUtils::isTxtFile "bool DataFormatUtils::isTxtFile(const std::string &file_name)
-
-returns true if file name corresponds to simple numpy-style ASCII file 
-";
-
 %feature("docstring")  DataFormatUtils::isTiffFile "bool DataFormatUtils::isTiffFile(const std::string &file_name)
 
 returns true if file name corresponds to tiff file (can be also compressed) 
@@ -16843,29 +17363,18 @@ Returns filename without extension(s). \"/home/user/filename.int\" -> \"filename
 Returns file names that agree with a regex glob pattern. 
 ";
 
+%feature("docstring")  FileSystemUtils::convert_utf8_to_utf16 "std::wstring FileSystemUtils::convert_utf8_to_utf16(const std::string &str)
 
-// File: namespaceFit.xml
-
-
-// File: namespaceIComputationUtils.xml
-%feature("docstring")  IComputationUtils::CreateFresnelMap "BA_CORE_API_ std::unique_ptr< IFresnelMap > IComputationUtils::CreateFresnelMap(const MultiLayer &multilayer, const SimulationOptions &sim_options)
-";
-
-%feature("docstring")  IComputationUtils::CreateAveragedMultilayer "BA_CORE_API_ std::unique_ptr< MultiLayer > IComputationUtils::CreateAveragedMultilayer(const MultiLayer &multilayer, const SimulationOptions &sim_options, const std::map< size_t, std::vector< HomogeneousRegion >> &region_map)
-
-creates a multilayer that contains averaged materials, for use in Fresnel calculations 
+Converts utf8 string represented by std::string to utf16 string represented by std::wstring. 
 ";
 
-%feature("docstring")  IComputationUtils::CreateAveragedMultilayer "BA_CORE_API_ std::unique_ptr< MultiLayer > IComputationUtils::CreateAveragedMultilayer(const MultiLayer &multilayer, const SimulationOptions &sim_options)
+%feature("docstring")  FileSystemUtils::IsFileExists "bool FileSystemUtils::IsFileExists(const std::string &str)
 
-overload that calculates the region map itself 
+Returns true if file with given name exists on disk. 
 ";
 
-%feature("docstring")  IComputationUtils::GetRegionMap "BA_CORE_API_ std::map< size_t, std::vector< HomogeneousRegion > > IComputationUtils::GetRegionMap(const MultiLayer &multilayer)
-";
 
-%feature("docstring")  IComputationUtils::MergeRegionMap "BA_CORE_API_ void IComputationUtils::MergeRegionMap(std::map< size_t, std::vector< HomogeneousRegion >> &dest, const std::map< size_t, std::vector< HomogeneousRegion >> &source)
-";
+// File: namespaceFit.xml
 
 
 // File: namespaceINodeUtils.xml
@@ -16969,21 +17478,21 @@ SimulationResult object.
 
 
 // File: namespaceInterferenceFunctionUtils.xml
-%feature("docstring")  InterferenceFunctionUtils::PrecomputeScalarFormFactors "std::vector< complex_t > InterferenceFunctionUtils::PrecomputeScalarFormFactors(const SimulationElement &sim_element, const SafePointerVector< FormFactorCoherentSum > &ff_wrappers)
+%feature("docstring")  InterferenceFunctionUtils::PrecomputeScalarFormFactors "std::vector< complex_t > InterferenceFunctionUtils::PrecomputeScalarFormFactors(const SimulationElement &sim_element, const std::vector< FormFactorCoherentSum > &ff_wrappers)
 ";
 
-%feature("docstring")  InterferenceFunctionUtils::PrecomputePolarizedFormFactors "matrixFFVector_t InterferenceFunctionUtils::PrecomputePolarizedFormFactors(const SimulationElement &sim_element, const SafePointerVector< FormFactorCoherentSum > &ff_wrappers)
+%feature("docstring")  InterferenceFunctionUtils::PrecomputePolarizedFormFactors "matrixFFVector_t InterferenceFunctionUtils::PrecomputePolarizedFormFactors(const SimulationElement &sim_element, const std::vector< FormFactorCoherentSum > &ff_wrappers)
 ";
 
 
 // File: namespaceKzComputation.xml
-%feature("docstring")  KzComputation::computeReducedKz "std::vector< complex_t > KzComputation::computeReducedKz(const MultiLayer &sample, kvector_t k)
+%feature("docstring")  KzComputation::computeReducedKz "std::vector< complex_t > KzComputation::computeReducedKz(const std::vector< Slice > &slices, kvector_t k)
 ";
 
-%feature("docstring")  KzComputation::computeKzFromSLDs "std::vector< complex_t > KzComputation::computeKzFromSLDs(const MultiLayer &sample, double kz)
+%feature("docstring")  KzComputation::computeKzFromSLDs "std::vector< complex_t > KzComputation::computeKzFromSLDs(const std::vector< Slice > &slices, double kz)
 ";
 
-%feature("docstring")  KzComputation::computeKzFromRefIndeces "std::vector< complex_t > KzComputation::computeKzFromRefIndeces(const MultiLayer &sample, kvector_t k)
+%feature("docstring")  KzComputation::computeKzFromRefIndices "std::vector< complex_t > KzComputation::computeKzFromRefIndices(const std::vector< Slice > &slices, kvector_t k)
 ";
 
 
@@ -17014,7 +17523,7 @@ Function for calculating the reduced potential, used for obtaining the Fresnel c
 Utility to compute magnetization correction for reduced potential and scattering length density. 
 ";
 
-%feature("docstring")  MaterialUtils::checkMaterialTypes "MATERIAL_TYPES MaterialUtils::checkMaterialTypes(const std::vector< const Material * > &materials)
+%feature("docstring")  MaterialUtils::checkMaterialTypes "MATERIAL_TYPES MaterialUtils::checkMaterialTypes(const std::vector< const Material *> &materials)
 
 Checks if all non-default materials in  materials are of the same type and returns this type. If several types of materials are involved, InvalidMaterialType identifier is returned. 
 ";
@@ -17146,6 +17655,43 @@ convolution of two real vectors of equal size
 ";
 
 
+// File: namespaceMultiLayerUtils.xml
+%feature("docstring")  MultiLayerUtils::LayerThickness "double MultiLayerUtils::LayerThickness(const MultiLayer &multilayer, size_t i)
+
+Returns thickness of layer. 
+";
+
+%feature("docstring")  MultiLayerUtils::LayerTopInterface "const LayerInterface * MultiLayerUtils::LayerTopInterface(const MultiLayer &multilayer, size_t i)
+
+Returns top interface of layer. 
+";
+
+%feature("docstring")  MultiLayerUtils::LayerBottomInterface "const LayerInterface * MultiLayerUtils::LayerBottomInterface(const MultiLayer &multilayer, size_t i)
+
+Returns bottom interface of layer. 
+";
+
+%feature("docstring")  MultiLayerUtils::LayerTopRoughness "const LayerRoughness * MultiLayerUtils::LayerTopRoughness(const MultiLayer &multilayer, size_t i)
+
+Returns top roughness of layer. 
+";
+
+%feature("docstring")  MultiLayerUtils::IndexOfLayer "size_t MultiLayerUtils::IndexOfLayer(const MultiLayer &multilayer, const Layer *p_layer)
+
+Returns the index of the given layer. 
+";
+
+%feature("docstring")  MultiLayerUtils::ContainsCompatibleMaterials "bool MultiLayerUtils::ContainsCompatibleMaterials(const MultiLayer &multilayer)
+
+Returns true if the multilayer contains non-default materials of one type only. 
+";
+
+%feature("docstring")  MultiLayerUtils::ParticleRegions "std::vector< ZLimits > MultiLayerUtils::ParticleRegions(const MultiLayer &multilayer, bool use_slicing)
+
+Calculate z-regions occupied by particles. 
+";
+
+
 // File: namespaceNodeUtils.xml
 %feature("docstring")  NodeUtils::nodeToString "std::string NodeUtils::nodeToString(const INode &node)
 
@@ -17180,6 +17726,53 @@ Returns the difference of the logarithm; input values are truncated at the minim
 ";
 
 
+// File: namespaceObjectiveMetricUtils.xml
+%feature("docstring")  ObjectiveMetricUtils::l1Norm "const std::function< double(double)> ObjectiveMetricUtils::l1Norm()
+
+Returns L1 normalization function. 
+";
+
+%feature("docstring")  ObjectiveMetricUtils::l2Norm "const std::function< double(double)> ObjectiveMetricUtils::l2Norm()
+
+Returns L2 normalization function. 
+";
+
+%feature("docstring")  ObjectiveMetricUtils::createMetric "std::unique_ptr< ObjectiveMetric > ObjectiveMetricUtils::createMetric(const std::string &metric)
+
+Creates the specified metric with the default norm. 
+";
+
+%feature("docstring")  ObjectiveMetricUtils::createMetric "std::unique_ptr< ObjectiveMetric > ObjectiveMetricUtils::createMetric(std::string metric, std::string norm)
+
+Creates the metric with the specified norm. 
+";
+
+%feature("docstring")  ObjectiveMetricUtils::availableMetricOptions "std::string ObjectiveMetricUtils::availableMetricOptions()
+
+Prints available metric options. 
+";
+
+%feature("docstring")  ObjectiveMetricUtils::normNames "std::vector< std::string > ObjectiveMetricUtils::normNames()
+
+Returns the names of the norms used by  ObjectiveMetric. 
+";
+
+%feature("docstring")  ObjectiveMetricUtils::metricNames "std::vector< std::string > ObjectiveMetricUtils::metricNames()
+
+Returns the names of the objective metrics used. 
+";
+
+%feature("docstring")  ObjectiveMetricUtils::defaultNormName "std::string ObjectiveMetricUtils::defaultNormName()
+
+Returns default norm name. 
+";
+
+%feature("docstring")  ObjectiveMetricUtils::defaultMetricName "std::string ObjectiveMetricUtils::defaultMetricName()
+
+Returns default metric name. 
+";
+
+
 // File: namespaceParameterUtils.xml
 %feature("docstring")  ParameterUtils::isAngleRelated "bool ParameterUtils::isAngleRelated(const std::string &par_name)
 
@@ -17211,10 +17804,12 @@ Returns units of main parameter.
 // File: namespacePyArrayImport.xml
 %feature("docstring")  PyArrayImport::importArrayToOutputData "OutputData< double > * PyArrayImport::importArrayToOutputData(const std::vector< double > &vec)
 
-Provides functionality for importing 1D or 2D arrays of doubles from python into  OutputData. 
+for importing 1D array of doubles from python into  OutputData
 ";
 
 %feature("docstring")  PyArrayImport::importArrayToOutputData "OutputData< double > * PyArrayImport::importArrayToOutputData(const std::vector< std::vector< double >> &vec)
+
+for importing 2D array of doubles from python into  OutputData
 ";
 
 
@@ -17385,6 +17980,25 @@ Returns a string of blanks with given width. By default the width equals standar
 ";
 
 
+// File: namespaceSpecularMagnetic.xml
+%feature("docstring")  SpecularMagnetic::Execute "void SpecularMagnetic::Execute(const std::vector< Slice > &slices, const kvector_t k, std::vector< MatrixRTCoefficients > &coeff)
+
+Computes refraction angle reflection/transmission coefficients for given sliced multilayer and wavevector k 
+";
+
+
+// File: namespaceSpecularMatrix.xml
+%feature("docstring")  SpecularMatrix::Execute "std::vector< ScalarRTCoefficients > SpecularMatrix::Execute(const std::vector< Slice > &slices, kvector_t k)
+
+Computes refraction angles and transmission/reflection coefficients for given coherent wave propagation in a multilayer. Roughness is modelled by tanh profile [see e.g. Phys. Rev. B, vol. 47 (8), p. 4385 (1993)]. 
+";
+
+%feature("docstring")  SpecularMatrix::Execute "std::vector< ScalarRTCoefficients > SpecularMatrix::Execute(const std::vector< Slice > &slices, const std::vector< complex_t > &kz)
+
+Computes transmission/reflection coefficients for given set of z-components of wave-vectors in a multilayer. Roughness is modelled by tanh profile [see e.g. Phys. Rev. B, vol. 47 (8), p. 4385 (1993)]. 
+";
+
+
 // File: namespaceStandardSimulations.xml
 %feature("docstring")  StandardSimulations::PolarizedDWBAMagCylinders2 "GISASSimulation * StandardSimulations::PolarizedDWBAMagCylinders2()
 ";
@@ -17508,6 +18122,11 @@ GISAS simulation with rectangular detector, region of interest and mask.
 Simulation with fitting.  Beam intensity set to provide reasonably large values in detector channels. 
 ";
 
+%feature("docstring")  StandardSimulations::ExtraLongWavelengthGISAS "GISASSimulation * StandardSimulations::ExtraLongWavelengthGISAS()
+
+GISAS simulation with an extra long wavelength. 
+";
+
 %feature("docstring")  StandardSimulations::BasicSpecular "SpecularSimulation * StandardSimulations::BasicSpecular()
 ";
 
@@ -17526,9 +18145,6 @@ Simulation with fitting.  Beam intensity set to provide reasonably large values
 %feature("docstring")  StandardSimulations::SpecularDivergentBeam "SpecularSimulation * StandardSimulations::SpecularDivergentBeam()
 ";
 
-%feature("docstring")  StandardSimulations::SpecularDivergentBeamCopy "SpecularSimulation * StandardSimulations::SpecularDivergentBeamCopy()
-";
-
 %feature("docstring")  StandardSimulations::TOFRWithRelativeResolution "SpecularSimulation * StandardSimulations::TOFRWithRelativeResolution()
 ";
 
@@ -17905,13 +18521,10 @@ global helper function for comparison of axes
 // File: IComputation_8h.xml
 
 
-// File: IComputationUtils_8cpp.xml
+// File: MultiLayerUtils_8cpp.xml
 
 
-// File: IComputationUtils_8h.xml
-
-
-// File: MultilayerInfo_8h.xml
+// File: MultiLayerUtils_8h.xml
 
 
 // File: ParticleLayoutComputation_8cpp.xml
@@ -17926,6 +18539,24 @@ global helper function for comparison of axes
 // File: PoissonNoiseBackground_8h.xml
 
 
+// File: ProcessedLayout_8cpp.xml
+
+
+// File: ProcessedLayout_8h.xml
+
+
+// File: ProcessedSample_8cpp.xml
+
+
+// File: ProcessedSample_8h.xml
+
+
+// File: ProfileHelper_8cpp.xml
+
+
+// File: ProfileHelper_8h.xml
+
+
 // File: ProgressHandler_8cpp.xml
 
 
@@ -17938,6 +18569,12 @@ global helper function for comparison of axes
 // File: RoughMultiLayerComputation_8h.xml
 
 
+// File: Slice_8cpp.xml
+
+
+// File: Slice_8h.xml
+
+
 // File: SpecularComputation_8cpp.xml
 
 
@@ -18046,6 +18683,18 @@ global helper function for comparison of axes
 // File: IterationInfo_8h.xml
 
 
+// File: ObjectiveMetric_8cpp.xml
+
+
+// File: ObjectiveMetric_8h.xml
+
+
+// File: ObjectiveMetricUtils_8cpp.xml
+
+
+// File: ObjectiveMetricUtils_8h.xml
+
+
 // File: PyFittingCallbacks_8cpp.xml
 
 
@@ -18863,13 +19512,9 @@ Creates averaged material. Square refractive index of returned material is arith
 
 
 // File: LayoutStrategyBuilder_8cpp.xml
-%feature("docstring")  ScaleRegionMap "void ScaleRegionMap(std::map< size_t, std::vector< HomogeneousRegion >> &region_map, double factor)
-";
 
 
 // File: LayoutStrategyBuilder_8h.xml
-%feature("docstring")  ScaleRegionMap "void ScaleRegionMap(std::map< size_t, std::vector< HomogeneousRegion >> &region_map, double factor)
-";
 
 
 // File: MatrixFresnelMap_8cpp.xml
@@ -18890,10 +19535,38 @@ Creates averaged material. Square refractive index of returned material is arith
 // File: MultiLayer_8h.xml
 
 
-// File: MultiLayerSlicer_8cpp.xml
+// File: MultiLayerFuncs_8cpp.xml
+%feature("docstring")  MaterialProfile "std::vector<complex_t> MaterialProfile(const MultiLayer &multilayer, int n_points, double z_min, double z_max)
+
+Calculate average material profile for given multilayer 
+";
+
+%feature("docstring")  DefaultMaterialProfileLimits "std::pair<double, double> DefaultMaterialProfileLimits(const MultiLayer &multilayer)
+
+Get default z limits for generating a material profile. 
+";
+
+%feature("docstring")  GenerateZValues "std::vector<double> GenerateZValues(int n_points, double z_min, double z_max)
+
+Generate z values (equidistant) for use in MaterialProfile. 
+";
+
+
+// File: MultiLayerFuncs_8h.xml
+%feature("docstring")  MaterialProfile "BA_CORE_API_ std::vector<complex_t> MaterialProfile(const MultiLayer &multilayer, int n_points, double z_min, double z_max)
+
+Calculate average material profile for given multilayer 
+";
 
+%feature("docstring")  DefaultMaterialProfileLimits "BA_CORE_API_ std::pair<double, double> DefaultMaterialProfileLimits(const MultiLayer &multilayer)
 
-// File: MultiLayerSlicer_8h.xml
+Get default z limits for generating a material profile. 
+";
+
+%feature("docstring")  GenerateZValues "BA_CORE_API_ std::vector<double> GenerateZValues(int n_points, double z_min, double z_max)
+
+Generate z values (equidistant) for use in MaterialProfile. 
+";
 
 
 // File: ScalarFresnelMap_8cpp.xml
@@ -19634,6 +20307,12 @@ Generate vertices of centered ellipse with given semi-axes at height z.
 // File: StandardSimulations_8h.xml
 
 
+// File: ThickAbsorptiveSampleBuilder_8cpp.xml
+
+
+// File: ThickAbsorptiveSampleBuilder_8h.xml
+
+
 // File: TransformationsBuilder_8cpp.xml
 
 
diff --git a/auto/Wrap/doxygen_fit.i b/auto/Wrap/doxygen_fit.i
index 0739b4fb73afff084d6b95cff6a194711389bb32..86d5c9a639553114defeb58a2ad1c54c2fe869f7 100644
--- a/auto/Wrap/doxygen_fit.i
+++ b/auto/Wrap/doxygen_fit.i
@@ -97,11 +97,11 @@ C++ includes: GeneticMinimizer.h
 ";
 
 %feature("docstring")  GeneticMinimizer::~GeneticMinimizer "GeneticMinimizer::~GeneticMinimizer()
-
-Sets tolerance on the function value at the minimum. Minimization will stop when the estimated vertical distance to the minimum (EDM) is less than 0.001*tolerance*ErrorDef. Here ErrorDef=1.0 for chi squared fit and ErrorDef=0.5 for negative log likelihood fit. 
 ";
 
 %feature("docstring")  GeneticMinimizer::setTolerance "void GeneticMinimizer::setTolerance(double value)
+
+Sets tolerance on the function value at the minimum. Minimization will stop when the estimated vertical distance to the minimum (EDM) is less than 0.001*tolerance*ErrorDef. Here ErrorDef=1.0 for chi squared fit and ErrorDef=0.5 for negative log likelihood fit. 
 ";
 
 %feature("docstring")  GeneticMinimizer::tolerance "double GeneticMinimizer::tolerance() const
@@ -161,12 +161,12 @@ C++ includes: GSLLevenbergMarquardtMinimizer.h
 %feature("docstring")  GSLLevenbergMarquardtMinimizer::GSLLevenbergMarquardtMinimizer "GSLLevenbergMarquardtMinimizer::GSLLevenbergMarquardtMinimizer()
 ";
 
-%feature("docstring")  GSLLevenbergMarquardtMinimizer::~GSLLevenbergMarquardtMinimizer "GSLLevenbergMarquardtMinimizer::~GSLLevenbergMarquardtMinimizer()
-
-Sets tolerance on the function value at the minimum. 
+%feature("docstring")  GSLLevenbergMarquardtMinimizer::~GSLLevenbergMarquardtMinimizer "GSLLevenbergMarquardtMinimizer::~GSLLevenbergMarquardtMinimizer() override
 ";
 
 %feature("docstring")  GSLLevenbergMarquardtMinimizer::setTolerance "void GSLLevenbergMarquardtMinimizer::setTolerance(double value)
+
+Sets tolerance on the function value at the minimum. 
 ";
 
 %feature("docstring")  GSLLevenbergMarquardtMinimizer::tolerance "double GSLLevenbergMarquardtMinimizer::tolerance() const
@@ -198,6 +198,11 @@ Returns string representation of current minimizer status.
 Returns map of string representing different minimizer statuses. 
 ";
 
+%feature("docstring")  GSLLevenbergMarquardtMinimizer::requiresResiduals "bool GSLLevenbergMarquardtMinimizer::requiresResiduals() override
+
+Returns true if minimizer computations are residual-based, false otherwise. 
+";
+
 
 // File: classGSLMultiMinimizer.xml
 %feature("docstring") GSLMultiMinimizer "
@@ -306,6 +311,11 @@ Returns minimum function value.
 Sets option string to the minimizer. 
 ";
 
+%feature("docstring")  IMinimizer::requiresResiduals "virtual bool IMinimizer::requiresResiduals()
+
+Returns true if minimizer computations are residual-based, false otherwise. 
+";
+
 
 // File: classInfoItem.xml
 %feature("docstring") InfoItem "
@@ -554,19 +564,19 @@ Sets error definition factor for parameter error calculation. If objective funct
 ";
 
 %feature("docstring")  Minuit2Minimizer::errorDefinition "double Minuit2Minimizer::errorDefinition() const
-
-Sets tolerance on the function value at the minimum. Minimization will stop when the estimated vertical distance to the minimum (EDM) is less than 0.001*tolerance*ErrorDef. Here ErrorDef=1.0 for chi squared fit and ErrorDef=0.5 for negative log likelihood fit. 
 ";
 
 %feature("docstring")  Minuit2Minimizer::setTolerance "void Minuit2Minimizer::setTolerance(double value)
+
+Sets tolerance on the function value at the minimum. Minimization will stop when the estimated vertical distance to the minimum (EDM) is less than 0.001*tolerance*ErrorDef. Here ErrorDef=1.0 for chi squared fit and ErrorDef=0.5 for negative log likelihood fit. 
 ";
 
 %feature("docstring")  Minuit2Minimizer::tolerance "double Minuit2Minimizer::tolerance() const
-
-Sets relative floating point arithmetic precision. Should be adjusted when the user knows that objectiove function value is not calculated to the nominal machine accuracy. Typical values are between 10^-5 and 10^-14. 
 ";
 
 %feature("docstring")  Minuit2Minimizer::setPrecision "void Minuit2Minimizer::setPrecision(double value)
+
+Sets relative floating point arithmetic precision. Should be adjusted when the user knows that objectiove function value is not calculated to the nominal machine accuracy. Typical values are between 10^-5 and 10^-14. 
 ";
 
 %feature("docstring")  Minuit2Minimizer::precision "double Minuit2Minimizer::precision() const
@@ -598,6 +608,11 @@ Returns string representation of current minimizer status.
 Returns map of string representing different minimizer statuses. 
 ";
 
+%feature("docstring")  Minuit2Minimizer::requiresResiduals "bool Minuit2Minimizer::requiresResiduals() override
+
+Returns true if minimizer computations are residual-based, false otherwise. 
+";
+
 
 // File: classMultiOption.xml
 %feature("docstring") MultiOption "
@@ -1138,7 +1153,7 @@ C++ includes: SimAnMinimizer.h
 %feature("docstring")  SimAnMinimizer::SimAnMinimizer "SimAnMinimizer::SimAnMinimizer()
 ";
 
-%feature("docstring")  SimAnMinimizer::~SimAnMinimizer "SimAnMinimizer::~SimAnMinimizer()
+%feature("docstring")  SimAnMinimizer::~SimAnMinimizer "SimAnMinimizer::~SimAnMinimizer() override
 ";
 
 %feature("docstring")  SimAnMinimizer::setPrintLevel "void SimAnMinimizer::setPrintLevel(int value)
@@ -1210,9 +1225,6 @@ Sets Boltzmann distribution parameter: minimal temperature.
 Returns map of string representing different minimizer statuses. 
 ";
 
-%feature("docstring")  SimAnMinimizer::isGradientBasedAgorithm "bool SimAnMinimizer::isGradientBasedAgorithm() override
-";
-
 
 // File: classTestMinimizer.xml
 %feature("docstring") TestMinimizer "
diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py
index 022acaa34ebf9d49b0b95164cc1be94db16ed556..9dcdc13b890293c41cd95f02299fe1a9a007b4d2 100644
--- a/auto/Wrap/libBornAgainCore.py
+++ b/auto/Wrap/libBornAgainCore.py
@@ -6389,7 +6389,7 @@ class FitObjective(_object):
     """
 
 
-    Main class to hold pairs of simulation Holds vector of FitObject's (simulation and real data) to fit
+    Holds vector of   SimDataPairs (experimental data and simulation results) for use in fitting.
 
     C++ includes: FitObjective.h
 
@@ -6457,13 +6457,7 @@ class FitObjective(_object):
 
         SimulationResult FitObjective::simulationResult(size_t i_item=0) const
 
-        Returns simulation result.
-
-        Parameters:
-        -----------
-
-        i_item: 
-        the index of fit pair 
+        Returns simulation result in the form of  SimulationResult. 
 
         """
         return _libBornAgainCore.FitObjective_simulationResult(self, i_item)
@@ -6476,13 +6470,7 @@ class FitObjective(_object):
 
         SimulationResult FitObjective::experimentalData(size_t i_item=0) const
 
-        Returns experimental data.
-
-        Parameters:
-        -----------
-
-        i_item: 
-        the index of fit pair 
+        Returns experimental data in the form of  SimulationResult. 
 
         """
         return _libBornAgainCore.FitObjective_experimentalData(self, i_item)
@@ -6492,6 +6480,11 @@ class FitObjective(_object):
         """
         uncertaintyData_cpp(FitObjective self, size_t i_item=0) -> SimulationResult
         uncertaintyData_cpp(FitObjective self) -> SimulationResult
+
+        SimulationResult FitObjective::uncertaintyData(size_t i_item=0) const
+
+        Returns experimental data uncertainties in the form of  SimulationResult. 
+
         """
         return _libBornAgainCore.FitObjective_uncertaintyData_cpp(self, i_item)
 
@@ -6503,13 +6496,7 @@ class FitObjective(_object):
 
         SimulationResult FitObjective::relativeDifference(size_t i_item=0) const
 
-        Returns relative difference between simulation and experimental data.
-
-        Parameters:
-        -----------
-
-        i_item: 
-        the index of fit pair 
+        Returns relative difference between simulation and experimental data in the form of  SimulationResult. 
 
         """
         return _libBornAgainCore.FitObjective_relativeDifference(self, i_item)
@@ -6522,13 +6509,7 @@ class FitObjective(_object):
 
         SimulationResult FitObjective::absoluteDifference(size_t i_item=0) const
 
-        Returns absolute value of difference between simulation and experimental data.
-
-        Parameters:
-        -----------
-
-        i_item: 
-        the index of fit pair 
+        Returns absolute value of difference between simulation and experimental data in the form of  SimulationResult. 
 
         """
         return _libBornAgainCore.FitObjective_absoluteDifference(self, i_item)
@@ -6540,7 +6521,7 @@ class FitObjective(_object):
 
         std::vector< double > FitObjective::experimental_array() const
 
-        Returns one dimensional array representing experimental data. Masked areas and the area outside of region of interest are not included. Data from different datasets merged together. 
+        Returns one dimensional array representing merged experimental data. The area outside of the region of interest is not included, masked data is nullified. 
 
         """
         return _libBornAgainCore.FitObjective_experimental_array(self)
@@ -6552,14 +6533,21 @@ class FitObjective(_object):
 
         std::vector< double > FitObjective::simulation_array() const
 
-        Returns one dimensional array representing simulated intensities data. Masked areas and the area outside of region of interest are not included. Data from different datasets merged together. 
+        Returns one dimensional array representing merged simulated intensities data. The area outside of the region of interest is not included, masked data is nullified. 
 
         """
         return _libBornAgainCore.FitObjective_simulation_array(self)
 
 
     def uncertainties_cpp(self):
-        """uncertainties_cpp(FitObjective self) -> vdouble1d_t"""
+        """
+        uncertainties_cpp(FitObjective self) -> vdouble1d_t
+
+        std::vector< double > FitObjective::uncertainties() const
+
+        Returns one-dimensional array representing merged data uncertainties. The area outside of the region of interest is not included, masked data is nullified. 
+
+        """
         return _libBornAgainCore.FitObjective_uncertainties_cpp(self)
 
 
@@ -6569,7 +6557,7 @@ class FitObjective(_object):
 
         std::vector< double > FitObjective::weights_array() const
 
-        Returns one dimensional array representing weights of bin intensity for residuals. 
+        Returns one-dimensional array representing merged user weights. The area outside of the region of interest is not included, masked data is nullified. 
 
         """
         return _libBornAgainCore.FitObjective_weights_array(self)
@@ -6597,7 +6585,7 @@ class FitObjective(_object):
         """
         initPlot_cpp(FitObjective self, int every_nth, PyObserverCallback callback)
 
-        void FitObjective::initPlot(int every_nth, PyObserverCallback &callback)
+        void FitObjective::initPlot(int every_nth, fit_observer_t observer)
 
         """
         return _libBornAgainCore.FitObjective_initPlot_cpp(self, every_nth, callback)
@@ -6669,17 +6657,34 @@ class FitObjective(_object):
         """
         setObjectiveMetric(FitObjective self, std::string const & metric)
         setObjectiveMetric(FitObjective self, std::string const & metric, std::string const & norm)
+
+        void FitObjective::setObjectiveMetric(std::unique_ptr< ObjectiveMetric > metric)
+
         """
         return _libBornAgainCore.FitObjective_setObjectiveMetric(self, *args)
 
 
     def containsUncertainties_cpp(self, i_item):
-        """containsUncertainties_cpp(FitObjective self, size_t i_item) -> bool"""
+        """
+        containsUncertainties_cpp(FitObjective self, size_t i_item) -> bool
+
+        bool FitObjective::containsUncertainties(size_t i_item) const
+
+        Returns true if the specified DataPair element contains uncertainties. 
+
+        """
         return _libBornAgainCore.FitObjective_containsUncertainties_cpp(self, i_item)
 
 
     def allPairsHaveUncertainties_cpp(self):
-        """allPairsHaveUncertainties_cpp(FitObjective self) -> bool"""
+        """
+        allPairsHaveUncertainties_cpp(FitObjective self) -> bool
+
+        bool FitObjective::allPairsHaveUncertainties() const
+
+        Returns true if all the data pairs in  FitObjective instance contain uncertainties. 
+
+        """
         return _libBornAgainCore.FitObjective_allPairsHaveUncertainties_cpp(self)
 
 
@@ -6700,7 +6705,24 @@ class FitObjective(_object):
         addSimulationAndData_cpp(FitObjective self, PyBuilderCallback callback, vdouble2d_t data, vdouble2d_t uncertainties, double weight=1.0)
         addSimulationAndData_cpp(FitObjective self, PyBuilderCallback callback, vdouble2d_t data, vdouble2d_t uncertainties)
 
-        void FitObjective::addSimulationAndData(PyBuilderCallback &callback, const std::vector< std::vector< double >> &data, double weight=1.0)
+        void FitObjective::addSimulationAndData(PyBuilderCallback &callback, const T &data, const T &uncertainties, double weight=1.0)
+
+        Constructs simulation/data pair for later fit.
+
+        Parameters:
+        -----------
+
+        callback: 
+        simulation builder capable of producing simulations
+
+        data: 
+        experimental data array
+
+        uncertainties: 
+        data uncertainties array
+
+        weight: 
+        weight of dataset in metric calculations 
 
         """
         return _libBornAgainCore.FitObjective_addSimulationAndData_cpp(self, *args)
@@ -11586,10 +11608,7 @@ class PolyhedralFace(_object):
         -----------
 
         V: 
-        oriented vertex list
-
-        _sym_S2: 
-        true if face has a perpedicular two-fold symmetry axis 
+        oriented vertex list 
 
         """
         this = _libBornAgainCore.new_PolyhedralFace(*args)
@@ -16318,7 +16337,7 @@ class IFootprintFactor(ICloneable, INode):
     """
 
 
-    Defines the base for classes to calculate beam footprint factor
+    Abstract base for classes that calculate the beam footprint factor
 
     C++ includes: IFootprintFactor.h
 
@@ -16772,7 +16791,14 @@ class Simulation(ICloneable, INode):
 
 
     def intensityMapSize(self):
-        """intensityMapSize(Simulation self) -> size_t"""
+        """
+        intensityMapSize(Simulation self) -> size_t
+
+        virtual size_t Simulation::intensityMapSize() const =0
+
+        Returns the total number of the intensity values in the simulation result. 
+
+        """
         return _libBornAgainCore.Simulation_intensityMapSize(self)
 
 
@@ -17303,7 +17329,14 @@ class GISASSimulation(Simulation2D):
 
 
     def intensityMapSize(self):
-        """intensityMapSize(GISASSimulation self) -> size_t"""
+        """
+        intensityMapSize(GISASSimulation self) -> size_t
+
+        size_t GISASSimulation::intensityMapSize() const override
+
+        Returns the total number of the intensity values in the simulation result. 
+
+        """
         return _libBornAgainCore.GISASSimulation_intensityMapSize(self)
 
 GISASSimulation_swigregister = _libBornAgainCore.GISASSimulation_swigregister
@@ -18348,7 +18381,7 @@ class SimulationResult(_object):
         array(SimulationResult self, AxesUnits units) -> PyObject
         array(SimulationResult self) -> PyObject *
 
-        PyObject * SimulationResult::array() const
+        PyObject * SimulationResult::array(AxesUnits units=AxesUnits::DEFAULT) const
 
         returns intensity data as Python numpy array 
 
@@ -19217,7 +19250,14 @@ class ILayout(ISample):
 
 
     def interferenceFunction(self):
-        """interferenceFunction(ILayout self) -> IInterferenceFunction"""
+        """
+        interferenceFunction(ILayout self) -> IInterferenceFunction
+
+        virtual const IInterferenceFunction* ILayout::interferenceFunction() const =0
+
+        Returns the interference function. 
+
+        """
         return _libBornAgainCore.ILayout_interferenceFunction(self)
 
 
@@ -19471,7 +19511,14 @@ IParameterReal_swigregister = _libBornAgainCore.IParameterReal_swigregister
 IParameterReal_swigregister(IParameterReal)
 
 class ParticleLimits(_object):
-    """Proxy of C++ ParticleLimits class."""
+    """
+
+
+    Vertical extension of a particle, specified by bottom and top z coordinate.
+
+    C++ includes: IParticle.h
+
+    """
 
     __swig_setmethods__ = {}
     __setattr__ = lambda self, name, value: _swig_setattr(self, ParticleLimits, name, value)
@@ -19488,7 +19535,16 @@ class ParticleLimits(_object):
         m_top = _swig_property(_libBornAgainCore.ParticleLimits_m_top_get, _libBornAgainCore.ParticleLimits_m_top_set)
 
     def __init__(self):
-        """__init__(ParticleLimits self) -> ParticleLimits"""
+        """
+        __init__(ParticleLimits self) -> ParticleLimits
+
+
+
+        Vertical extension of a particle, specified by bottom and top z coordinate.
+
+        C++ includes: IParticle.h
+
+        """
         this = _libBornAgainCore.new_ParticleLimits()
         try:
             self.this.append(this)
@@ -23494,7 +23550,7 @@ class MillerIndex(_object):
     """
 
 
-    MillerIndex represents arbitrary directions in reciprocal space by allowing floating point index values
+    A direction in reciprocal space, specified by double-valued indices hkl.
 
     C++ includes: ILatticeOrientation.h
 
@@ -23536,7 +23592,14 @@ MillerIndex_swigregister = _libBornAgainCore.MillerIndex_swigregister
 MillerIndex_swigregister(MillerIndex)
 
 class MillerIndexOrientation(ILatticeOrientation):
-    """Proxy of C++ MillerIndexOrientation class."""
+    """
+
+
+    Specifies a rotation of a lattice through the Miller indices of two coordinate axes.
+
+    C++ includes: ILatticeOrientation.h
+
+    """
 
     __swig_setmethods__ = {}
     for _s in [ILatticeOrientation]:
@@ -23557,6 +23620,8 @@ class MillerIndexOrientation(ILatticeOrientation):
 
         MillerIndexOrientation::MillerIndexOrientation(QComponent q1, MillerIndex index1, QComponent q2, MillerIndex index2)
 
+        This constructor is best explained by an example. Arguments QX, (1,1,0), QY, (0,2,1) mean: Rotate the lattice such that the axis [110] points into x direction, and the axis [021], projected into the yz plane, points into z direction. 
+
         """
         this = _libBornAgainCore.new_MillerIndexOrientation(q1, index1, q2, index2)
         try:
@@ -25224,7 +25289,7 @@ class MultiLayer(ISample):
 
     Our sample model: a stack of layers one below the other.Example of system of 4 layers (3 interfaces):
 
-    ambience layer #0 z=getLayerBottomZ(0)=0.0 ------ interface #0 Fe, 20A layer #1 z=getLayerBottomZ(1)=-20.0 ------ interface #1 Cr, 40A layer #2 z=getLayerBottomZ(2)=-60.0 ------ interface #2 substrate layer #3 z=getLayerBottomZ(3)=-60.0
+    ambience layer #0 ------ interface #0 z=0.0 Fe, 20A layer #1 ------ interface #1 z=-20.0 Cr, 40A layer #2 ------ interface #2 z=-60.0 substrate layer #3
 
     C++ includes: MultiLayer.h
 
@@ -25261,7 +25326,7 @@ class MultiLayer(ISample):
 
         MultiLayer * MultiLayer::clone() const final override
 
-        Returns a clone of multilayer with clones of all layers and recreated interfaces between layers 
+        Returns a clone of multilayer with clones of all layers and interfaces between layers 
 
         """
         return _libBornAgainCore.MultiLayer_clone(self)
@@ -25319,7 +25384,7 @@ class MultiLayer(ISample):
         """
         layer(MultiLayer self, size_t i_layer) -> Layer
 
-        const Layer* MultiLayer::layer(size_t i_layer) const
+        const Layer * MultiLayer::layer(size_t i_layer) const
 
         Returns layer with given index. 
 
@@ -25331,9 +25396,9 @@ class MultiLayer(ISample):
         """
         layerInterface(MultiLayer self, size_t i_interface) -> LayerInterface const *
 
-        const LayerInterface* MultiLayer::layerInterface(size_t i_interface) const
+        const LayerInterface * MultiLayer::layerInterface(size_t i_interface) const
 
-        Returns layer with given index. 
+        Returns interface with given index. 
 
         """
         return _libBornAgainCore.MultiLayer_layerInterface(self, i_interface)
@@ -25403,15 +25468,36 @@ MultiLayer_swigregister(MultiLayer)
 
 
 def MaterialProfile_cpp(multilayer, n_points, z_min, z_max):
-    """MaterialProfile_cpp(MultiLayer multilayer, int n_points, double z_min, double z_max) -> vector_complex_t"""
+    """
+    MaterialProfile_cpp(MultiLayer multilayer, int n_points, double z_min, double z_max) -> vector_complex_t
+
+    BA_CORE_API_ std::vector<complex_t> MaterialProfile(const MultiLayer &multilayer, int n_points, double z_min, double z_max)
+
+    Calculate average material profile for given multilayer 
+
+    """
     return _libBornAgainCore.MaterialProfile_cpp(multilayer, n_points, z_min, z_max)
 
 def DefaultMaterialProfileLimits(multilayer):
-    """DefaultMaterialProfileLimits(MultiLayer multilayer) -> pair_double_t"""
+    """
+    DefaultMaterialProfileLimits(MultiLayer multilayer) -> pair_double_t
+
+    BA_CORE_API_ std::pair<double, double> DefaultMaterialProfileLimits(const MultiLayer &multilayer)
+
+    Get default z limits for generating a material profile. 
+
+    """
     return _libBornAgainCore.DefaultMaterialProfileLimits(multilayer)
 
 def GenerateZValues(n_points, z_min, z_max):
-    """GenerateZValues(int n_points, double z_min, double z_max) -> vdouble1d_t"""
+    """
+    GenerateZValues(int n_points, double z_min, double z_max) -> vdouble1d_t
+
+    BA_CORE_API_ std::vector<double> GenerateZValues(int n_points, double z_min, double z_max)
+
+    Generate z values (equidistant) for use in MaterialProfile. 
+
+    """
     return _libBornAgainCore.GenerateZValues(n_points, z_min, z_max)
 class OffSpecSimulation(Simulation2D):
     """
@@ -25521,7 +25607,14 @@ class OffSpecSimulation(Simulation2D):
 
 
     def intensityMapSize(self):
-        """intensityMapSize(OffSpecSimulation self) -> size_t"""
+        """
+        intensityMapSize(OffSpecSimulation self) -> size_t
+
+        size_t OffSpecSimulation::intensityMapSize() const override
+
+        Returns the total number of the intensity values in the simulation result. 
+
+        """
         return _libBornAgainCore.OffSpecSimulation_intensityMapSize(self)
 
 OffSpecSimulation_swigregister = _libBornAgainCore.OffSpecSimulation_swigregister
@@ -27228,7 +27321,14 @@ class ParticleLayout(ILayout):
 
 
     def interferenceFunction(self):
-        """interferenceFunction(ParticleLayout self) -> IInterferenceFunction"""
+        """
+        interferenceFunction(ParticleLayout self) -> IInterferenceFunction
+
+        const IInterferenceFunction * ParticleLayout::interferenceFunction() const final override
+
+        Returns the interference function. 
+
+        """
         return _libBornAgainCore.ParticleLayout_interferenceFunction(self)
 
 
@@ -27308,6 +27408,8 @@ def importArrayToOutputData(*args):
 
     OutputData< double > * PyArrayImport::importArrayToOutputData(const std::vector< std::vector< double >> &vec)
 
+    for importing 2D array of doubles from python into  OutputData
+
     """
     return _libBornAgainCore.importArrayToOutputData(*args)
 class PoissonNoiseBackground(IBackground):
@@ -28537,7 +28639,14 @@ class DepthProbeSimulation(Simulation):
 
 
     def intensityMapSize(self):
-        """intensityMapSize(DepthProbeSimulation self) -> size_t"""
+        """
+        intensityMapSize(DepthProbeSimulation self) -> size_t
+
+        size_t DepthProbeSimulation::intensityMapSize() const override
+
+        Returns the total number of the intensity values in the simulation result. 
+
+        """
         return _libBornAgainCore.DepthProbeSimulation_intensityMapSize(self)
 
 DepthProbeSimulation_swigregister = _libBornAgainCore.DepthProbeSimulation_swigregister
@@ -28663,7 +28772,14 @@ class SpecularSimulation(Simulation):
 
 
     def intensityMapSize(self):
-        """intensityMapSize(SpecularSimulation self) -> size_t"""
+        """
+        intensityMapSize(SpecularSimulation self) -> size_t
+
+        size_t SpecularSimulation::intensityMapSize() const override
+
+        Returns the total number of the intensity values in the simulation result. 
+
+        """
         return _libBornAgainCore.SpecularSimulation_intensityMapSize(self)
 
 
diff --git a/auto/Wrap/libBornAgainCore_wrap.cpp b/auto/Wrap/libBornAgainCore_wrap.cpp
index 381df534f3da73916a6380f4fda5845c9499c6f0..5305422eb6ca23aa936bedfdd6bc09588b83d1e2 100644
--- a/auto/Wrap/libBornAgainCore_wrap.cpp
+++ b/auto/Wrap/libBornAgainCore_wrap.cpp
@@ -127104,13 +127104,7 @@ static PyMethodDef SwigMethods[] = {
 		"\n"
 		"SimulationResult FitObjective::simulationResult(size_t i_item=0) const\n"
 		"\n"
-		"Returns simulation result.\n"
-		"\n"
-		"Parameters:\n"
-		"-----------\n"
-		"\n"
-		"i_item: \n"
-		"the index of fit pair \n"
+		"Returns simulation result in the form of  SimulationResult. \n"
 		"\n"
 		""},
 	 { (char *)"FitObjective_experimentalData", _wrap_FitObjective_experimentalData, METH_VARARGS, (char *)"\n"
@@ -127119,18 +127113,17 @@ static PyMethodDef SwigMethods[] = {
 		"\n"
 		"SimulationResult FitObjective::experimentalData(size_t i_item=0) const\n"
 		"\n"
-		"Returns experimental data.\n"
-		"\n"
-		"Parameters:\n"
-		"-----------\n"
-		"\n"
-		"i_item: \n"
-		"the index of fit pair \n"
+		"Returns experimental data in the form of  SimulationResult. \n"
 		"\n"
 		""},
 	 { (char *)"FitObjective_uncertaintyData_cpp", _wrap_FitObjective_uncertaintyData_cpp, METH_VARARGS, (char *)"\n"
 		"uncertaintyData_cpp(size_t i_item=0) -> SimulationResult\n"
 		"FitObjective_uncertaintyData_cpp(FitObjective self) -> SimulationResult\n"
+		"\n"
+		"SimulationResult FitObjective::uncertaintyData(size_t i_item=0) const\n"
+		"\n"
+		"Returns experimental data uncertainties in the form of  SimulationResult. \n"
+		"\n"
 		""},
 	 { (char *)"FitObjective_relativeDifference", _wrap_FitObjective_relativeDifference, METH_VARARGS, (char *)"\n"
 		"relativeDifference(size_t i_item=0) -> SimulationResult\n"
@@ -127138,13 +127131,7 @@ static PyMethodDef SwigMethods[] = {
 		"\n"
 		"SimulationResult FitObjective::relativeDifference(size_t i_item=0) const\n"
 		"\n"
-		"Returns relative difference between simulation and experimental data.\n"
-		"\n"
-		"Parameters:\n"
-		"-----------\n"
-		"\n"
-		"i_item: \n"
-		"the index of fit pair \n"
+		"Returns relative difference between simulation and experimental data in the form of  SimulationResult. \n"
 		"\n"
 		""},
 	 { (char *)"FitObjective_absoluteDifference", _wrap_FitObjective_absoluteDifference, METH_VARARGS, (char *)"\n"
@@ -127153,13 +127140,7 @@ static PyMethodDef SwigMethods[] = {
 		"\n"
 		"SimulationResult FitObjective::absoluteDifference(size_t i_item=0) const\n"
 		"\n"
-		"Returns absolute value of difference between simulation and experimental data.\n"
-		"\n"
-		"Parameters:\n"
-		"-----------\n"
-		"\n"
-		"i_item: \n"
-		"the index of fit pair \n"
+		"Returns absolute value of difference between simulation and experimental data in the form of  SimulationResult. \n"
 		"\n"
 		""},
 	 { (char *)"FitObjective_experimental_array", _wrap_FitObjective_experimental_array, METH_VARARGS, (char *)"\n"
@@ -127167,7 +127148,7 @@ static PyMethodDef SwigMethods[] = {
 		"\n"
 		"std::vector< double > FitObjective::experimental_array() const\n"
 		"\n"
-		"Returns one dimensional array representing experimental data. Masked areas and the area outside of region of interest are not included. Data from different datasets merged together. \n"
+		"Returns one dimensional array representing merged experimental data. The area outside of the region of interest is not included, masked data is nullified. \n"
 		"\n"
 		""},
 	 { (char *)"FitObjective_simulation_array", _wrap_FitObjective_simulation_array, METH_VARARGS, (char *)"\n"
@@ -127175,16 +127156,23 @@ static PyMethodDef SwigMethods[] = {
 		"\n"
 		"std::vector< double > FitObjective::simulation_array() const\n"
 		"\n"
-		"Returns one dimensional array representing simulated intensities data. Masked areas and the area outside of region of interest are not included. Data from different datasets merged together. \n"
+		"Returns one dimensional array representing merged simulated intensities data. The area outside of the region of interest is not included, masked data is nullified. \n"
+		"\n"
+		""},
+	 { (char *)"FitObjective_uncertainties_cpp", _wrap_FitObjective_uncertainties_cpp, METH_VARARGS, (char *)"\n"
+		"FitObjective_uncertainties_cpp(FitObjective self) -> vdouble1d_t\n"
+		"\n"
+		"std::vector< double > FitObjective::uncertainties() const\n"
+		"\n"
+		"Returns one-dimensional array representing merged data uncertainties. The area outside of the region of interest is not included, masked data is nullified. \n"
 		"\n"
 		""},
-	 { (char *)"FitObjective_uncertainties_cpp", _wrap_FitObjective_uncertainties_cpp, METH_VARARGS, (char *)"FitObjective_uncertainties_cpp(FitObjective self) -> vdouble1d_t"},
 	 { (char *)"FitObjective_weights_array", _wrap_FitObjective_weights_array, METH_VARARGS, (char *)"\n"
 		"FitObjective_weights_array(FitObjective self) -> vdouble1d_t\n"
 		"\n"
 		"std::vector< double > FitObjective::weights_array() const\n"
 		"\n"
-		"Returns one dimensional array representing weights of bin intensity for residuals. \n"
+		"Returns one-dimensional array representing merged user weights. The area outside of the region of interest is not included, masked data is nullified. \n"
 		"\n"
 		""},
 	 { (char *)"FitObjective_initPrint", _wrap_FitObjective_initPrint, METH_VARARGS, (char *)"\n"
@@ -127204,7 +127192,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"FitObjective_initPlot_cpp", _wrap_FitObjective_initPlot_cpp, METH_VARARGS, (char *)"\n"
 		"FitObjective_initPlot_cpp(FitObjective self, int every_nth, PyObserverCallback callback)\n"
 		"\n"
-		"void FitObjective::initPlot(int every_nth, PyObserverCallback &callback)\n"
+		"void FitObjective::initPlot(int every_nth, fit_observer_t observer)\n"
 		"\n"
 		""},
 	 { (char *)"FitObjective_iterationInfo", _wrap_FitObjective_iterationInfo, METH_VARARGS, (char *)"\n"
@@ -127248,9 +127236,26 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"FitObjective_setObjectiveMetric", _wrap_FitObjective_setObjectiveMetric, METH_VARARGS, (char *)"\n"
 		"setObjectiveMetric(std::string const & metric)\n"
 		"FitObjective_setObjectiveMetric(FitObjective self, std::string const & metric, std::string const & norm)\n"
+		"\n"
+		"void FitObjective::setObjectiveMetric(std::unique_ptr< ObjectiveMetric > metric)\n"
+		"\n"
+		""},
+	 { (char *)"FitObjective_containsUncertainties_cpp", _wrap_FitObjective_containsUncertainties_cpp, METH_VARARGS, (char *)"\n"
+		"FitObjective_containsUncertainties_cpp(FitObjective self, size_t i_item) -> bool\n"
+		"\n"
+		"bool FitObjective::containsUncertainties(size_t i_item) const\n"
+		"\n"
+		"Returns true if the specified DataPair element contains uncertainties. \n"
+		"\n"
+		""},
+	 { (char *)"FitObjective_allPairsHaveUncertainties_cpp", _wrap_FitObjective_allPairsHaveUncertainties_cpp, METH_VARARGS, (char *)"\n"
+		"FitObjective_allPairsHaveUncertainties_cpp(FitObjective self) -> bool\n"
+		"\n"
+		"bool FitObjective::allPairsHaveUncertainties() const\n"
+		"\n"
+		"Returns true if all the data pairs in  FitObjective instance contain uncertainties. \n"
+		"\n"
 		""},
-	 { (char *)"FitObjective_containsUncertainties_cpp", _wrap_FitObjective_containsUncertainties_cpp, METH_VARARGS, (char *)"FitObjective_containsUncertainties_cpp(FitObjective self, size_t i_item) -> bool"},
-	 { (char *)"FitObjective_allPairsHaveUncertainties_cpp", _wrap_FitObjective_allPairsHaveUncertainties_cpp, METH_VARARGS, (char *)"FitObjective_allPairsHaveUncertainties_cpp(FitObjective self) -> bool"},
 	 { (char *)"FitObjective_availableMetricOptions", _wrap_FitObjective_availableMetricOptions, METH_VARARGS, (char *)"FitObjective_availableMetricOptions() -> std::string"},
 	 { (char *)"FitObjective_addSimulationAndData_cpp", _wrap_FitObjective_addSimulationAndData_cpp, METH_VARARGS, (char *)"\n"
 		"addSimulationAndData_cpp(PyBuilderCallback callback, vdouble1d_t data, double weight=1.0)\n"
@@ -127262,7 +127267,24 @@ static PyMethodDef SwigMethods[] = {
 		"addSimulationAndData_cpp(PyBuilderCallback callback, vdouble2d_t data, vdouble2d_t uncertainties, double weight=1.0)\n"
 		"FitObjective_addSimulationAndData_cpp(FitObjective self, PyBuilderCallback callback, vdouble2d_t data, vdouble2d_t uncertainties)\n"
 		"\n"
-		"void FitObjective::addSimulationAndData(PyBuilderCallback &callback, const std::vector< std::vector< double >> &data, double weight=1.0)\n"
+		"void FitObjective::addSimulationAndData(PyBuilderCallback &callback, const T &data, const T &uncertainties, double weight=1.0)\n"
+		"\n"
+		"Constructs simulation/data pair for later fit.\n"
+		"\n"
+		"Parameters:\n"
+		"-----------\n"
+		"\n"
+		"callback: \n"
+		"simulation builder capable of producing simulations\n"
+		"\n"
+		"data: \n"
+		"experimental data array\n"
+		"\n"
+		"uncertainties: \n"
+		"data uncertainties array\n"
+		"\n"
+		"weight: \n"
+		"weight of dataset in metric calculations \n"
 		"\n"
 		""},
 	 { (char *)"disown_FitObjective", _wrap_disown_FitObjective, METH_VARARGS, NULL},
@@ -129749,10 +129771,7 @@ static PyMethodDef SwigMethods[] = {
 		"-----------\n"
 		"\n"
 		"V: \n"
-		"oriented vertex list\n"
-		"\n"
-		"_sym_S2: \n"
-		"true if face has a perpedicular two-fold symmetry axis \n"
+		"oriented vertex list \n"
 		"\n"
 		""},
 	 { (char *)"PolyhedralFace_area", _wrap_PolyhedralFace_area, METH_VARARGS, (char *)"\n"
@@ -132524,7 +132543,14 @@ static PyMethodDef SwigMethods[] = {
 		"const IBackground* Simulation::background() const\n"
 		"\n"
 		""},
-	 { (char *)"Simulation_intensityMapSize", _wrap_Simulation_intensityMapSize, METH_VARARGS, (char *)"Simulation_intensityMapSize(Simulation self) -> size_t"},
+	 { (char *)"Simulation_intensityMapSize", _wrap_Simulation_intensityMapSize, METH_VARARGS, (char *)"\n"
+		"Simulation_intensityMapSize(Simulation self) -> size_t\n"
+		"\n"
+		"virtual size_t Simulation::intensityMapSize() const =0\n"
+		"\n"
+		"Returns the total number of the intensity values in the simulation result. \n"
+		"\n"
+		""},
 	 { (char *)"Simulation_result", _wrap_Simulation_result, METH_VARARGS, (char *)"\n"
 		"Simulation_result(Simulation self) -> SimulationResult\n"
 		"\n"
@@ -132587,7 +132613,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"delete_Simulation2D", _wrap_delete_Simulation2D, METH_VARARGS, (char *)"\n"
 		"delete_Simulation2D(Simulation2D self)\n"
 		"\n"
-		"virtual Simulation2D::~Simulation2D()=default\n"
+		"Simulation2D::~Simulation2D() override=default\n"
 		"\n"
 		""},
 	 { (char *)"Simulation2D_clone", _wrap_Simulation2D_clone, METH_VARARGS, (char *)"\n"
@@ -132839,7 +132865,14 @@ static PyMethodDef SwigMethods[] = {
 		"Sets beam parameters from here (forwarded to  Instrument) \n"
 		"\n"
 		""},
-	 { (char *)"GISASSimulation_intensityMapSize", _wrap_GISASSimulation_intensityMapSize, METH_VARARGS, (char *)"GISASSimulation_intensityMapSize(GISASSimulation self) -> size_t"},
+	 { (char *)"GISASSimulation_intensityMapSize", _wrap_GISASSimulation_intensityMapSize, METH_VARARGS, (char *)"\n"
+		"GISASSimulation_intensityMapSize(GISASSimulation self) -> size_t\n"
+		"\n"
+		"size_t GISASSimulation::intensityMapSize() const override\n"
+		"\n"
+		"Returns the total number of the intensity values in the simulation result. \n"
+		"\n"
+		""},
 	 { (char *)"GISASSimulation_swigregister", GISASSimulation_swigregister, METH_VARARGS, NULL},
 	 { (char *)"delete_IHistogram", _wrap_delete_IHistogram, METH_VARARGS, (char *)"\n"
 		"delete_IHistogram(IHistogram self)\n"
@@ -133473,7 +133506,7 @@ static PyMethodDef SwigMethods[] = {
 		"array(AxesUnits units) -> PyObject\n"
 		"SimulationResult_array(SimulationResult self) -> PyObject *\n"
 		"\n"
-		"PyObject * SimulationResult::array() const\n"
+		"PyObject * SimulationResult::array(AxesUnits units=AxesUnits::DEFAULT) const\n"
 		"\n"
 		"returns intensity data as Python numpy array \n"
 		"\n"
@@ -133958,7 +133991,14 @@ static PyMethodDef SwigMethods[] = {
 		"Returns information on all particles (type and abundance) and generates new particles if an  IAbstractParticle denotes a collection \n"
 		"\n"
 		""},
-	 { (char *)"ILayout_interferenceFunction", _wrap_ILayout_interferenceFunction, METH_VARARGS, (char *)"ILayout_interferenceFunction(ILayout self) -> IInterferenceFunction"},
+	 { (char *)"ILayout_interferenceFunction", _wrap_ILayout_interferenceFunction, METH_VARARGS, (char *)"\n"
+		"ILayout_interferenceFunction(ILayout self) -> IInterferenceFunction\n"
+		"\n"
+		"virtual const IInterferenceFunction* ILayout::interferenceFunction() const =0\n"
+		"\n"
+		"Returns the interference function. \n"
+		"\n"
+		""},
 	 { (char *)"ILayout_getTotalAbundance", _wrap_ILayout_getTotalAbundance, METH_VARARGS, (char *)"\n"
 		"ILayout_getTotalAbundance(ILayout self) -> double\n"
 		"\n"
@@ -134100,7 +134140,16 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"ParticleLimits_m_bottom_get", _wrap_ParticleLimits_m_bottom_get, METH_VARARGS, (char *)"ParticleLimits_m_bottom_get(ParticleLimits self) -> double"},
 	 { (char *)"ParticleLimits_m_top_set", _wrap_ParticleLimits_m_top_set, METH_VARARGS, (char *)"ParticleLimits_m_top_set(ParticleLimits self, double m_top)"},
 	 { (char *)"ParticleLimits_m_top_get", _wrap_ParticleLimits_m_top_get, METH_VARARGS, (char *)"ParticleLimits_m_top_get(ParticleLimits self) -> double"},
-	 { (char *)"new_ParticleLimits", _wrap_new_ParticleLimits, METH_VARARGS, (char *)"new_ParticleLimits() -> ParticleLimits"},
+	 { (char *)"new_ParticleLimits", _wrap_new_ParticleLimits, METH_VARARGS, (char *)"\n"
+		"new_ParticleLimits() -> ParticleLimits\n"
+		"\n"
+		"\n"
+		"\n"
+		"Vertical extension of a particle, specified by bottom and top z coordinate.\n"
+		"\n"
+		"C++ includes: IParticle.h\n"
+		"\n"
+		""},
 	 { (char *)"delete_ParticleLimits", _wrap_delete_ParticleLimits, METH_VARARGS, (char *)"delete_ParticleLimits(ParticleLimits self)"},
 	 { (char *)"ParticleLimits_swigregister", ParticleLimits_swigregister, METH_VARARGS, NULL},
 	 { (char *)"delete_IParticle", _wrap_delete_IParticle, METH_VARARGS, (char *)"\n"
@@ -136317,6 +136366,8 @@ static PyMethodDef SwigMethods[] = {
 		"\n"
 		"MillerIndexOrientation::MillerIndexOrientation(QComponent q1, MillerIndex index1, QComponent q2, MillerIndex index2)\n"
 		"\n"
+		"This constructor is best explained by an example. Arguments QX, (1,1,0), QY, (0,2,1) mean: Rotate the lattice such that the axis [110] points into x direction, and the axis [021], projected into the yz plane, points into z direction. \n"
+		"\n"
 		""},
 	 { (char *)"delete_MillerIndexOrientation", _wrap_delete_MillerIndexOrientation, METH_VARARGS, (char *)"\n"
 		"delete_MillerIndexOrientation(MillerIndexOrientation self)\n"
@@ -136736,7 +136787,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"delete_Layer", _wrap_delete_Layer, METH_VARARGS, (char *)"\n"
 		"delete_Layer(Layer self)\n"
 		"\n"
-		"Layer::~Layer()\n"
+		"Layer::~Layer() override\n"
 		"\n"
 		""},
 	 { (char *)"Layer_clone", _wrap_Layer_clone, METH_VARARGS, (char *)"\n"
@@ -137223,7 +137274,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"delete_MultiLayer", _wrap_delete_MultiLayer, METH_VARARGS, (char *)"\n"
 		"delete_MultiLayer(MultiLayer self)\n"
 		"\n"
-		"MultiLayer::~MultiLayer()\n"
+		"MultiLayer::~MultiLayer() override\n"
 		"\n"
 		""},
 	 { (char *)"MultiLayer_clone", _wrap_MultiLayer_clone, METH_VARARGS, (char *)"\n"
@@ -137231,7 +137282,7 @@ static PyMethodDef SwigMethods[] = {
 		"\n"
 		"MultiLayer * MultiLayer::clone() const final override\n"
 		"\n"
-		"Returns a clone of multilayer with clones of all layers and recreated interfaces between layers \n"
+		"Returns a clone of multilayer with clones of all layers and interfaces between layers \n"
 		"\n"
 		""},
 	 { (char *)"MultiLayer_accept", _wrap_MultiLayer_accept, METH_VARARGS, (char *)"\n"
@@ -137269,7 +137320,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"MultiLayer_layer", _wrap_MultiLayer_layer, METH_VARARGS, (char *)"\n"
 		"MultiLayer_layer(MultiLayer self, size_t i_layer) -> Layer\n"
 		"\n"
-		"const Layer* MultiLayer::layer(size_t i_layer) const\n"
+		"const Layer * MultiLayer::layer(size_t i_layer) const\n"
 		"\n"
 		"Returns layer with given index. \n"
 		"\n"
@@ -137277,9 +137328,9 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"MultiLayer_layerInterface", _wrap_MultiLayer_layerInterface, METH_VARARGS, (char *)"\n"
 		"MultiLayer_layerInterface(MultiLayer self, size_t i_interface) -> LayerInterface const *\n"
 		"\n"
-		"const LayerInterface* MultiLayer::layerInterface(size_t i_interface) const\n"
+		"const LayerInterface * MultiLayer::layerInterface(size_t i_interface) const\n"
 		"\n"
-		"Returns layer with given index. \n"
+		"Returns interface with given index. \n"
 		"\n"
 		""},
 	 { (char *)"MultiLayer_setCrossCorrLength", _wrap_MultiLayer_setCrossCorrLength, METH_VARARGS, (char *)"\n"
@@ -137323,9 +137374,30 @@ static PyMethodDef SwigMethods[] = {
 		"\n"
 		""},
 	 { (char *)"MultiLayer_swigregister", MultiLayer_swigregister, METH_VARARGS, NULL},
-	 { (char *)"MaterialProfile_cpp", _wrap_MaterialProfile_cpp, METH_VARARGS, (char *)"MaterialProfile_cpp(MultiLayer multilayer, int n_points, double z_min, double z_max) -> vector_complex_t"},
-	 { (char *)"DefaultMaterialProfileLimits", _wrap_DefaultMaterialProfileLimits, METH_VARARGS, (char *)"DefaultMaterialProfileLimits(MultiLayer multilayer) -> pair_double_t"},
-	 { (char *)"GenerateZValues", _wrap_GenerateZValues, METH_VARARGS, (char *)"GenerateZValues(int n_points, double z_min, double z_max) -> vdouble1d_t"},
+	 { (char *)"MaterialProfile_cpp", _wrap_MaterialProfile_cpp, METH_VARARGS, (char *)"\n"
+		"MaterialProfile_cpp(MultiLayer multilayer, int n_points, double z_min, double z_max) -> vector_complex_t\n"
+		"\n"
+		"BA_CORE_API_ std::vector<complex_t> MaterialProfile(const MultiLayer &multilayer, int n_points, double z_min, double z_max)\n"
+		"\n"
+		"Calculate average material profile for given multilayer \n"
+		"\n"
+		""},
+	 { (char *)"DefaultMaterialProfileLimits", _wrap_DefaultMaterialProfileLimits, METH_VARARGS, (char *)"\n"
+		"DefaultMaterialProfileLimits(MultiLayer multilayer) -> pair_double_t\n"
+		"\n"
+		"BA_CORE_API_ std::pair<double, double> DefaultMaterialProfileLimits(const MultiLayer &multilayer)\n"
+		"\n"
+		"Get default z limits for generating a material profile. \n"
+		"\n"
+		""},
+	 { (char *)"GenerateZValues", _wrap_GenerateZValues, METH_VARARGS, (char *)"\n"
+		"GenerateZValues(int n_points, double z_min, double z_max) -> vdouble1d_t\n"
+		"\n"
+		"BA_CORE_API_ std::vector<double> GenerateZValues(int n_points, double z_min, double z_max)\n"
+		"\n"
+		"Generate z values (equidistant) for use in MaterialProfile. \n"
+		"\n"
+		""},
 	 { (char *)"new_OffSpecSimulation", _wrap_new_OffSpecSimulation, METH_VARARGS, (char *)"\n"
 		"OffSpecSimulation()\n"
 		"OffSpecSimulation(MultiLayer p_sample)\n"
@@ -137386,7 +137458,14 @@ static PyMethodDef SwigMethods[] = {
 		"Returns axis of the beam. \n"
 		"\n"
 		""},
-	 { (char *)"OffSpecSimulation_intensityMapSize", _wrap_OffSpecSimulation_intensityMapSize, METH_VARARGS, (char *)"OffSpecSimulation_intensityMapSize(OffSpecSimulation self) -> size_t"},
+	 { (char *)"OffSpecSimulation_intensityMapSize", _wrap_OffSpecSimulation_intensityMapSize, METH_VARARGS, (char *)"\n"
+		"OffSpecSimulation_intensityMapSize(OffSpecSimulation self) -> size_t\n"
+		"\n"
+		"size_t OffSpecSimulation::intensityMapSize() const override\n"
+		"\n"
+		"Returns the total number of the intensity values in the simulation result. \n"
+		"\n"
+		""},
 	 { (char *)"OffSpecSimulation_swigregister", OffSpecSimulation_swigregister, METH_VARARGS, NULL},
 	 { (char *)"new_IntensityData", _wrap_new_IntensityData, METH_VARARGS, (char *)"\n"
 		"new_IntensityData() -> IntensityData\n"
@@ -138291,7 +138370,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"delete_ParticleLayout", _wrap_delete_ParticleLayout, METH_VARARGS, (char *)"\n"
 		"delete_ParticleLayout(ParticleLayout self)\n"
 		"\n"
-		"ParticleLayout::~ParticleLayout()\n"
+		"ParticleLayout::~ParticleLayout() override\n"
 		"\n"
 		""},
 	 { (char *)"ParticleLayout_clone", _wrap_ParticleLayout_clone, METH_VARARGS, (char *)"\n"
@@ -138344,7 +138423,14 @@ static PyMethodDef SwigMethods[] = {
 		"Returns information on all particles (type and abundance) and generates new particles if an  IAbstractParticle denotes a collection \n"
 		"\n"
 		""},
-	 { (char *)"ParticleLayout_interferenceFunction", _wrap_ParticleLayout_interferenceFunction, METH_VARARGS, (char *)"ParticleLayout_interferenceFunction(ParticleLayout self) -> IInterferenceFunction"},
+	 { (char *)"ParticleLayout_interferenceFunction", _wrap_ParticleLayout_interferenceFunction, METH_VARARGS, (char *)"\n"
+		"ParticleLayout_interferenceFunction(ParticleLayout self) -> IInterferenceFunction\n"
+		"\n"
+		"const IInterferenceFunction * ParticleLayout::interferenceFunction() const final override\n"
+		"\n"
+		"Returns the interference function. \n"
+		"\n"
+		""},
 	 { (char *)"ParticleLayout_getTotalAbundance", _wrap_ParticleLayout_getTotalAbundance, METH_VARARGS, (char *)"\n"
 		"ParticleLayout_getTotalAbundance(ParticleLayout self) -> double\n"
 		"\n"
@@ -138398,6 +138484,8 @@ static PyMethodDef SwigMethods[] = {
 		"\n"
 		"OutputData< double > * PyArrayImport::importArrayToOutputData(const std::vector< std::vector< double >> &vec)\n"
 		"\n"
+		"for importing 2D array of doubles from python into  OutputData\n"
+		"\n"
 		""},
 	 { (char *)"new_PoissonNoiseBackground", _wrap_new_PoissonNoiseBackground, METH_VARARGS, (char *)"\n"
 		"new_PoissonNoiseBackground() -> PoissonNoiseBackground\n"
@@ -139052,7 +139140,14 @@ static PyMethodDef SwigMethods[] = {
 		"Returns a pointer to z-position axis. \n"
 		"\n"
 		""},
-	 { (char *)"DepthProbeSimulation_intensityMapSize", _wrap_DepthProbeSimulation_intensityMapSize, METH_VARARGS, (char *)"DepthProbeSimulation_intensityMapSize(DepthProbeSimulation self) -> size_t"},
+	 { (char *)"DepthProbeSimulation_intensityMapSize", _wrap_DepthProbeSimulation_intensityMapSize, METH_VARARGS, (char *)"\n"
+		"DepthProbeSimulation_intensityMapSize(DepthProbeSimulation self) -> size_t\n"
+		"\n"
+		"size_t DepthProbeSimulation::intensityMapSize() const override\n"
+		"\n"
+		"Returns the total number of the intensity values in the simulation result. \n"
+		"\n"
+		""},
 	 { (char *)"DepthProbeSimulation_swigregister", DepthProbeSimulation_swigregister, METH_VARARGS, NULL},
 	 { (char *)"new_SpecularSimulation", _wrap_new_SpecularSimulation, METH_VARARGS, (char *)"\n"
 		"SpecularSimulation()\n"
@@ -139122,7 +139217,14 @@ static PyMethodDef SwigMethods[] = {
 		"Returns a pointer to footprint factor holder. \n"
 		"\n"
 		""},
-	 { (char *)"SpecularSimulation_intensityMapSize", _wrap_SpecularSimulation_intensityMapSize, METH_VARARGS, (char *)"SpecularSimulation_intensityMapSize(SpecularSimulation self) -> size_t"},
+	 { (char *)"SpecularSimulation_intensityMapSize", _wrap_SpecularSimulation_intensityMapSize, METH_VARARGS, (char *)"\n"
+		"SpecularSimulation_intensityMapSize(SpecularSimulation self) -> size_t\n"
+		"\n"
+		"size_t SpecularSimulation::intensityMapSize() const override\n"
+		"\n"
+		"Returns the total number of the intensity values in the simulation result. \n"
+		"\n"
+		""},
 	 { (char *)"SpecularSimulation_swigregister", SpecularSimulation_swigregister, METH_VARARGS, NULL},
 	 { (char *)"new_ThreadInfo", _wrap_new_ThreadInfo, METH_VARARGS, (char *)"\n"
 		"new_ThreadInfo() -> ThreadInfo\n"