From 558ad61b15997205cfad7c0d3d957886652f23f3 Mon Sep 17 00:00:00 2001 From: Paul Sharp <44529197+DrPaulSharp@users.noreply.github.com> Date: Tue, 11 Jun 2024 13:31:53 +0100 Subject: [PATCH] Constructs python outputs and adds file "run.py" (#35) * Adds file "run.py" * Adds file "outputs.py", which constructs python results objects in "run.py" * Adds test "test_outputs.py" * Rewrites "plot_ref_sld" to use python objects * Adds test cases to "test_outputs.py" * Reorganises output tests and fixtures into "test_run.py" and "conftest.py" * Fixes bug for "data" input to "project.py" and "test_inputs.py" * Updates submodule * Removes "bestFitsMean" from "bayesResults" --- RAT/__init__.py | 1 + RAT/inputs.py | 48 +- RAT/models.py | 4 +- RAT/outputs.py | 215 +++++ RAT/project.py | 5 +- RAT/run.py | 30 + RAT/utils/plotting.py | 18 +- cpp/RAT | 2 +- cpp/rat.cpp | 24 +- tests/conftest.py | 1796 +++++++++++++++++++++++++++++++++++++++++ tests/test_events.py | 3 + tests/test_inputs.py | 17 +- tests/test_outputs.py | 30 + tests/test_run.py | 266 ++++++ tests/utils.py | 123 +++ 15 files changed, 2529 insertions(+), 53 deletions(-) create mode 100644 RAT/outputs.py create mode 100644 RAT/run.py create mode 100644 tests/conftest.py create mode 100644 tests/test_outputs.py create mode 100644 tests/test_run.py diff --git a/RAT/__init__.py b/RAT/__init__.py index 8bb0027d..fe0d597d 100644 --- a/RAT/__init__.py +++ b/RAT/__init__.py @@ -2,6 +2,7 @@ from RAT.classlist import ClassList from RAT.project import Project from RAT.controls import set_controls +from RAT.run import run import RAT.models dir_path = os.path.dirname(os.path.realpath(__file__)) diff --git a/RAT/inputs.py b/RAT/inputs.py index 70526caa..1a56ebdd 100644 --- a/RAT/inputs.py +++ b/RAT/inputs.py @@ -133,8 +133,8 @@ def make_problem(project: RAT.Project) -> ProblemDefinition: problem.contrastBackgroundActions = [action_id[contrast.background_action] for contrast in project.contrasts] problem.contrastResolutions = [project.resolutions.index(contrast.resolution, True) for contrast in project.contrasts] problem.contrastCustomFiles = contrast_custom_files - problem.resample = [contrast.resample for contrast in project.contrasts] - problem.dataPresent = [1 if contrast.data else 0 for contrast in project.contrasts] + problem.resample = make_resample(project) + problem.dataPresent = make_data_present(project) problem.oilChiDataPresent = [0] * len(project.contrasts) problem.numberOfContrasts = len(project.contrasts) problem.numberOfLayers = len(project.layers) @@ -151,6 +151,38 @@ def make_problem(project: RAT.Project) -> ProblemDefinition: return problem +def make_resample(project: RAT.Project) -> list[int]: + """Constructs the "resample" field of the problem input required for the compiled RAT code. + + Parameters + ---------- + project : RAT.Project + The project model, which defines the physical system under study. + + Returns + ------- + : list[int] + The "resample" field of the problem input used in the compiled RAT code. + """ + return [contrast.resample for contrast in project.contrasts] + + +def make_data_present(project: RAT.Project) -> list[int]: + """Constructs the "dataPresent" field of the problem input required for the compiled RAT code. + + Parameters + ---------- + project : RAT.Project + The project model, which defines the physical system under study. + + Returns + ------- + : list[int] + The "dataPresent" field of the problem input used in the compiled RAT code. + """ + return [1 if project.data[project.data.index(contrast.data)].data.size != 0 else 0 for contrast in project.contrasts] + + def make_cells(project: RAT.Project) -> Cells: """Constructs the cells input required for the compiled RAT code. @@ -199,14 +231,10 @@ def make_cells(project: RAT.Project) -> Cells: data_index = project.data.index(contrast.data) - if 'data' in project.data[data_index].model_fields_set: - all_data.append(project.data[data_index].data) - data_limits.append(project.data[data_index].data_range) - simulation_limits.append(project.data[data_index].simulation_range) - else: - all_data.append([0.0, 0.0, 0.0]) - data_limits.append([0.0, 0.0]) - simulation_limits.append([0.0, 0.0]) + all_data.append(project.data[data_index].data) + data_limits.append(project.data[data_index].data_range) + simulation_limits.append(project.data[data_index].simulation_range) + # Populate the set of cells cells = Cells() diff --git a/RAT/models.py b/RAT/models.py index 33862cc9..e57835c6 100644 --- a/RAT/models.py +++ b/RAT/models.py @@ -123,7 +123,7 @@ def model_post_init(self, __context: Any) -> None: """If the "data_range" and "simulation_range" fields are not set, but "data" is supplied, the ranges should be set to the min and max values of the first column (assumed to be q) of the supplied data. """ - if len(self.data[:, 0]) > 0: + if self.data.shape[0] > 0: data_min = np.min(self.data[:, 0]) data_max = np.max(self.data[:, 0]) for field in ["data_range", "simulation_range"]: @@ -135,7 +135,7 @@ def check_ranges(self) -> 'Data': """The limits of the "data_range" field must lie within the range of the supplied data, whilst the limits of the "simulation_range" field must lie outside the range of the supplied data. """ - if len(self.data[:, 0]) > 0: + if self.data.shape[0] > 0: data_min = np.min(self.data[:, 0]) data_max = np.max(self.data[:, 0]) if "data_range" in self.model_fields_set and (self.data_range[0] < data_min or diff --git a/RAT/outputs.py b/RAT/outputs.py new file mode 100644 index 00000000..fee942a8 --- /dev/null +++ b/RAT/outputs.py @@ -0,0 +1,215 @@ +"""Converts outputs from the compiled RAT code to python dataclasses""" + +from dataclasses import dataclass +import numpy as np +from typing import Optional, Union +from RAT.utils.enums import Procedures +import RAT.rat_core + + +@dataclass +class CalculationResults: + chiValues: np.ndarray + sumChi: float + + +@dataclass +class ContrastParams: + backgroundParams: np.ndarray + scalefactors: np.ndarray + bulkIn: np.ndarray + bulkOut: np.ndarray + resolutionParams: np.ndarray + subRoughs: np.ndarray + resample: np.ndarray + + +@dataclass +class Results: + reflectivity: list + simulation: list + shiftedData: list + layerSlds: list + sldProfiles: list + resampledLayers: list + calculationResults: CalculationResults + contrastParams: ContrastParams + fitParams: np.ndarray + fitNames: list[str] + + +@dataclass +class PredictionIntervals: + reflectivity: list + sld: list + reflectivityXData: list + sldXData: list + sampleChi: np.ndarray + + +@dataclass +class ConfidenceIntervals: + percentile95: np.ndarray + percentile65: np.ndarray + mean: np.ndarray + + +@dataclass +class DreamParams: + nParams: float + nChains: float + nGenerations: float + parallel: bool + CPU: float + jumpProbability: float + pUnitGamma: float + nCR: float + delta: float + steps: float + zeta: float + outlier: str + adaptPCR: bool + thinning: float + epsilon: float + ABC: bool + IO: bool + storeOutput: bool + R: np.ndarray + + +@dataclass +class DreamOutput: + allChains: np.ndarray + outlierChains: np.ndarray + runtime: float + iteration: float + modelOutput: float + AR: np.ndarray + R_stat: np.ndarray + CR: np.ndarray + + +@dataclass +class NestedSamplerOutput: + logZ: float + nestSamples: np.ndarray + postSamples: np.ndarray + + +@dataclass +class BayesResults(Results): + predictionIntervals: PredictionIntervals + confidenceIntervals: ConfidenceIntervals + dreamParams: DreamParams + dreamOutput: DreamOutput + nestedSamplerOutput: NestedSamplerOutput + chain: np.ndarray + + +def make_results(procedure: Procedures, output_results: RAT.rat_core.OutputResult, + bayes_results: Optional[RAT.rat_core.BayesResults] = None) -> Union[Results, BayesResults]: + """Initialise a python Results or BayesResults object using the outputs from a RAT calculation.""" + + calculation_results = CalculationResults(chiValues=output_results.calculationResults.chiValues, + sumChi=output_results.calculationResults.sumChi + ) + contrast_params = ContrastParams( + backgroundParams=output_results.contrastParams.backgroundParams, + scalefactors=output_results.contrastParams.scalefactors, + bulkIn=output_results.contrastParams.bulkIn, + bulkOut=output_results.contrastParams.bulkOut, + resolutionParams=output_results.contrastParams.resolutionParams, + subRoughs=output_results.contrastParams.subRoughs, + resample=output_results.contrastParams.resample + ) + + if procedure in [Procedures.NS, Procedures.Dream]: + + prediction_intervals = PredictionIntervals( + reflectivity=bayes_results.predictionIntervals.reflectivity, + sld=bayes_results.predictionIntervals.sld, + reflectivityXData=bayes_results.predictionIntervals.reflectivityXData, + sldXData=bayes_results.predictionIntervals.sldXData, + sampleChi=bayes_results.predictionIntervals.sampleChi + ) + + confidence_intervals = ConfidenceIntervals( + percentile95=bayes_results.confidenceIntervals.percentile95, + percentile65=bayes_results.confidenceIntervals.percentile65, + mean=bayes_results.confidenceIntervals.mean + ) + + dream_params = DreamParams( + nParams=bayes_results.dreamParams.nParams, + nChains=bayes_results.dreamParams.nChains, + nGenerations=bayes_results.dreamParams.nGenerations, + parallel=bool(bayes_results.dreamParams.parallel), + CPU=bayes_results.dreamParams.CPU, + jumpProbability=bayes_results.dreamParams.jumpProbability, + pUnitGamma=bayes_results.dreamParams.pUnitGamma, + nCR=bayes_results.dreamParams.nCR, + delta=bayes_results.dreamParams.delta, + steps=bayes_results.dreamParams.steps, + zeta=bayes_results.dreamParams.zeta, + outlier=bayes_results.dreamParams.outlier, + adaptPCR=bool(bayes_results.dreamParams.adaptPCR), + thinning=bayes_results.dreamParams.thinning, + epsilon=bayes_results.dreamParams.epsilon, + ABC=bool(bayes_results.dreamParams.ABC), + IO=bool(bayes_results.dreamParams.IO), + storeOutput=bool(bayes_results.dreamParams.storeOutput), + R=bayes_results.dreamParams.R + ) + + dream_output = DreamOutput( + allChains=bayes_results.dreamOutput.allChains, + outlierChains=bayes_results.dreamOutput.outlierChains, + runtime=bayes_results.dreamOutput.runtime, + iteration=bayes_results.dreamOutput.iteration, + modelOutput=bayes_results.dreamOutput.modelOutput, + AR=bayes_results.dreamOutput.AR, + R_stat=bayes_results.dreamOutput.R_stat, + CR=bayes_results.dreamOutput.CR + ) + + nested_sampler_output = NestedSamplerOutput( + logZ=bayes_results.nestedSamplerOutput.logZ, + nestSamples=bayes_results.nestedSamplerOutput.nestSamples, + postSamples=bayes_results.nestedSamplerOutput.postSamples + ) + + results = BayesResults( + reflectivity=output_results.reflectivity, + simulation=output_results.simulation, + shiftedData=output_results.shiftedData, + layerSlds=output_results.layerSlds, + sldProfiles=output_results.sldProfiles, + resampledLayers=output_results.resampledLayers, + calculationResults=calculation_results, + contrastParams=contrast_params, + fitParams=output_results.fitParams, + fitNames=output_results.fitNames, + predictionIntervals=prediction_intervals, + confidenceIntervals=confidence_intervals, + dreamParams=dream_params, + dreamOutput=dream_output, + nestedSamplerOutput=nested_sampler_output, + chain=bayes_results.chain + ) + + else: + + results = Results( + reflectivity=output_results.reflectivity, + simulation=output_results.simulation, + shiftedData=output_results.shiftedData, + layerSlds=output_results.layerSlds, + sldProfiles=output_results.sldProfiles, + resampledLayers=output_results.resampledLayers, + calculationResults=calculation_results, + contrastParams=contrast_params, + fitParams=output_results.fitParams, + fitNames=output_results.fitNames + ) + + return results diff --git a/RAT/project.py b/RAT/project.py index 7f7d69dc..9323c985 100644 --- a/RAT/project.py +++ b/RAT/project.py @@ -124,7 +124,7 @@ class Project(BaseModel, validate_assignment=True, extra='forbid', arbitrary_typ value_1='Resolution Param 1')) custom_files: ClassList = ClassList() - data: ClassList = ClassList(RAT.models.Data(name='Simulation')) + data: ClassList = ClassList() layers: ClassList = ClassList() domain_contrasts: ClassList = ClassList() contrasts: ClassList = ClassList() @@ -187,6 +187,9 @@ def model_post_init(self, __context: Any) -> None: self.parameters.remove('Substrate Roughness') self.parameters.insert(0, RAT.models.ProtectedParameter(**substrate_roughness_values)) + if 'Simulation' not in self.data.get_names(): + self.data.insert(0, RAT.models.Data(name='Simulation')) + self._all_names = self.get_all_names() self._contrast_model_field = self.get_contrast_model_field() self._protected_parameters = self.get_all_protected_parameters() diff --git a/RAT/run.py b/RAT/run.py new file mode 100644 index 00000000..60c6e8e8 --- /dev/null +++ b/RAT/run.py @@ -0,0 +1,30 @@ +from RAT.inputs import make_input +from RAT.outputs import make_results +import RAT.rat_core + + +def run(project, controls): + """Run RAT for the given project and controls inputs.""" + + parameter_field = {'parameters': 'params', + 'bulk_in': 'bulkIn', + 'bulk_out': 'bulkOut', + 'scalefactors': 'scalefactors', + 'domain_ratios': 'domainRatio', + 'background_parameters': 'backgroundParams', + 'resolution_parameters': 'resolutionParams', + } + + problem_definition, cells, limits, priors, cpp_controls = make_input(project, controls) + + problem_definition, output_results, bayes_results = RAT.rat_core.RATMain(problem_definition, cells, limits, + cpp_controls, priors) + + results = RAT.outputs.make_results(controls.procedure, output_results, bayes_results) + + # Update parameter values in project + for class_list in RAT.project.parameter_class_lists: + for (index, value) in enumerate(getattr(problem_definition, parameter_field[class_list])): + setattr(getattr(project, class_list)[index], 'value', value) + + return project, results diff --git a/RAT/utils/plotting.py b/RAT/utils/plotting.py index ddece72e..6abc1389 100644 --- a/RAT/utils/plotting.py +++ b/RAT/utils/plotting.py @@ -1,11 +1,15 @@ """ Plots using the matplotlib library """ -from typing import Optional +from typing import Optional, Union import matplotlib.pyplot as plt import numpy as np from RAT.rat_core import PlotEventData, makeSLDProfileXY +import RAT +import RAT.inputs +import RAT.outputs + class Figure: """ @@ -196,15 +200,15 @@ def plot_ref_sld_helper(data: PlotEventData, fig: Optional[Figure] = None, delay return fig -def plot_ref_sld(problem, results, block: bool = False): +def plot_ref_sld(project: RAT.Project, results: Union[RAT.outputs.Results, RAT.outputs.BayesResults], block: bool = False): """ Plots the reflectivity and SLD profiles. Parameters ---------- - problem : ProblemDefinition - An instance of the ProblemDefinition class - results : OutputResult + project : Project + An instance of the Project class + results : Union[Results, BayesResults] The result from the calculation block : bool, default: False Indicates the plot should block until it is closed @@ -215,9 +219,9 @@ def plot_ref_sld(problem, results, block: bool = False): data.shiftedData = results.shiftedData data.sldProfiles = results.sldProfiles data.resampledLayers = results.resampledLayers - data.dataPresent = problem.dataPresent + data.dataPresent = RAT.inputs.make_data_present(project) data.subRoughs = results.contrastParams.subRoughs - data.resample = problem.resample + data.resample = RAT.inputs.make_resample(project) figure = Figure(1, 2) diff --git a/cpp/RAT b/cpp/RAT index a2a7646c..e9eeb2ba 160000 --- a/cpp/RAT +++ b/cpp/RAT @@ -1 +1 @@ -Subproject commit a2a7646c2658075593b646d9b82de990bb91bd63 +Subproject commit e9eeb2baa71b5fccfca7a29ab534a96b277294a7 diff --git a/cpp/rat.cpp b/cpp/rat.cpp index c399b530..154942a2 100644 --- a/cpp/rat.cpp +++ b/cpp/rat.cpp @@ -292,14 +292,6 @@ struct PredictionIntervals py::array_t sampleChi; }; -struct BestFitMean -{ - py::list reflectivity; - py::list sld; - real_T chi; - py::list data; -}; - struct ConfidenceIntervals { py::array_t percentile95; @@ -351,7 +343,6 @@ struct DreamOutput struct BayesResults { - BestFitMean bestFitMean; PredictionIntervals predictionIntervals; ConfidenceIntervals confidenceIntervals; DreamParams dreamParams; @@ -1121,11 +1112,6 @@ BayesResults bayesResultsFromStruct8T(const RAT::struct8_T results) bayesResults.chain = pyArrayFromRatArray2d(results.chain); - bayesResults.bestFitMean.reflectivity = pyList1DFromRatCellWrap(results.bestFitMean.reflectivity); - bayesResults.bestFitMean.sld = pyList2dFromRatCellWrap(results.bestFitMean.sld); - bayesResults.bestFitMean.chi = results.bestFitMean.chi; - bayesResults.bestFitMean.data = pyList1DFromRatCellWrap(results.bestFitMean.data); - bayesResults.predictionIntervals.reflectivity = pyList1DFromRatCellWrap(results.predictionIntervals.reflectivity); bayesResults.predictionIntervals.sld = pyList2dFromRatCellWrap(results.predictionIntervals.sld); bayesResults.predictionIntervals.reflectivityXData = pyList1DFromRatCellWrap(results.predictionIntervals.reflectivityXData); @@ -1271,13 +1257,6 @@ PYBIND11_MODULE(rat_core, m) { .def_readwrite("message", &ProgressEventData::message) .def_readwrite("percent", &ProgressEventData::percent); - py::class_(m, "BestFitMean") - .def(py::init<>()) - .def_readwrite("reflectivity", &BestFitMean::reflectivity) - .def_readwrite("sld", &BestFitMean::sld) - .def_readwrite("chi", &BestFitMean::chi) - .def_readwrite("data", &BestFitMean::data); - py::class_(m, "ConfidenceIntervals") .def(py::init<>()) .def_readwrite("percentile95", &ConfidenceIntervals::percentile95) @@ -1325,7 +1304,6 @@ PYBIND11_MODULE(rat_core, m) { py::class_(m, "BayesResults") .def(py::init<>()) - .def_readwrite("bestFitMean", &BayesResults::bestFitMean) .def_readwrite("predictionIntervals", &BayesResults::predictionIntervals) .def_readwrite("confidenceIntervals", &BayesResults::confidenceIntervals) .def_readwrite("dreamParams", &BayesResults::dreamParams) @@ -1358,7 +1336,7 @@ PYBIND11_MODULE(rat_core, m) { .def_readwrite("resampledLayers", &OutputResult::resampledLayers) .def_readwrite("calculationResults", &OutputResult::calculationResults) .def_readwrite("contrastParams", &OutputResult::contrastParams) - .def_readwrite("bestFitParams", &OutputResult::fitParams) + .def_readwrite("fitParams", &OutputResult::fitParams) .def_readwrite("fitNames", &OutputResult::fitNames); py::class_(m, "Checks") diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 00000000..3c162486 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,1796 @@ +import numpy as np +import pytest + +import RAT +import RAT.outputs +import RAT.rat_core + + +@pytest.fixture +def reflectivity_calculation_output_results(): + """The C++ results object for a reflectivity calculation of the project set out in "DSPC_standard_layers.py".""" + results = RAT.rat_core.OutputResult() + results.reflectivity = [np.array([[1.14030000e-02, 1.00000223e+00], + [1.38610000e-02, 1.00000223e+00], + [1.68480000e-02, 6.42692703e-02], + [2.04790000e-02, 1.69530247e-02], + [2.48920000e-02, 6.18815370e-03], + [3.02560000e-02, 2.99474163e-03], + [3.67770000e-02, 1.73558265e-03], + [4.47020000e-02, 1.03290554e-03], + [5.43360000e-02, 6.45645642e-04], + [6.60450000e-02, 5.57949197e-04], + [8.02790000e-02, 5.58974858e-04], + [9.75790000e-02, 3.49803750e-04], + [1.18610000e-01, 8.89485853e-05], + [1.44170000e-01, 4.04713900e-05], + [1.75240000e-01, 6.98590391e-06], + [2.13000000e-01, 3.60410795e-06], + [2.58910000e-01, 2.41835671e-06], + [3.14700000e-01, 2.26496635e-06], + [3.82520000e-01, 2.26396064e-06], + [4.64960000e-01, 2.24609517e-06], + [5.65160000e-01, 2.23162115e-06]]), + np.array([[1.14030000e-02, 1.53247324e-02], + [1.38610000e-02, 9.89602164e-03], + [1.68480000e-02, 6.26868663e-03], + [2.04790000e-02, 3.83918877e-03], + [2.48920000e-02, 2.21818017e-03], + [3.02560000e-02, 1.15473774e-03], + [3.67770000e-02, 4.92469653e-04], + [4.47020000e-02, 1.37287345e-04], + [5.43360000e-02, 2.28561535e-05], + [6.60450000e-02, 6.63620782e-05], + [8.02790000e-02, 1.36790069e-04], + [9.75790000e-02, 1.15354200e-04], + [1.18610000e-01, 3.73063683e-05], + [1.44170000e-01, 1.21263573e-05], + [1.75240000e-01, 6.59103452e-06], + [2.13000000e-01, 4.38321947e-06], + [2.58910000e-01, 3.40797246e-06], + [3.14700000e-01, 3.41625063e-06], + [3.82520000e-01, 3.40076933e-06], + [4.64960000e-01, 3.38892224e-06], + [5.65160000e-01, 3.38103236e-06]])] + results.simulation = [np.array([[1.14030000e-02, 1.00000223e+00], + [1.38610000e-02, 1.00000223e+00], + [1.68480000e-02, 6.42692703e-02], + [2.04790000e-02, 1.69530247e-02], + [2.48920000e-02, 6.18815370e-03], + [3.02560000e-02, 2.99474163e-03], + [3.67770000e-02, 1.73558265e-03], + [4.47020000e-02, 1.03290554e-03], + [5.43360000e-02, 6.45645642e-04], + [6.60450000e-02, 5.57949197e-04], + [8.02790000e-02, 5.58974858e-04], + [9.75790000e-02, 3.49803750e-04], + [1.18610000e-01, 8.89485853e-05], + [1.44170000e-01, 4.04713900e-05], + [1.75240000e-01, 6.98590391e-06], + [2.13000000e-01, 3.60410795e-06], + [2.58910000e-01, 2.41835671e-06], + [3.14700000e-01, 2.26496635e-06], + [3.82520000e-01, 2.26396064e-06], + [4.64960000e-01, 2.24609517e-06], + [5.65160000e-01, 2.23162115e-06]]), + np.array([[1.14030000e-02, 1.53247324e-02], + [1.38610000e-02, 9.89602164e-03], + [1.68480000e-02, 6.26868663e-03], + [2.04790000e-02, 3.83918877e-03], + [2.48920000e-02, 2.21818017e-03], + [3.02560000e-02, 1.15473774e-03], + [3.67770000e-02, 4.92469653e-04], + [4.47020000e-02, 1.37287345e-04], + [5.43360000e-02, 2.28561535e-05], + [6.60450000e-02, 6.63620782e-05], + [8.02790000e-02, 1.36790069e-04], + [9.75790000e-02, 1.15354200e-04], + [1.18610000e-01, 3.73063683e-05], + [1.44170000e-01, 1.21263573e-05], + [1.75240000e-01, 6.59103452e-06], + [2.13000000e-01, 4.38321947e-06], + [2.58910000e-01, 3.40797246e-06], + [3.14700000e-01, 3.41625063e-06], + [3.82520000e-01, 3.40076933e-06], + [4.64960000e-01, 3.38892224e-06], + [5.65160000e-01, 3.38103236e-06]])] + results.shiftedData = [np.array([[1.1403e-02, 1.0063e+00, 1.9003e-02], + [1.3861e-02, 9.0118e-01, 1.1774e-02], + [1.6848e-02, 7.0455e-02, 1.3083e-03], + [2.0479e-02, 1.7544e-02, 5.1254e-04], + [2.4892e-02, 6.4257e-03, 2.6236e-04], + [3.0256e-02, 2.7746e-03, 8.5758e-05], + [3.6777e-02, 1.8591e-03, 4.9391e-05], + [4.4702e-02, 1.1002e-03, 3.2644e-05], + [5.4336e-02, 6.6691e-04, 2.1365e-05], + [6.6045e-02, 6.0729e-04, 1.1791e-05], + [8.0279e-02, 5.8755e-04, 1.5569e-05], + [9.7579e-02, 3.2700e-04, 6.5280e-06], + [1.1861e-01, 7.8205e-05, 2.5881e-06], + [1.4417e-01, 3.3455e-05, 1.5143e-06], + [1.7524e-01, 4.9313e-06, 5.6663e-07], + [2.1300e-01, 4.1948e-06, 6.8549e-07], + [2.5891e-01, 3.9863e-06, 8.2061e-07], + [3.1470e-01, 2.0861e-06, 6.1379e-07], + [3.8252e-01, 2.1154e-06, 6.3084e-07], + [4.6496e-01, 1.9906e-06, 6.0793e-07], + [5.6516e-01, 2.3816e-06, 7.0610e-07]]), + np.array([[1.14030000e-02, 1.20493333e-02, 7.32200000e-04], + [1.38610000e-02, 6.71800000e-03, 3.71853333e-04], + [1.68480000e-02, 4.10506667e-03, 2.23106667e-04], + [2.04790000e-02, 2.43306667e-03, 1.46873333e-04], + [2.48920000e-02, 1.40940000e-03, 9.59200000e-05], + [3.02560000e-02, 7.43400000e-04, 3.50226667e-05], + [3.67770000e-02, 3.51466667e-04, 1.59573333e-05], + [4.47020000e-02, 9.80666667e-05, 7.29466667e-06], + [5.43360000e-02, 1.73500000e-05, 2.59200000e-06], + [6.60450000e-02, 4.86286667e-05, 2.46453333e-06], + [8.02790000e-02, 9.71733333e-05, 4.68166667e-06], + [9.75790000e-02, 7.06533333e-05, 2.32180000e-06], + [1.18610000e-01, 1.93046667e-05, 1.00813333e-06], + [1.44170000e-01, 6.61193333e-06, 5.29773333e-07], + [1.75240000e-01, 3.23726667e-06, 3.65933333e-07], + [2.13000000e-01, 3.29920000e-06, 4.74273333e-07], + [2.58910000e-01, 1.71180000e-06, 4.24720000e-07], + [3.14700000e-01, 2.24020000e-06, 5.08946667e-07], + [3.82520000e-01, 2.73306667e-06, 5.71513333e-07], + [4.64960000e-01, 2.36153333e-06, 5.24806667e-07], + [5.65160000e-01, 2.17460000e-06, 5.31346667e-07]])] + results.layerSlds = [[np.array([[1.954000e+01, 4.001499e-06, 3.000000e+00], + [2.266000e+01, -6.586988e-08, 3.000000e+00], + [8.560000e+00, 3.672535e-06, 5.640000e+00], + [1.712000e+01, 5.980000e-06, 5.640000e+00], + [1.070000e+01, 3.100365e-06, 6.014000e+00], + [1.782000e+01, 6.751924e-07, 6.014000e+00], + [1.782000e+01, 6.751924e-07, 6.014000e+00], + [1.070000e+01, 3.100365e-06, 6.014000e+00]])], + [np.array([[1.9540000e+01, 3.1114020e-06, 3.0000000e+00], + [2.2660000e+01, -2.6387028e-07, 3.0000000e+00], + [8.5600000e+00, 1.9590700e-06, 5.6400000e+00], + [1.7120000e+01, 2.2100000e-06, 5.6400000e+00], + [1.0700000e+01, 1.7375100e-06, 6.0140000e+00], + [1.7820000e+01, 1.0164400e-08, 6.0140000e+00], + [1.7820000e+01, 1.0164400e-08, 6.0140000e+00], + [1.0700000e+01, 1.7375100e-06, 6.0140000e+00]])]] + results.sldProfiles = [[np.array([[0.00000000e+00, 2.07300000e-06], + [1.10000000e+01, 2.07300000e-06], + [2.20000000e+01, 2.07300000e-06], + [3.30000000e+01, 2.07300001e-06], + [4.40000000e+01, 2.11687361e-06], + [5.50000000e+01, 3.90933280e-06], + [6.60000000e+01, 3.51748792e-06], + [7.70000000e+01, -2.64615370e-08], + [8.80000000e+01, 8.14665196e-07], + [9.90000000e+01, 4.11508879e-06], + [1.10000000e+02, 5.58392432e-06], + [1.21000000e+02, 3.71785214e-06], + [1.32000000e+02, 1.39304140e-06], + [1.43000000e+02, 6.95745588e-07], + [1.54000000e+02, 7.84170141e-07], + [1.65000000e+02, 2.15552213e-06], + [1.76000000e+02, 4.68458332e-06], + [1.87000000e+02, 5.91563638e-06], + [1.98000000e+02, 5.97982117e-06], + [2.09000000e+02, 5.97999998e-06], + [2.20000000e+02, 5.98000000e-06], + [2.31000000e+02, 5.98000000e-06], + [2.42000000e+02, 5.98000000e-06], + [2.53000000e+02, 5.98000000e-06], + [2.64000000e+02, 5.98000000e-06]]), + np.array([[0.00000000e+00, 2.07300000e-06], + [1.10000000e+01, 2.07300000e-06], + [2.20000000e+01, 2.07300000e-06], + [3.30000000e+01, 2.07300001e-06], + [4.40000000e+01, 2.09662378e-06], + [5.50000000e+01, 3.06177428e-06], + [6.60000000e+01, 2.70974796e-06], + [7.70000000e+01, -2.34283042e-07], + [8.80000000e+01, 2.46446429e-07], + [9.90000000e+01, 1.80004279e-06], + [1.10000000e+02, 2.14886270e-06], + [1.21000000e+02, 1.70090192e-06], + [1.32000000e+02, 5.06554250e-07], + [1.43000000e+02, 2.47801381e-08], + [1.54000000e+02, 8.73866316e-08], + [1.65000000e+02, 9.86362863e-07], + [1.76000000e+02, 1.96411923e-06], + [1.87000000e+02, 2.19933821e-06], + [1.98000000e+02, 2.20997064e-06], + [2.09000000e+02, 2.21000000e-06], + [2.20000000e+02, 2.21000000e-06], + [2.31000000e+02, 2.21000000e-06], + [2.42000000e+02, 2.21000000e-06], + [2.53000000e+02, 2.21000000e-06], + [2.64000000e+02, 2.21000000e-06]])]] + results.resampledLayers = [[np.array([[0.0, 0.0, 0.0]])], [np.array([[0.0, 0.0, 0.0]])]] + results.calculationResults = RAT.rat_core.Calculation() + results.calculationResults.chiValues = np.array([202.83057377, 1641.4024969]) + results.calculationResults.sumChi = 1844.2330706690975 + results.contrastParams = RAT.rat_core.ContrastParams() + results.contrastParams.backgroundParams = np.array([2.23e-06, 3.38e-06]) + results.contrastParams.scalefactors = np.array([0.1, 0.15]) + results.contrastParams.bulkIn = np.array([2.073e-06, 2.073e-06]) + results.contrastParams.bulkOut = np.array([5.98e-06, 2.21e-06]) + results.contrastParams.resolutionParams = np.array([0.03, 0.03]) + results.contrastParams.subRoughs = np.array([3.0, 3.0]) + results.contrastParams.resample = np.array([0.0, 0.0]) + results.fitParams = np.array([3.000e+00, 1.954e+01, 2.266e+01, 5.252e+00, 5.640e+00, 1.712e+01, 8.560e+00, + 4.545e+01, 1.070e+01, 6.014e+00, 1.782e+01, 1.764e+01, 3.615e+01, 2.361e+01, + 2.230e-06, 3.380e-06, 5.980e-06, 2.210e-06]) + results.fitNames = ['Substrate Roughness', 'Oxide Thickness', 'SAM Tails Thickness', 'SAM Tails Hydration', + 'SAM Roughness', 'CW Thickness', 'SAM Heads Thickness', 'SAM Heads Hydration', + 'Bilayer Heads Thickness', 'Bilayer Roughness', 'Bilayer Tails Thickness', + 'Bilayer Tails Hydration', 'Bilayer Heads Hydration', 'Oxide Hydration', + 'Background parameter D2O', 'Background parameter SMW', 'D2O', 'SMW'] + + return results + + +@pytest.fixture +def reflectivity_calculation_results(): + """The python results object for a reflectivity calculation of the project set out in "DSPC_standard_layers.py".""" + return RAT.outputs.Results( + reflectivity=[np.array([[1.14030000e-02, 1.00000223e+00], + [1.38610000e-02, 1.00000223e+00], + [1.68480000e-02, 6.42692703e-02], + [2.04790000e-02, 1.69530247e-02], + [2.48920000e-02, 6.18815370e-03], + [3.02560000e-02, 2.99474163e-03], + [3.67770000e-02, 1.73558265e-03], + [4.47020000e-02, 1.03290554e-03], + [5.43360000e-02, 6.45645642e-04], + [6.60450000e-02, 5.57949197e-04], + [8.02790000e-02, 5.58974858e-04], + [9.75790000e-02, 3.49803750e-04], + [1.18610000e-01, 8.89485853e-05], + [1.44170000e-01, 4.04713900e-05], + [1.75240000e-01, 6.98590391e-06], + [2.13000000e-01, 3.60410795e-06], + [2.58910000e-01, 2.41835671e-06], + [3.14700000e-01, 2.26496635e-06], + [3.82520000e-01, 2.26396064e-06], + [4.64960000e-01, 2.24609517e-06], + [5.65160000e-01, 2.23162115e-06]]), + np.array([[1.14030000e-02, 1.53247324e-02], + [1.38610000e-02, 9.89602164e-03], + [1.68480000e-02, 6.26868663e-03], + [2.04790000e-02, 3.83918877e-03], + [2.48920000e-02, 2.21818017e-03], + [3.02560000e-02, 1.15473774e-03], + [3.67770000e-02, 4.92469653e-04], + [4.47020000e-02, 1.37287345e-04], + [5.43360000e-02, 2.28561535e-05], + [6.60450000e-02, 6.63620782e-05], + [8.02790000e-02, 1.36790069e-04], + [9.75790000e-02, 1.15354200e-04], + [1.18610000e-01, 3.73063683e-05], + [1.44170000e-01, 1.21263573e-05], + [1.75240000e-01, 6.59103452e-06], + [2.13000000e-01, 4.38321947e-06], + [2.58910000e-01, 3.40797246e-06], + [3.14700000e-01, 3.41625063e-06], + [3.82520000e-01, 3.40076933e-06], + [4.64960000e-01, 3.38892224e-06], + [5.65160000e-01, 3.38103236e-06]])], + simulation=[np.array([[1.14030000e-02, 1.00000223e+00], + [1.38610000e-02, 1.00000223e+00], + [1.68480000e-02, 6.42692703e-02], + [2.04790000e-02, 1.69530247e-02], + [2.48920000e-02, 6.18815370e-03], + [3.02560000e-02, 2.99474163e-03], + [3.67770000e-02, 1.73558265e-03], + [4.47020000e-02, 1.03290554e-03], + [5.43360000e-02, 6.45645642e-04], + [6.60450000e-02, 5.57949197e-04], + [8.02790000e-02, 5.58974858e-04], + [9.75790000e-02, 3.49803750e-04], + [1.18610000e-01, 8.89485853e-05], + [1.44170000e-01, 4.04713900e-05], + [1.75240000e-01, 6.98590391e-06], + [2.13000000e-01, 3.60410795e-06], + [2.58910000e-01, 2.41835671e-06], + [3.14700000e-01, 2.26496635e-06], + [3.82520000e-01, 2.26396064e-06], + [4.64960000e-01, 2.24609517e-06], + [5.65160000e-01, 2.23162115e-06]]), + np.array([[1.14030000e-02, 1.53247324e-02], + [1.38610000e-02, 9.89602164e-03], + [1.68480000e-02, 6.26868663e-03], + [2.04790000e-02, 3.83918877e-03], + [2.48920000e-02, 2.21818017e-03], + [3.02560000e-02, 1.15473774e-03], + [3.67770000e-02, 4.92469653e-04], + [4.47020000e-02, 1.37287345e-04], + [5.43360000e-02, 2.28561535e-05], + [6.60450000e-02, 6.63620782e-05], + [8.02790000e-02, 1.36790069e-04], + [9.75790000e-02, 1.15354200e-04], + [1.18610000e-01, 3.73063683e-05], + [1.44170000e-01, 1.21263573e-05], + [1.75240000e-01, 6.59103452e-06], + [2.13000000e-01, 4.38321947e-06], + [2.58910000e-01, 3.40797246e-06], + [3.14700000e-01, 3.41625063e-06], + [3.82520000e-01, 3.40076933e-06], + [4.64960000e-01, 3.38892224e-06], + [5.65160000e-01, 3.38103236e-06]])], + shiftedData=[np.array([[1.1403e-02, 1.0063e+00, 1.9003e-02], + [1.3861e-02, 9.0118e-01, 1.1774e-02], + [1.6848e-02, 7.0455e-02, 1.3083e-03], + [2.0479e-02, 1.7544e-02, 5.1254e-04], + [2.4892e-02, 6.4257e-03, 2.6236e-04], + [3.0256e-02, 2.7746e-03, 8.5758e-05], + [3.6777e-02, 1.8591e-03, 4.9391e-05], + [4.4702e-02, 1.1002e-03, 3.2644e-05], + [5.4336e-02, 6.6691e-04, 2.1365e-05], + [6.6045e-02, 6.0729e-04, 1.1791e-05], + [8.0279e-02, 5.8755e-04, 1.5569e-05], + [9.7579e-02, 3.2700e-04, 6.5280e-06], + [1.1861e-01, 7.8205e-05, 2.5881e-06], + [1.4417e-01, 3.3455e-05, 1.5143e-06], + [1.7524e-01, 4.9313e-06, 5.6663e-07], + [2.1300e-01, 4.1948e-06, 6.8549e-07], + [2.5891e-01, 3.9863e-06, 8.2061e-07], + [3.1470e-01, 2.0861e-06, 6.1379e-07], + [3.8252e-01, 2.1154e-06, 6.3084e-07], + [4.6496e-01, 1.9906e-06, 6.0793e-07], + [5.6516e-01, 2.3816e-06, 7.0610e-07]]), + np.array([[1.14030000e-02, 1.20493333e-02, 7.32200000e-04], + [1.38610000e-02, 6.71800000e-03, 3.71853333e-04], + [1.68480000e-02, 4.10506667e-03, 2.23106667e-04], + [2.04790000e-02, 2.43306667e-03, 1.46873333e-04], + [2.48920000e-02, 1.40940000e-03, 9.59200000e-05], + [3.02560000e-02, 7.43400000e-04, 3.50226667e-05], + [3.67770000e-02, 3.51466667e-04, 1.59573333e-05], + [4.47020000e-02, 9.80666667e-05, 7.29466667e-06], + [5.43360000e-02, 1.73500000e-05, 2.59200000e-06], + [6.60450000e-02, 4.86286667e-05, 2.46453333e-06], + [8.02790000e-02, 9.71733333e-05, 4.68166667e-06], + [9.75790000e-02, 7.06533333e-05, 2.32180000e-06], + [1.18610000e-01, 1.93046667e-05, 1.00813333e-06], + [1.44170000e-01, 6.61193333e-06, 5.29773333e-07], + [1.75240000e-01, 3.23726667e-06, 3.65933333e-07], + [2.13000000e-01, 3.29920000e-06, 4.74273333e-07], + [2.58910000e-01, 1.71180000e-06, 4.24720000e-07], + [3.14700000e-01, 2.24020000e-06, 5.08946667e-07], + [3.82520000e-01, 2.73306667e-06, 5.71513333e-07], + [4.64960000e-01, 2.36153333e-06, 5.24806667e-07], + [5.65160000e-01, 2.17460000e-06, 5.31346667e-07]])], + layerSlds=[[np.array([[1.954000e+01, 4.001499e-06, 3.000000e+00], + [2.266000e+01, -6.586988e-08, 3.000000e+00], + [8.560000e+00, 3.672535e-06, 5.640000e+00], + [1.712000e+01, 5.980000e-06, 5.640000e+00], + [1.070000e+01, 3.100365e-06, 6.014000e+00], + [1.782000e+01, 6.751924e-07, 6.014000e+00], + [1.782000e+01, 6.751924e-07, 6.014000e+00], + [1.070000e+01, 3.100365e-06, 6.014000e+00]])], + [np.array([[1.9540000e+01, 3.1114020e-06, 3.0000000e+00], + [2.2660000e+01, -2.6387028e-07, 3.0000000e+00], + [8.5600000e+00, 1.9590700e-06, 5.6400000e+00], + [1.7120000e+01, 2.2100000e-06, 5.6400000e+00], + [1.0700000e+01, 1.7375100e-06, 6.0140000e+00], + [1.7820000e+01, 1.0164400e-08, 6.0140000e+00], + [1.7820000e+01, 1.0164400e-08, 6.0140000e+00], + [1.0700000e+01, 1.7375100e-06, 6.0140000e+00]])]], + sldProfiles=[[np.array([[0.00000000e+00, 2.07300000e-06], + [1.10000000e+01, 2.07300000e-06], + [2.20000000e+01, 2.07300000e-06], + [3.30000000e+01, 2.07300001e-06], + [4.40000000e+01, 2.11687361e-06], + [5.50000000e+01, 3.90933280e-06], + [6.60000000e+01, 3.51748792e-06], + [7.70000000e+01, -2.64615370e-08], + [8.80000000e+01, 8.14665196e-07], + [9.90000000e+01, 4.11508879e-06], + [1.10000000e+02, 5.58392432e-06], + [1.21000000e+02, 3.71785214e-06], + [1.32000000e+02, 1.39304140e-06], + [1.43000000e+02, 6.95745588e-07], + [1.54000000e+02, 7.84170141e-07], + [1.65000000e+02, 2.15552213e-06], + [1.76000000e+02, 4.68458332e-06], + [1.87000000e+02, 5.91563638e-06], + [1.98000000e+02, 5.97982117e-06], + [2.09000000e+02, 5.97999998e-06], + [2.20000000e+02, 5.98000000e-06], + [2.31000000e+02, 5.98000000e-06], + [2.42000000e+02, 5.98000000e-06], + [2.53000000e+02, 5.98000000e-06], + [2.64000000e+02, 5.98000000e-06]]), + np.array([[0.00000000e+00, 2.07300000e-06], + [1.10000000e+01, 2.07300000e-06], + [2.20000000e+01, 2.07300000e-06], + [3.30000000e+01, 2.07300001e-06], + [4.40000000e+01, 2.09662378e-06], + [5.50000000e+01, 3.06177428e-06], + [6.60000000e+01, 2.70974796e-06], + [7.70000000e+01, -2.34283042e-07], + [8.80000000e+01, 2.46446429e-07], + [9.90000000e+01, 1.80004279e-06], + [1.10000000e+02, 2.14886270e-06], + [1.21000000e+02, 1.70090192e-06], + [1.32000000e+02, 5.06554250e-07], + [1.43000000e+02, 2.47801381e-08], + [1.54000000e+02, 8.73866316e-08], + [1.65000000e+02, 9.86362863e-07], + [1.76000000e+02, 1.96411923e-06], + [1.87000000e+02, 2.19933821e-06], + [1.98000000e+02, 2.20997064e-06], + [2.09000000e+02, 2.21000000e-06], + [2.20000000e+02, 2.21000000e-06], + [2.31000000e+02, 2.21000000e-06], + [2.42000000e+02, 2.21000000e-06], + [2.53000000e+02, 2.21000000e-06], + [2.64000000e+02, 2.21000000e-06]])]], + resampledLayers=[[np.array([[0.0, 0.0, 0.0]])], [np.array([[0.0, 0.0, 0.0]])]], + calculationResults=RAT.outputs.CalculationResults(chiValues=np.array([202.83057377, 1641.4024969]), + sumChi=1844.2330706690975), + contrastParams=RAT.outputs.ContrastParams(backgroundParams=np.array([2.23e-06, 3.38e-06]), + scalefactors=np.array([0.1, 0.15]), + bulkIn=np.array([2.073e-06, 2.073e-06]), + bulkOut=np.array([5.98e-06, 2.21e-06]), + resolutionParams=np.array([0.03, 0.03]), + subRoughs=np.array([3.0, 3.0]), + resample=np.array([0.0, 0.0])), + fitParams=np.array([3.000e+00, 1.954e+01, 2.266e+01, 5.252e+00, 5.640e+00, 1.712e+01, 8.560e+00, 4.545e+01, + 1.070e+01, 6.014e+00, 1.782e+01, 1.764e+01, 3.615e+01, 2.361e+01, 2.230e-06, 3.380e-06, + 5.980e-06, 2.210e-06]), + fitNames=['Substrate Roughness', 'Oxide Thickness', 'SAM Tails Thickness', 'SAM Tails Hydration', + 'SAM Roughness', 'CW Thickness', 'SAM Heads Thickness', 'SAM Heads Hydration', + 'Bilayer Heads Thickness', 'Bilayer Roughness', 'Bilayer Tails Thickness', + 'Bilayer Tails Hydration', 'Bilayer Heads Hydration', 'Oxide Hydration', + 'Background parameter D2O', 'Background parameter SMW', 'D2O', 'SMW'] + ) + + +@pytest.fixture +def dream_output_results(): + """The C++ results object for a Dream optimisation of the project set out in "DSPC_standard_layers.py". + + This optimisation used the parameters: nSamples=1, nChains=1. However, the calculationResults, contrastParams, + and fitParams are taken from an optimisation with the parameters: nSamples=50000, nChains=10. + """ + results = RAT.rat_core.OutputResult() + results.reflectivity = [np.array([[1.14030000e-02, 1.45891447e+01], + [1.38610000e-02, 1.45739839e+01], + [1.68480000e-02, 1.45684725e+01], + [2.04790000e-02, 1.45658452e+01], + [2.48920000e-02, 1.45641513e+01], + [3.02560000e-02, 1.45628311e+01], + [3.67770000e-02, 1.45618510e+01], + [4.47020000e-02, 1.45613427e+01], + [5.43360000e-02, 1.45612940e+01], + [6.60450000e-02, 1.45613971e+01], + [8.02790000e-02, 1.45613678e+01], + [9.75790000e-02, 1.45612960e+01], + [1.18610000e-01, 1.45612799e+01], + [1.44170000e-01, 1.45612749e+01], + [1.75240000e-01, 1.45612726e+01], + [2.13000000e-01, 1.45612723e+01], + [2.58910000e-01, 1.45612724e+01], + [3.14700000e-01, 1.45612723e+01], + [3.82520000e-01, 1.45612723e+01], + [4.64960000e-01, 1.45612723e+01], + [5.65160000e-01, 1.45612723e+01]]), + np.array([[1.14030000e-02, 1.00000316e+00], + [1.38610000e-02, 1.21238320e-01], + [1.68480000e-02, 2.13433068e-02], + [2.04790000e-02, 8.71162144e-03], + [2.48920000e-02, 5.72807902e-03], + [3.02560000e-02, 3.71827525e-03], + [3.67770000e-02, 1.72067772e-03], + [4.47020000e-02, 3.51471141e-04], + [5.43360000e-02, 2.03975460e-05], + [6.60450000e-02, 1.89221181e-04], + [8.02790000e-02, 1.49280488e-04], + [9.75790000e-02, 3.86439083e-05], + [1.18610000e-01, 1.63612094e-05], + [1.44170000e-01, 6.75770325e-06], + [1.75240000e-01, 3.45955607e-06], + [2.13000000e-01, 3.20880782e-06], + [2.58910000e-01, 3.32068345e-06], + [3.14700000e-01, 3.21671807e-06], + [3.82520000e-01, 3.15612021e-06], + [4.64960000e-01, 3.15645546e-06], + [5.65160000e-01, 3.15511510e-06]])] + results.simulation = [np.array([[1.14030000e-02, 1.45891447e+01], + [1.38610000e-02, 1.45739839e+01], + [1.68480000e-02, 1.45684725e+01], + [2.04790000e-02, 1.45658452e+01], + [2.48920000e-02, 1.45641513e+01], + [3.02560000e-02, 1.45628311e+01], + [3.67770000e-02, 1.45618510e+01], + [4.47020000e-02, 1.45613427e+01], + [5.43360000e-02, 1.45612940e+01], + [6.60450000e-02, 1.45613971e+01], + [8.02790000e-02, 1.45613678e+01], + [9.75790000e-02, 1.45612960e+01], + [1.18610000e-01, 1.45612799e+01], + [1.44170000e-01, 1.45612749e+01], + [1.75240000e-01, 1.45612726e+01], + [2.13000000e-01, 1.45612723e+01], + [2.58910000e-01, 1.45612724e+01], + [3.14700000e-01, 1.45612723e+01], + [3.82520000e-01, 1.45612723e+01], + [4.64960000e-01, 1.45612723e+01], + [5.65160000e-01, 1.45612723e+01]]), + np.array([[1.14030000e-02, 1.00000316e+00], + [1.38610000e-02, 1.21238320e-01], + [1.68480000e-02, 2.13433068e-02], + [2.04790000e-02, 8.71162144e-03], + [2.48920000e-02, 5.72807902e-03], + [3.02560000e-02, 3.71827525e-03], + [3.67770000e-02, 1.72067772e-03], + [4.47020000e-02, 3.51471141e-04], + [5.43360000e-02, 2.03975460e-05], + [6.60450000e-02, 1.89221181e-04], + [8.02790000e-02, 1.49280488e-04], + [9.75790000e-02, 3.86439083e-05], + [1.18610000e-01, 1.63612094e-05], + [1.44170000e-01, 6.75770325e-06], + [1.75240000e-01, 3.45955607e-06], + [2.13000000e-01, 3.20880782e-06], + [2.58910000e-01, 3.32068345e-06], + [3.14700000e-01, 3.21671807e-06], + [3.82520000e-01, 3.15612021e-06], + [4.64960000e-01, 3.15645546e-06], + [5.65160000e-01, 3.15511510e-06]])] + results.shiftedData = [np.array([[1.1403e-02, 1.0063e+00, 1.9003e-02], + [1.3861e-02, 9.0118e-01, 1.1774e-02], + [1.6848e-02, 7.0455e-02, 1.3083e-03], + [2.0479e-02, 1.7544e-02, 5.1254e-04], + [2.4892e-02, 6.4257e-03, 2.6236e-04], + [3.0256e-02, 2.7746e-03, 8.5758e-05], + [3.6777e-02, 1.8591e-03, 4.9391e-05], + [4.4702e-02, 1.1002e-03, 3.2644e-05], + [5.4336e-02, 6.6691e-04, 2.1365e-05], + [6.6045e-02, 6.0729e-04, 1.1791e-05], + [8.0279e-02, 5.8755e-04, 1.5569e-05], + [9.7579e-02, 3.2700e-04, 6.5280e-06], + [1.1861e-01, 7.8205e-05, 2.5881e-06], + [1.4417e-01, 3.3455e-05, 1.5143e-06], + [1.7524e-01, 4.9313e-06, 5.6663e-07], + [2.1300e-01, 4.1948e-06, 6.8549e-07], + [2.5891e-01, 3.9863e-06, 8.2061e-07], + [3.1470e-01, 2.0861e-06, 6.1379e-07], + [3.8252e-01, 2.1154e-06, 6.3084e-07], + [4.6496e-01, 1.9906e-06, 6.0793e-07], + [5.6516e-01, 2.3816e-06, 7.0610e-07]]), + np.array([[1.14030000e-02, 1.20493333e-02, 7.32200000e-04], + [1.38610000e-02, 6.71800000e-03, 3.71853333e-04], + [1.68480000e-02, 4.10506667e-03, 2.23106667e-04], + [2.04790000e-02, 2.43306667e-03, 1.46873333e-04], + [2.48920000e-02, 1.40940000e-03, 9.59200000e-05], + [3.02560000e-02, 7.43400000e-04, 3.50226667e-05], + [3.67770000e-02, 3.51466667e-04, 1.59573333e-05], + [4.47020000e-02, 9.80666667e-05, 7.29466667e-06], + [5.43360000e-02, 1.73500000e-05, 2.59200000e-06], + [6.60450000e-02, 4.86286667e-05, 2.46453333e-06], + [8.02790000e-02, 9.71733333e-05, 4.68166667e-06], + [9.75790000e-02, 7.06533333e-05, 2.32180000e-06], + [1.18610000e-01, 1.93046667e-05, 1.00813333e-06], + [1.44170000e-01, 6.61193333e-06, 5.29773333e-07], + [1.75240000e-01, 3.23726667e-06, 3.65933333e-07], + [2.13000000e-01, 3.29920000e-06, 4.74273333e-07], + [2.58910000e-01, 1.71180000e-06, 4.24720000e-07], + [3.14700000e-01, 2.24020000e-06, 5.08946667e-07], + [3.82520000e-01, 2.73306667e-06, 5.71513333e-07], + [4.64960000e-01, 2.36153333e-06, 5.24806667e-07], + [5.65160000e-01, 2.17460000e-06, 5.31346667e-07]])] + results.layerSlds = [[np.array([[3.15755349e+01, 3.35278238e-06, 4.16625659e+00], + [3.61791464e+01, 7.68327921e-07, 4.16625659e+00], + [1.00488530e+01, 2.06044530e-06, 2.78042232e+01], + [1.08043784e+01, 3.29384190e-06, 2.78042232e+01], + [2.42251646e+01, 2.35556998e-06, 1.55593097e+01], + [1.49022278e+01, 7.42138004e-07, 1.55593097e+01], + [1.49022278e+01, 7.42138004e-07, 1.55593097e+01], + [2.42251646e+01, 2.35556998e-06, 1.55593097e+01]])], + [np.array([[3.15755349e+01, 4.11636356e-06, 4.16625659e+00], + [3.61791464e+01, 1.39268494e-06, 4.16625659e+00], + [1.00488530e+01, 2.45715680e-06, 2.78042232e+01], + [1.08043784e+01, 5.26668495e-06, 2.78042232e+01], + [2.42251646e+01, 3.31348777e-06, 1.55593097e+01], + [1.49022278e+01, 1.37428245e-06, 1.55593097e+01], + [1.49022278e+01, 1.37428245e-06, 1.55593097e+01], + [2.42251646e+01, 3.31348777e-06, 1.55593097e+01]])]] + results.sldProfiles = [[np.array([[0.00000000e+00, 2.07301741e-06], + [1.10000000e+01, 2.07309604e-06], + [2.20000000e+01, 2.07345780e-06], + [3.30000000e+01, 2.07491687e-06], + [4.40000000e+01, 2.17562259e-06], + [5.50000000e+01, 3.22650495e-06], + [6.60000000e+01, 3.40913848e-06], + [7.70000000e+01, 3.13506253e-06], + [8.80000000e+01, 1.20456289e-06], + [9.90000000e+01, 1.27138002e-06], + [1.10000000e+02, 1.56285495e-06], + [1.21000000e+02, 1.84518709e-06], + [1.32000000e+02, 2.00498449e-06], + [1.43000000e+02, 1.96260665e-06], + [1.54000000e+02, 1.71966879e-06], + [1.65000000e+02, 1.39383267e-06], + [1.76000000e+02, 1.22970195e-06], + [1.87000000e+02, 1.41565526e-06], + [1.98000000e+02, 1.88172657e-06], + [2.09000000e+02, 2.40655867e-06], + [2.20000000e+02, 2.83570420e-06], + [2.31000000e+02, 3.11210082e-06], + [2.42000000e+02, 3.24277802e-06], + [2.53000000e+02, 3.28427452e-06], + [2.64000000e+02, 3.29268847e-06], + [2.75000000e+02, 3.29375418e-06], + [2.86000000e+02, 3.29383773e-06], + [2.97000000e+02, 3.29384178e-06], + [3.08000000e+02, 3.29384190e-06]]), + np.array([[0.00000000e+00, 2.07301819e-06], + [1.10000000e+01, 2.07310296e-06], + [2.20000000e+01, 2.07350415e-06], + [3.30000000e+01, 2.07518460e-06], + [4.40000000e+01, 2.23394767e-06], + [5.50000000e+01, 3.90646736e-06], + [6.60000000e+01, 4.18619279e-06], + [7.70000000e+01, 3.91675004e-06], + [8.80000000e+01, 1.92451547e-06], + [9.90000000e+01, 2.06988861e-06], + [1.10000000e+02, 2.47614934e-06], + [1.21000000e+02, 2.84889288e-06], + [1.32000000e+02, 3.00529286e-06], + [1.43000000e+02, 2.86310144e-06], + [1.54000000e+02, 2.49967205e-06], + [1.65000000e+02, 2.09673058e-06], + [1.76000000e+02, 1.92431424e-06], + [1.87000000e+02, 2.18829605e-06], + [1.98000000e+02, 2.83032190e-06], + [2.09000000e+02, 3.62584708e-06], + [2.20000000e+02, 4.36871153e-06], + [2.31000000e+02, 4.89806866e-06], + [2.42000000e+02, 5.16145928e-06], + [2.53000000e+02, 5.24684298e-06], + [2.64000000e+02, 5.26428707e-06], + [2.75000000e+02, 5.26650242e-06], + [2.86000000e+02, 5.26667628e-06], + [2.97000000e+02, 5.26668469e-06], + [3.08000000e+02, 5.26668495e-06]])]] + results.resampledLayers = [[np.array([[0., 0., 0.]])], [np.array([[0., 0., 0.]])]] + results.calculationResults = RAT.rat_core.Calculation() + results.calculationResults.chiValues = np.array([4.6077885, 7.00028098]), + results.calculationResults.sumChi = 11.608069475997699 + results.contrastParams = RAT.rat_core.ContrastParams() + results.contrastParams.backgroundParams = np.array([2.37113128e-06, 1.99006694e-06]) + results.contrastParams.scalefactors = np.array([0.1, 0.15]) + results.contrastParams.bulkIn = np.array([2.073e-06, 2.073e-06]) + results.contrastParams.bulkOut = np.array([6.01489149e-06, 1.59371685e-06]) + results.contrastParams.resolutionParams = np.array([0.03, 0.03]) + results.contrastParams.subRoughs = np.array([6.19503045, 6.19503045]) + results.contrastParams.resample = np.array([0.0, 0.0]) + results.fitParams = np.array([6.19503045e+00, 1.84420960e+01, 2.11039621e+01, 8.75538121e+00, + 3.72292994e+00, 1.84624551e+01, 1.02316734e+01, 2.31156093e+01, + 1.09906265e+01, 5.71005361e+00, 1.67933822e+01, 1.72009856e+01, + 3.00260126e+01, 2.94448999e+01, 2.37113128e-06, 1.99006694e-06, + 6.01489149e-06, 1.59371685e-06]) + results.fitNames = ['Substrate Roughness', 'Oxide Thickness', 'SAM Tails Thickness', 'SAM Tails Hydration', + 'SAM Roughness', 'CW Thickness', 'SAM Heads Thickness', 'SAM Heads Hydration', + 'Bilayer Heads Thickness', 'Bilayer Roughness', 'Bilayer Tails Thickness', + 'Bilayer Tails Hydration', 'Bilayer Heads Hydration', 'Oxide Hydration', + 'Background parameter D2O', 'Background parameter SMW', 'D2O', 'SMW'] + + return results + + +@pytest.fixture +def dream_bayes(): + """The C++ BayesResults object for a dream optimisation of the project set out in "DSPC_standard_layers.py". + + This optimisation used the parameters: nSamples=1, nChains=1. + """ + bayes = RAT.rat_core.BayesResults() + bayes.predictionIntervals = RAT.rat_core.PredictionIntervals() + bayes.predictionIntervals.reflectivity = [np.array([[1.00000560e+00, 7.07687612e-01, 2.08315160e-02, 2.40787966e-03, + 2.17627660e-03, 2.54301700e-03, 1.76309827e-03, 6.15269679e-04, + 3.43679710e-05, 7.93625275e-05, 1.27760549e-04, 3.35799941e-05, + 6.75048751e-06, 7.64258431e-06, 6.05800395e-06, 5.60288298e-06, + 5.60333677e-06, 5.60223341e-06, 5.60206667e-06, 5.60206314e-06, + 5.60206314e-06], + [1.00000560e+00, 7.07687612e-01, 2.08315160e-02, 2.40787966e-03, + 2.17627660e-03, 2.54301700e-03, 1.76309827e-03, 6.15269679e-04, + 3.43679710e-05, 7.93625275e-05, 1.27760549e-04, 3.35799941e-05, + 6.75048751e-06, 7.64258431e-06, 6.05800395e-06, 5.60288298e-06, + 5.60333677e-06, 5.60223341e-06, 5.60206667e-06, 5.60206314e-06, + 5.60206314e-06], + [1.55201098e+01, 1.53748894e+01, 1.50402011e+01, 1.50299478e+01, + 1.50290525e+01, 1.50287935e+01, 1.50282126e+01, 1.50276044e+01, + 1.50273248e+01, 1.50273185e+01, 1.50272997e+01, 1.50272498e+01, + 1.50272364e+01, 1.50272347e+01, 1.50272335e+01, 1.50272330e+01, + 1.50272329e+01, 1.50272328e+01, 1.50272328e+01, 1.50272328e+01, + 1.50272328e+01], + [2.91397425e+01, 2.91324974e+01, 2.91281368e+01, 2.91255472e+01, + 2.91240295e+01, 2.91231836e+01, 2.91227893e+01, 2.91226872e+01, + 2.91226902e+01, 2.91226359e+01, 2.91225541e+01, 2.91225457e+01, + 2.91225448e+01, 2.91225407e+01, 2.91225398e+01, 2.91225393e+01, + 2.91225391e+01, 2.91225390e+01, 2.91225390e+01, 2.91225389e+01, + 2.91225389e+01], + [2.91397425e+01, 2.91324974e+01, 2.91281368e+01, 2.91255472e+01, + 2.91240295e+01, 2.91231836e+01, 2.91227893e+01, 2.91226872e+01, + 2.91226902e+01, 2.91226359e+01, 2.91225541e+01, 2.91225457e+01, + 2.91225448e+01, 2.91225407e+01, 2.91225398e+01, 2.91225393e+01, + 2.91225391e+01, 2.91225390e+01, 2.91225390e+01, 2.91225389e+01, + 2.91225389e+01]]), + np.array([[7.82198834e-01, 2.84434275e-02, 3.42472318e-03, 1.45801296e-03, + 2.02213149e-03, 2.00826891e-03, 1.27577246e-03, 4.27099544e-04, + 2.07304219e-05, 4.88683542e-05, 4.14000873e-05, 1.57801531e-05, + 2.08705254e-06, 2.27936213e-06, 1.09950377e-06, 7.09021331e-07, + 7.09539552e-07, 7.08228574e-07, 7.08101644e-07, 7.08098642e-07, + 7.08098641e-07], + [7.82198834e-01, 2.84434275e-02, 3.42472318e-03, 1.45801296e-03, + 2.02213149e-03, 2.00826891e-03, 1.27577246e-03, 4.27099544e-04, + 2.07304219e-05, 4.88683542e-05, 4.14000873e-05, 1.57801531e-05, + 2.08705254e-06, 2.27936213e-06, 1.09950377e-06, 7.09021331e-07, + 7.09539552e-07, 7.08228574e-07, 7.08101644e-07, 7.08098642e-07, + 7.08098641e-07], + [8.94587126e-01, 4.07514176e-01, 3.66355642e-02, 1.22207690e-02, + 5.91350591e-03, 3.17495745e-03, 1.50593011e-03, 5.80889579e-04, + 2.44654124e-04, 1.40925782e-04, 6.26965047e-05, 1.91064075e-05, + 9.45189755e-06, 6.16421495e-06, 5.17046678e-06, 4.24101973e-06, + 3.82067554e-06, 3.55352666e-06, 3.38981154e-06, 3.29631224e-06, + 3.25061722e-06], + [1.00000560e+00, 7.63076662e-01, 6.77868181e-02, 2.23160672e-02, + 9.56355479e-03, 4.26929321e-03, 1.72181442e-03, 7.25142247e-04, + 4.54691084e-04, 2.27274223e-04, 8.54009496e-05, 2.26525796e-05, + 1.63600080e-05, 9.80814666e-06, 8.98896697e-06, 7.55397947e-06, + 6.73887287e-06, 6.22237216e-06, 5.90521384e-06, 5.72401646e-06, + 5.63546023e-06], + [1.00000560e+00, 7.63076662e-01, 6.77868181e-02, 2.23160672e-02, + 9.56355479e-03, 4.26929321e-03, 1.72181442e-03, 7.25142247e-04, + 4.54691084e-04, 2.27274223e-04, 8.54009496e-05, 2.26525796e-05, + 1.63600080e-05, 9.80814666e-06, 8.98896697e-06, 7.55397947e-06, + 6.73887287e-06, 6.22237216e-06, 5.90521384e-06, 5.72401646e-06, + 5.63546023e-06]])] + bayes.predictionIntervals.sld = [[np.array([[-2.26996619e-06, -2.26938579e-06, -2.26877469e-06, ..., + 9.14568096e-07, 9.14567880e-07, 9.14567682e-07], + [-2.26996619e-06, -2.26938579e-06, -2.26877469e-06, ..., + 9.14568096e-07, 9.14567880e-07, 9.14567682e-07], + [-1.67970553e-07, -1.67671068e-07, -1.67355735e-07, ..., + 3.31763635e-06, 3.31763624e-06, 3.31763614e-06], + [2.07300000e-06, 2.07300000e-06, 2.07300001e-06, ..., + 5.87958515e-06, 5.87958515e-06, 5.87958515e-06], + [2.07300000e-06, 2.07300000e-06, 2.07300001e-06, ..., + 5.87958515e-06, 5.87958515e-06, 5.87958515e-06]])], + [np.array([[-1.35107208e-06, -1.34966627e-06, -1.34817823e-06, ..., + 4.65378475e-06, 4.65378475e-06, 4.65378475e-06], + [-1.35107208e-06, -1.34966627e-06, -1.34817823e-06, ..., + 4.65378475e-06, 4.65378475e-06, 4.65378475e-06], + [3.06178804e-07, 3.06904206e-07, 3.07672036e-07, ..., + 4.92477587e-06, 4.92477714e-06, 4.92477830e-06], + [2.07300000e-06, 2.07300000e-06, 2.07300001e-06, ..., + 5.17896134e-06, 5.17896381e-06, 5.17896605e-06], + [2.07300000e-06, 2.07300000e-06, 2.07300001e-06, ..., + 5.17896134e-06, 5.17896381e-06, 5.17896605e-06]])]] + bayes.predictionIntervals.reflectivityXData = [np.array([[0.011403, 0.013861, 0.016848, 0.020479, 0.024892, 0.030256, + 0.036777, 0.044702, 0.054336, 0.066045, 0.080279, 0.097579, + 0.11861, 0.14417, 0.17524, 0.213, 0.25891, 0.3147, + 0.38252, 0.46496, 0.56516]]), + np.array([[0.011403, 0.013861, 0.016848, 0.020479, 0.024892, 0.030256, + 0.036777, 0.044702, 0.054336, 0.066045, 0.080279, 0.097579, + 0.11861, 0.14417, 0.17524, 0.213, 0.25891, 0.3147, + 0.38252, 0.46496, 0.56516]])] + bayes.predictionIntervals.sldXData = [[np.array([[0., 11., 22., 33., 44., 55., 66., 77., 88., 99., 110., + 121., 132., 143., 154., 165., 176., 187., 198., 209., 220., 231., + 242., 253., 264., 275., 286., 297., 308., 319.]]), + np.array([[0., 11., 22., 33., 44., 55., 66., 77., 88., 99., 110., + 121., 132., 143., 154., 165., 176., 187., 198., 209., 220., 231., + 242., 253., 264., 275., 286., 297., 308., 319.]])]] + bayes.predictionIntervals.sampleChi = np.array([1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16]) + bayes.confidenceIntervals = RAT.rat_core.ConfidenceIntervals() + bayes.confidenceIntervals.percentile65 = np.array([[-1.29074586e-231, 8.33251318e+000, 1.75397363e+001, 1.75397363e+001, + 9.85302945e+000, 9.85302945e+000, 8.34197863e+000, 8.34197863e+000, + 1.65750684e+001, 1.45435510e+001, 1.45435510e+001, 1.52609047e+001, + 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, 7.08098641e-007, + 7.08098641e-007, 4.65378475e-006], + [8.33251318e+000, 5.48185565e+001, 5.48185565e+001, 4.57554170e+001, + 4.57554170e+001, 1.17557273e+001, 1.17557273e+001, 3.18752608e+001, + 3.18752608e+001, 1.65750684e+001, 1.52609047e+001, 4.88237113e+001, + 4.88237113e+001, 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, + 5.87958515e-006, 5.87958515e-006]]) + bayes.confidenceIntervals.percentile95 = np.array([[-1.29074586e-231, 8.33251318e+000, 1.75397363e+001, 1.75397363e+001, + 9.85302945e+000, 9.85302945e+000, 8.34197863e+000, 8.34197863e+000, + 1.65750684e+001, 1.45435510e+001, 1.45435510e+001, 1.52609047e+001, + 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, 7.08098641e-007, + 7.08098641e-007, 4.65378475e-006], + [8.33251318e+000, 5.48185565e+001, 5.48185565e+001, 4.57554170e+001, + 4.57554170e+001, 1.17557273e+001, 1.17557273e+001, 3.18752608e+001, + 3.18752608e+001, 1.65750684e+001, 1.52609047e+001, 4.88237113e+001, + 4.88237113e+001, 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, + 5.87958515e-006, 5.87958515e-006]]) + bayes.confidenceIntervals.mean = np.array([[4.16625659e+00, 3.15755349e+01, 3.61791464e+01, 3.16475766e+01, + 2.78042232e+01, 1.08043784e+01, 1.00488530e+01, 2.01086197e+01, + 2.42251646e+01, 1.55593097e+01, 1.49022278e+01, 3.20423080e+01, + 4.85551946e+01, 3.87046084e+01, 1.45612723e+01, 3.15508089e-06, + 3.29384190e-06, 5.26668495e-06]]) + bayes.dreamParams = RAT.rat_core.DreamParams() + bayes.dreamParams.nParams = 18.0 + bayes.dreamParams.nChains = 1.0 + bayes.dreamParams.nGenerations = 1.0 + bayes.dreamParams.parallel = 0 + bayes.dreamParams.CPU = 1.0 + bayes.dreamParams.jumpProbability = 0.5 + bayes.dreamParams.pUnitGamma = 0.2 + bayes.dreamParams.nCR = 3.0 + bayes.dreamParams.delta = 3.0 + bayes.dreamParams.steps = 50.0 + bayes.dreamParams.zeta = 1e-12 + bayes.dreamParams.outlier = "iqr" + bayes.dreamParams.adaptPCR = 0 + bayes.dreamParams.thinning = 1.0 + bayes.dreamParams.epsilon = 0.025 + bayes.dreamParams.ABC = 0 + bayes.dreamParams.IO = 0 + bayes.dreamParams.storeOutput = 0 + bayes.dreamParams.R = np.array([[0.]]) + bayes.dreamOutput = RAT.rat_core.DreamOutput() + bayes.dreamOutput.allChains = np.array([[[8.33251318e+00], + [5.48185565e+01], + [1.75397363e+01], + [4.57554170e+01], + [9.85302945e+00], + [1.17557273e+01], + [8.34197863e+00], + [3.18752608e+01], + [1.65750684e+01], + [1.45435510e+01], + [1.52609047e+01], + [4.88237113e+01], + [4.82866779e+01], + [2.91225389e+01], + [5.60206314e-06], + [7.08098641e-07], + [5.87958515e-06], + [4.65378475e-06], + [-4.86509830e+01], + [-5.63741277e+05]]]) + bayes.dreamOutput.outlierChains = np.array([[0.0, 0.0]]) + bayes.dreamOutput.runtime = 2.6e-06 + bayes.dreamOutput.iteration = 2.0 + bayes.dreamOutput.modelOutput = 0.0 + bayes.dreamOutput.AR = np.array([[1.0, np.nan]]) + bayes.dreamOutput.R_stat = np.array([[1.0, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, + np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan]]) + bayes.dreamOutput.CR = np.array([[1.00000000, 0.33333333, 0.33333333, 0.33333333]]) + bayes.nestedSamplerOutput = RAT.rat_core.NestedSamplerOutput() + bayes.nestedSamplerOutput.logZ = 0.0 + bayes.nestedSamplerOutput.nestSamples = np.array([[0.0, 0.0]]) + bayes.nestedSamplerOutput.postSamples = np.array([[0.0, 0.0]]) + bayes.chain = np.array([[-1.29231905e-231, 8.33251318e+000, 5.48185565e+001, 1.75397363e+001, + 4.57554170e+001, 9.85302945e+000, 1.17557273e+001, 8.34197863e+000, + 3.18752608e+001, 1.65750684e+001, 1.45435510e+001, 1.52609047e+001, + 4.88237113e+001, 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, + 7.08098641e-007, 5.87958515e-006], + [8.33251318e+000, 5.48185565e+001, 1.75397363e+001, 4.57554170e+001, + 9.85302945e+000, 1.17557273e+001, 8.34197863e+000, 3.18752608e+001, + 1.65750684e+001, 1.45435510e+001, 1.52609047e+001, 4.88237113e+001, + 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, 7.08098641e-007, + 5.87958515e-006, 4.65378475e-006]]) + + return bayes + + +@pytest.fixture +def dream_results(): + """The python BayesResults object for a Dream optimisation of the project set out in "DSPC_standard_layers.py". + + This optimisation used the parameters: nSamples=1, nChains=1. However, the calculationResults, contrastParams, + and fitParams are taken from an optimisation with the parameters: nSamples=50000, nChains=10. + """ + return RAT.outputs.BayesResults( + reflectivity=[np.array([[1.14030000e-02, 1.45891447e+01], + [1.38610000e-02, 1.45739839e+01], + [1.68480000e-02, 1.45684725e+01], + [2.04790000e-02, 1.45658452e+01], + [2.48920000e-02, 1.45641513e+01], + [3.02560000e-02, 1.45628311e+01], + [3.67770000e-02, 1.45618510e+01], + [4.47020000e-02, 1.45613427e+01], + [5.43360000e-02, 1.45612940e+01], + [6.60450000e-02, 1.45613971e+01], + [8.02790000e-02, 1.45613678e+01], + [9.75790000e-02, 1.45612960e+01], + [1.18610000e-01, 1.45612799e+01], + [1.44170000e-01, 1.45612749e+01], + [1.75240000e-01, 1.45612726e+01], + [2.13000000e-01, 1.45612723e+01], + [2.58910000e-01, 1.45612724e+01], + [3.14700000e-01, 1.45612723e+01], + [3.82520000e-01, 1.45612723e+01], + [4.64960000e-01, 1.45612723e+01], + [5.65160000e-01, 1.45612723e+01]]), + np.array([[1.14030000e-02, 1.00000316e+00], + [1.38610000e-02, 1.21238320e-01], + [1.68480000e-02, 2.13433068e-02], + [2.04790000e-02, 8.71162144e-03], + [2.48920000e-02, 5.72807902e-03], + [3.02560000e-02, 3.71827525e-03], + [3.67770000e-02, 1.72067772e-03], + [4.47020000e-02, 3.51471141e-04], + [5.43360000e-02, 2.03975460e-05], + [6.60450000e-02, 1.89221181e-04], + [8.02790000e-02, 1.49280488e-04], + [9.75790000e-02, 3.86439083e-05], + [1.18610000e-01, 1.63612094e-05], + [1.44170000e-01, 6.75770325e-06], + [1.75240000e-01, 3.45955607e-06], + [2.13000000e-01, 3.20880782e-06], + [2.58910000e-01, 3.32068345e-06], + [3.14700000e-01, 3.21671807e-06], + [3.82520000e-01, 3.15612021e-06], + [4.64960000e-01, 3.15645546e-06], + [5.65160000e-01, 3.15511510e-06]])], + simulation=[np.array([[1.14030000e-02, 1.45891447e+01], + [1.38610000e-02, 1.45739839e+01], + [1.68480000e-02, 1.45684725e+01], + [2.04790000e-02, 1.45658452e+01], + [2.48920000e-02, 1.45641513e+01], + [3.02560000e-02, 1.45628311e+01], + [3.67770000e-02, 1.45618510e+01], + [4.47020000e-02, 1.45613427e+01], + [5.43360000e-02, 1.45612940e+01], + [6.60450000e-02, 1.45613971e+01], + [8.02790000e-02, 1.45613678e+01], + [9.75790000e-02, 1.45612960e+01], + [1.18610000e-01, 1.45612799e+01], + [1.44170000e-01, 1.45612749e+01], + [1.75240000e-01, 1.45612726e+01], + [2.13000000e-01, 1.45612723e+01], + [2.58910000e-01, 1.45612724e+01], + [3.14700000e-01, 1.45612723e+01], + [3.82520000e-01, 1.45612723e+01], + [4.64960000e-01, 1.45612723e+01], + [5.65160000e-01, 1.45612723e+01]]), + np.array([[1.14030000e-02, 1.00000316e+00], + [1.38610000e-02, 1.21238320e-01], + [1.68480000e-02, 2.13433068e-02], + [2.04790000e-02, 8.71162144e-03], + [2.48920000e-02, 5.72807902e-03], + [3.02560000e-02, 3.71827525e-03], + [3.67770000e-02, 1.72067772e-03], + [4.47020000e-02, 3.51471141e-04], + [5.43360000e-02, 2.03975460e-05], + [6.60450000e-02, 1.89221181e-04], + [8.02790000e-02, 1.49280488e-04], + [9.75790000e-02, 3.86439083e-05], + [1.18610000e-01, 1.63612094e-05], + [1.44170000e-01, 6.75770325e-06], + [1.75240000e-01, 3.45955607e-06], + [2.13000000e-01, 3.20880782e-06], + [2.58910000e-01, 3.32068345e-06], + [3.14700000e-01, 3.21671807e-06], + [3.82520000e-01, 3.15612021e-06], + [4.64960000e-01, 3.15645546e-06], + [5.65160000e-01, 3.15511510e-06]])], + shiftedData=[np.array([[1.1403e-02, 1.0063e+00, 1.9003e-02], + [1.3861e-02, 9.0118e-01, 1.1774e-02], + [1.6848e-02, 7.0455e-02, 1.3083e-03], + [2.0479e-02, 1.7544e-02, 5.1254e-04], + [2.4892e-02, 6.4257e-03, 2.6236e-04], + [3.0256e-02, 2.7746e-03, 8.5758e-05], + [3.6777e-02, 1.8591e-03, 4.9391e-05], + [4.4702e-02, 1.1002e-03, 3.2644e-05], + [5.4336e-02, 6.6691e-04, 2.1365e-05], + [6.6045e-02, 6.0729e-04, 1.1791e-05], + [8.0279e-02, 5.8755e-04, 1.5569e-05], + [9.7579e-02, 3.2700e-04, 6.5280e-06], + [1.1861e-01, 7.8205e-05, 2.5881e-06], + [1.4417e-01, 3.3455e-05, 1.5143e-06], + [1.7524e-01, 4.9313e-06, 5.6663e-07], + [2.1300e-01, 4.1948e-06, 6.8549e-07], + [2.5891e-01, 3.9863e-06, 8.2061e-07], + [3.1470e-01, 2.0861e-06, 6.1379e-07], + [3.8252e-01, 2.1154e-06, 6.3084e-07], + [4.6496e-01, 1.9906e-06, 6.0793e-07], + [5.6516e-01, 2.3816e-06, 7.0610e-07]]), + np.array([[1.14030000e-02, 1.20493333e-02, 7.32200000e-04], + [1.38610000e-02, 6.71800000e-03, 3.71853333e-04], + [1.68480000e-02, 4.10506667e-03, 2.23106667e-04], + [2.04790000e-02, 2.43306667e-03, 1.46873333e-04], + [2.48920000e-02, 1.40940000e-03, 9.59200000e-05], + [3.02560000e-02, 7.43400000e-04, 3.50226667e-05], + [3.67770000e-02, 3.51466667e-04, 1.59573333e-05], + [4.47020000e-02, 9.80666667e-05, 7.29466667e-06], + [5.43360000e-02, 1.73500000e-05, 2.59200000e-06], + [6.60450000e-02, 4.86286667e-05, 2.46453333e-06], + [8.02790000e-02, 9.71733333e-05, 4.68166667e-06], + [9.75790000e-02, 7.06533333e-05, 2.32180000e-06], + [1.18610000e-01, 1.93046667e-05, 1.00813333e-06], + [1.44170000e-01, 6.61193333e-06, 5.29773333e-07], + [1.75240000e-01, 3.23726667e-06, 3.65933333e-07], + [2.13000000e-01, 3.29920000e-06, 4.74273333e-07], + [2.58910000e-01, 1.71180000e-06, 4.24720000e-07], + [3.14700000e-01, 2.24020000e-06, 5.08946667e-07], + [3.82520000e-01, 2.73306667e-06, 5.71513333e-07], + [4.64960000e-01, 2.36153333e-06, 5.24806667e-07], + [5.65160000e-01, 2.17460000e-06, 5.31346667e-07]])], + layerSlds=[[np.array([[3.15755349e+01, 3.35278238e-06, 4.16625659e+00], + [3.61791464e+01, 7.68327921e-07, 4.16625659e+00], + [1.00488530e+01, 2.06044530e-06, 2.78042232e+01], + [1.08043784e+01, 3.29384190e-06, 2.78042232e+01], + [2.42251646e+01, 2.35556998e-06, 1.55593097e+01], + [1.49022278e+01, 7.42138004e-07, 1.55593097e+01], + [1.49022278e+01, 7.42138004e-07, 1.55593097e+01], + [2.42251646e+01, 2.35556998e-06, 1.55593097e+01]])], + [np.array([[3.15755349e+01, 4.11636356e-06, 4.16625659e+00], + [3.61791464e+01, 1.39268494e-06, 4.16625659e+00], + [1.00488530e+01, 2.45715680e-06, 2.78042232e+01], + [1.08043784e+01, 5.26668495e-06, 2.78042232e+01], + [2.42251646e+01, 3.31348777e-06, 1.55593097e+01], + [1.49022278e+01, 1.37428245e-06, 1.55593097e+01], + [1.49022278e+01, 1.37428245e-06, 1.55593097e+01], + [2.42251646e+01, 3.31348777e-06, 1.55593097e+01]])]], + sldProfiles=[[np.array([[0.00000000e+00, 2.07301741e-06], + [1.10000000e+01, 2.07309604e-06], + [2.20000000e+01, 2.07345780e-06], + [3.30000000e+01, 2.07491687e-06], + [4.40000000e+01, 2.17562259e-06], + [5.50000000e+01, 3.22650495e-06], + [6.60000000e+01, 3.40913848e-06], + [7.70000000e+01, 3.13506253e-06], + [8.80000000e+01, 1.20456289e-06], + [9.90000000e+01, 1.27138002e-06], + [1.10000000e+02, 1.56285495e-06], + [1.21000000e+02, 1.84518709e-06], + [1.32000000e+02, 2.00498449e-06], + [1.43000000e+02, 1.96260665e-06], + [1.54000000e+02, 1.71966879e-06], + [1.65000000e+02, 1.39383267e-06], + [1.76000000e+02, 1.22970195e-06], + [1.87000000e+02, 1.41565526e-06], + [1.98000000e+02, 1.88172657e-06], + [2.09000000e+02, 2.40655867e-06], + [2.20000000e+02, 2.83570420e-06], + [2.31000000e+02, 3.11210082e-06], + [2.42000000e+02, 3.24277802e-06], + [2.53000000e+02, 3.28427452e-06], + [2.64000000e+02, 3.29268847e-06], + [2.75000000e+02, 3.29375418e-06], + [2.86000000e+02, 3.29383773e-06], + [2.97000000e+02, 3.29384178e-06], + [3.08000000e+02, 3.29384190e-06]]), + np.array([[0.00000000e+00, 2.07301819e-06], + [1.10000000e+01, 2.07310296e-06], + [2.20000000e+01, 2.07350415e-06], + [3.30000000e+01, 2.07518460e-06], + [4.40000000e+01, 2.23394767e-06], + [5.50000000e+01, 3.90646736e-06], + [6.60000000e+01, 4.18619279e-06], + [7.70000000e+01, 3.91675004e-06], + [8.80000000e+01, 1.92451547e-06], + [9.90000000e+01, 2.06988861e-06], + [1.10000000e+02, 2.47614934e-06], + [1.21000000e+02, 2.84889288e-06], + [1.32000000e+02, 3.00529286e-06], + [1.43000000e+02, 2.86310144e-06], + [1.54000000e+02, 2.49967205e-06], + [1.65000000e+02, 2.09673058e-06], + [1.76000000e+02, 1.92431424e-06], + [1.87000000e+02, 2.18829605e-06], + [1.98000000e+02, 2.83032190e-06], + [2.09000000e+02, 3.62584708e-06], + [2.20000000e+02, 4.36871153e-06], + [2.31000000e+02, 4.89806866e-06], + [2.42000000e+02, 5.16145928e-06], + [2.53000000e+02, 5.24684298e-06], + [2.64000000e+02, 5.26428707e-06], + [2.75000000e+02, 5.26650242e-06], + [2.86000000e+02, 5.26667628e-06], + [2.97000000e+02, 5.26668469e-06], + [3.08000000e+02, 5.26668495e-06]])]], + resampledLayers=[[np.array([[0., 0., 0.]])], [np.array([[0., 0., 0.]])]], + calculationResults=RAT.outputs.CalculationResults( + chiValues=np.array([4.6077885, 7.00028098]), + sumChi=11.608069475997699 + ), + contrastParams=RAT.outputs.ContrastParams( + backgroundParams=np.array([2.37113128e-06, 1.99006694e-06]), + scalefactors=np.array([0.1, 0.15]), + bulkIn=np.array([2.073e-06, 2.073e-06]), + bulkOut=np.array([6.01489149e-06, 1.59371685e-06]), + resolutionParams=np.array([0.03, 0.03]), + subRoughs=np.array([6.19503045, 6.19503045]), + resample=np.array([0.0, 0.0]) + ), + fitParams=np.array([6.19503045e+00, 1.84420960e+01, 2.11039621e+01, 8.75538121e+00, + 3.72292994e+00, 1.84624551e+01, 1.02316734e+01, 2.31156093e+01, + 1.09906265e+01, 5.71005361e+00, 1.67933822e+01, 1.72009856e+01, + 3.00260126e+01, 2.94448999e+01, 2.37113128e-06, 1.99006694e-06, + 6.01489149e-06, 1.59371685e-06]), + fitNames=['Substrate Roughness', 'Oxide Thickness', 'SAM Tails Thickness', 'SAM Tails Hydration', + 'SAM Roughness', 'CW Thickness', 'SAM Heads Thickness', 'SAM Heads Hydration', + 'Bilayer Heads Thickness', 'Bilayer Roughness', 'Bilayer Tails Thickness', 'Bilayer Tails Hydration', + 'Bilayer Heads Hydration', 'Oxide Hydration', 'Background parameter D2O', 'Background parameter SMW', + 'D2O', 'SMW'], + predictionIntervals=RAT.outputs.PredictionIntervals( + reflectivity=[np.array([[1.00000560e+00, 7.07687612e-01, 2.08315160e-02, 2.40787966e-03, + 2.17627660e-03, 2.54301700e-03, 1.76309827e-03, 6.15269679e-04, + 3.43679710e-05, 7.93625275e-05, 1.27760549e-04, 3.35799941e-05, + 6.75048751e-06, 7.64258431e-06, 6.05800395e-06, 5.60288298e-06, + 5.60333677e-06, 5.60223341e-06, 5.60206667e-06, 5.60206314e-06, + 5.60206314e-06], + [1.00000560e+00, 7.07687612e-01, 2.08315160e-02, 2.40787966e-03, + 2.17627660e-03, 2.54301700e-03, 1.76309827e-03, 6.15269679e-04, + 3.43679710e-05, 7.93625275e-05, 1.27760549e-04, 3.35799941e-05, + 6.75048751e-06, 7.64258431e-06, 6.05800395e-06, 5.60288298e-06, + 5.60333677e-06, 5.60223341e-06, 5.60206667e-06, 5.60206314e-06, + 5.60206314e-06], + [1.55201098e+01, 1.53748894e+01, 1.50402011e+01, 1.50299478e+01, + 1.50290525e+01, 1.50287935e+01, 1.50282126e+01, 1.50276044e+01, + 1.50273248e+01, 1.50273185e+01, 1.50272997e+01, 1.50272498e+01, + 1.50272364e+01, 1.50272347e+01, 1.50272335e+01, 1.50272330e+01, + 1.50272329e+01, 1.50272328e+01, 1.50272328e+01, 1.50272328e+01, + 1.50272328e+01], + [2.91397425e+01, 2.91324974e+01, 2.91281368e+01, 2.91255472e+01, + 2.91240295e+01, 2.91231836e+01, 2.91227893e+01, 2.91226872e+01, + 2.91226902e+01, 2.91226359e+01, 2.91225541e+01, 2.91225457e+01, + 2.91225448e+01, 2.91225407e+01, 2.91225398e+01, 2.91225393e+01, + 2.91225391e+01, 2.91225390e+01, 2.91225390e+01, 2.91225389e+01, + 2.91225389e+01], + [2.91397425e+01, 2.91324974e+01, 2.91281368e+01, 2.91255472e+01, + 2.91240295e+01, 2.91231836e+01, 2.91227893e+01, 2.91226872e+01, + 2.91226902e+01, 2.91226359e+01, 2.91225541e+01, 2.91225457e+01, + 2.91225448e+01, 2.91225407e+01, 2.91225398e+01, 2.91225393e+01, + 2.91225391e+01, 2.91225390e+01, 2.91225390e+01, 2.91225389e+01, + 2.91225389e+01]]), + np.array([[7.82198834e-01, 2.84434275e-02, 3.42472318e-03, 1.45801296e-03, + 2.02213149e-03, 2.00826891e-03, 1.27577246e-03, 4.27099544e-04, + 2.07304219e-05, 4.88683542e-05, 4.14000873e-05, 1.57801531e-05, + 2.08705254e-06, 2.27936213e-06, 1.09950377e-06, 7.09021331e-07, + 7.09539552e-07, 7.08228574e-07, 7.08101644e-07, 7.08098642e-07, + 7.08098641e-07], + [7.82198834e-01, 2.84434275e-02, 3.42472318e-03, 1.45801296e-03, + 2.02213149e-03, 2.00826891e-03, 1.27577246e-03, 4.27099544e-04, + 2.07304219e-05, 4.88683542e-05, 4.14000873e-05, 1.57801531e-05, + 2.08705254e-06, 2.27936213e-06, 1.09950377e-06, 7.09021331e-07, + 7.09539552e-07, 7.08228574e-07, 7.08101644e-07, 7.08098642e-07, + 7.08098641e-07], + [8.94587126e-01, 4.07514176e-01, 3.66355642e-02, 1.22207690e-02, + 5.91350591e-03, 3.17495745e-03, 1.50593011e-03, 5.80889579e-04, + 2.44654124e-04, 1.40925782e-04, 6.26965047e-05, 1.91064075e-05, + 9.45189755e-06, 6.16421495e-06, 5.17046678e-06, 4.24101973e-06, + 3.82067554e-06, 3.55352666e-06, 3.38981154e-06, 3.29631224e-06, + 3.25061722e-06], + [1.00000560e+00, 7.63076662e-01, 6.77868181e-02, 2.23160672e-02, + 9.56355479e-03, 4.26929321e-03, 1.72181442e-03, 7.25142247e-04, + 4.54691084e-04, 2.27274223e-04, 8.54009496e-05, 2.26525796e-05, + 1.63600080e-05, 9.80814666e-06, 8.98896697e-06, 7.55397947e-06, + 6.73887287e-06, 6.22237216e-06, 5.90521384e-06, 5.72401646e-06, + 5.63546023e-06], + [1.00000560e+00, 7.63076662e-01, 6.77868181e-02, 2.23160672e-02, + 9.56355479e-03, 4.26929321e-03, 1.72181442e-03, 7.25142247e-04, + 4.54691084e-04, 2.27274223e-04, 8.54009496e-05, 2.26525796e-05, + 1.63600080e-05, 9.80814666e-06, 8.98896697e-06, 7.55397947e-06, + 6.73887287e-06, 6.22237216e-06, 5.90521384e-06, 5.72401646e-06, + 5.63546023e-06]])], + sld=[[np.array([[-2.26996619e-06, -2.26938579e-06, -2.26877469e-06, ..., + 9.14568096e-07, 9.14567880e-07, 9.14567682e-07], + [-2.26996619e-06, -2.26938579e-06, -2.26877469e-06, ..., + 9.14568096e-07, 9.14567880e-07, 9.14567682e-07], + [-1.67970553e-07, -1.67671068e-07, -1.67355735e-07, ..., + 3.31763635e-06, 3.31763624e-06, 3.31763614e-06], + [2.07300000e-06, 2.07300000e-06, 2.07300001e-06, ..., + 5.87958515e-06, 5.87958515e-06, 5.87958515e-06], + [2.07300000e-06, 2.07300000e-06, 2.07300001e-06, ..., + 5.87958515e-06, 5.87958515e-06, 5.87958515e-06]])], + [np.array([[-1.35107208e-06, -1.34966627e-06, -1.34817823e-06, ..., + 4.65378475e-06, 4.65378475e-06, 4.65378475e-06], + [-1.35107208e-06, -1.34966627e-06, -1.34817823e-06, ..., + 4.65378475e-06, 4.65378475e-06, 4.65378475e-06], + [3.06178804e-07, 3.06904206e-07, 3.07672036e-07, ..., + 4.92477587e-06, 4.92477714e-06, 4.92477830e-06], + [2.07300000e-06, 2.07300000e-06, 2.07300001e-06, ..., + 5.17896134e-06, 5.17896381e-06, 5.17896605e-06], + [2.07300000e-06, 2.07300000e-06, 2.07300001e-06, ..., + 5.17896134e-06, 5.17896381e-06, 5.17896605e-06]])]], + reflectivityXData=[np.array([[0.011403, 0.013861, 0.016848, 0.020479, 0.024892, 0.030256, + 0.036777, 0.044702, 0.054336, 0.066045, 0.080279, 0.097579, + 0.118610, 0.144170, 0.175240, 0.213000, 0.258910, 0.314700, + 0.382520, 0.464960, 0.565160]]), + np.array([[0.011403, 0.013861, 0.016848, 0.020479, 0.024892, 0.030256, + 0.036777, 0.044702, 0.054336, 0.066045, 0.080279, 0.097579, + 0.118610, 0.144170, 0.175240, 0.213000, 0.258910, 0.314700, + 0.382520, 0.464960, 0.565160]])], + sldXData=[[np.array([[0., 11., 22., 33., 44., 55., 66., 77., 88., 99., 110., + 121., 132., 143., 154., 165., 176., 187., 198., 209., 220., 231., + 242., 253., 264., 275., 286., 297., 308., 319.]]), + np.array([[0., 11., 22., 33., 44., 55., 66., 77., 88., 99., 110., + 121., 132., 143., 154., 165., 176., 187., 198., 209., 220., 231., + 242., 253., 264., 275., 286., 297., 308., 319.]])]], + sampleChi=np.array([1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16, + 1.12748255e+06, 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, + 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, 1.12748255e+06, + 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, 1.46133559e+16, + 1.46133559e+16, 1.12748255e+06, 1.12748255e+06, 1.46133559e+16]) + ), + confidenceIntervals=RAT.outputs.ConfidenceIntervals( + percentile65=np.array([[-1.29074586e-231, 8.33251318e+000, 1.75397363e+001, 1.75397363e+001, + 9.85302945e+000, 9.85302945e+000, 8.34197863e+000, 8.34197863e+000, + 1.65750684e+001, 1.45435510e+001, 1.45435510e+001, 1.52609047e+001, + 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, 7.08098641e-007, + 7.08098641e-007, 4.65378475e-006], + [8.33251318e+000, 5.48185565e+001, 5.48185565e+001, 4.57554170e+001, + 4.57554170e+001, 1.17557273e+001, 1.17557273e+001, 3.18752608e+001, + 3.18752608e+001, 1.65750684e+001, 1.52609047e+001, 4.88237113e+001, + 4.88237113e+001, 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, + 5.87958515e-006, 5.87958515e-006]]), + percentile95=np.array([[-1.29074586e-231, 8.33251318e+000, 1.75397363e+001, 1.75397363e+001, + 9.85302945e+000, 9.85302945e+000, 8.34197863e+000, 8.34197863e+000, + 1.65750684e+001, 1.45435510e+001, 1.45435510e+001, 1.52609047e+001, + 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, 7.08098641e-007, + 7.08098641e-007, 4.65378475e-006], + [8.33251318e+000, 5.48185565e+001, 5.48185565e+001, 4.57554170e+001, + 4.57554170e+001, 1.17557273e+001, 1.17557273e+001, 3.18752608e+001, + 3.18752608e+001, 1.65750684e+001, 1.52609047e+001, 4.88237113e+001, + 4.88237113e+001, 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, + 5.87958515e-006, 5.87958515e-006]]), + mean=np.array([[4.16625659e+00, 3.15755349e+01, 3.61791464e+01, 3.16475766e+01, + 2.78042232e+01, 1.08043784e+01, 1.00488530e+01, 2.01086197e+01, + 2.42251646e+01, 1.55593097e+01, 1.49022278e+01, 3.20423080e+01, + 4.85551946e+01, 3.87046084e+01, 1.45612723e+01, 3.15508089e-06, + 3.29384190e-06, 5.26668495e-06]]) + ), + dreamParams=RAT.outputs.DreamParams( + nParams=18.0, + nChains=1.0, + nGenerations=1.0, + parallel=False, + CPU=1.0, + jumpProbability=0.5, + pUnitGamma=0.2, + nCR=3.0, + delta=3.0, + steps=50.0, + zeta=1e-12, + outlier="iqr", + adaptPCR=False, + thinning=1.0, + epsilon=0.025, + ABC=False, + IO=False, + storeOutput=False, + R=np.array([[0.]]), + ), + dreamOutput=RAT.outputs.DreamOutput( + allChains=np.array([[[8.33251318e+00], + [5.48185565e+01], + [1.75397363e+01], + [4.57554170e+01], + [9.85302945e+00], + [1.17557273e+01], + [8.34197863e+00], + [3.18752608e+01], + [1.65750684e+01], + [1.45435510e+01], + [1.52609047e+01], + [4.88237113e+01], + [4.82866779e+01], + [2.91225389e+01], + [5.60206314e-06], + [7.08098641e-07], + [5.87958515e-06], + [4.65378475e-06], + [-4.86509830e+01], + [-5.63741277e+05]]]), + outlierChains=np.array([[0.0, 0.0]]), + runtime=2.6e-06, + iteration=2.0, + modelOutput=0.0, + AR=np.array([[1.0, np.nan]]), + R_stat=np.array([[1.0, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, + np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan]]), + CR=np.array([[1., 0.33333333, 0.33333333, 0.33333333]]), + ), + nestedSamplerOutput=RAT.outputs.NestedSamplerOutput( + logZ=0.0, + nestSamples=np.array([[0.0, 0.0]]), + postSamples=np.array([[0.0, 0.0]]) + ), + chain=np.array([[-1.29231905e-231, 8.33251318e+000, 5.48185565e+001, 1.75397363e+001, + 4.57554170e+001, 9.85302945e+000, 1.17557273e+001, 8.34197863e+000, + 3.18752608e+001, 1.65750684e+001, 1.45435510e+001, 1.52609047e+001, + 4.88237113e+001, 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, + 7.08098641e-007, 5.87958515e-006], + [8.33251318e+000, 5.48185565e+001, 1.75397363e+001, 4.57554170e+001, + 9.85302945e+000, 1.17557273e+001, 8.34197863e+000, 3.18752608e+001, + 1.65750684e+001, 1.45435510e+001, 1.52609047e+001, 4.88237113e+001, + 4.82866779e+001, 2.91225389e+001, 5.60206314e-006, 7.08098641e-007, + 5.87958515e-006, 4.65378475e-006]]) + ) diff --git a/tests/test_events.py b/tests/test_events.py index 2709f74c..11c336c2 100644 --- a/tests/test_events.py +++ b/tests/test_events.py @@ -3,6 +3,7 @@ import RAT.events +@pytest.mark.skip def test_event_register() -> None: first_callback = mock.Mock() second_callback = mock.Mock() @@ -25,6 +26,8 @@ def test_event_register() -> None: assert RAT.events.get_event_callback(RAT.events.EventTypes.Plot) == [] assert RAT.events.get_event_callback(RAT.events.EventTypes.Message) == [] + +@pytest.mark.skip def test_event_notify() -> None: first_callback = mock.Mock() second_callback = mock.Mock() diff --git a/tests/test_inputs.py b/tests/test_inputs.py index 3119122f..9801f050 100644 --- a/tests/test_inputs.py +++ b/tests/test_inputs.py @@ -15,13 +15,13 @@ @pytest.fixture def standard_layers_project(): """Add parameters to the default project for a non polarised calculation.""" - test_project = RAT.Project(data=RAT.ClassList([RAT.models.Data(name='Simulation', data=np.array([[1.0, 1.0, 1.0]]))])) + test_project = RAT.Project(data=RAT.ClassList([RAT.models.Data(name='Test Data', data=np.array([[1.0, 1.0, 1.0]]))])) test_project.parameters.append(name='Test Thickness') test_project.parameters.append(name='Test SLD') test_project.parameters.append(name='Test Roughness') test_project.custom_files.append(name='Test Custom File', filename='matlab_test.m', language='matlab') test_project.layers.append(name='Test Layer', thickness='Test Thickness', SLD='Test SLD', roughness='Test Roughness') - test_project.contrasts.append(name='Test Contrast', data='Simulation', background='Background 1', bulk_in='SLD Air', + test_project.contrasts.append(name='Test Contrast', data='Test Data', background='Background 1', bulk_in='SLD Air', bulk_out='SLD D2O', scalefactor='Scalefactor 1', resolution='Resolution 1', model=['Test Layer']) return test_project @@ -31,7 +31,7 @@ def standard_layers_project(): def domains_project(): """Add parameters to the default project for a domains calculation.""" test_project = RAT.Project(calculation=Calculations.Domains, - data=RAT.ClassList([RAT.models.Data(name='Simulation', data=np.array([[1.0, 1.0, 1.0]]))])) + data=RAT.ClassList([RAT.models.Data(name='Test Data', data=np.array([[1.0, 1.0, 1.0]]))])) test_project.parameters.append(name='Test Thickness') test_project.parameters.append(name='Test SLD') test_project.parameters.append(name='Test Roughness') @@ -39,7 +39,7 @@ def domains_project(): test_project.layers.append(name='Test Layer', thickness='Test Thickness', SLD='Test SLD', roughness='Test Roughness') test_project.domain_contrasts.append(name='up', model=['Test Layer']) test_project.domain_contrasts.append(name='down', model=['Test Layer']) - test_project.contrasts.append(name='Test Contrast', data='Simulation', background='Background 1', bulk_in='SLD Air', + test_project.contrasts.append(name='Test Contrast', data='Test Data', background='Background 1', bulk_in='SLD Air', bulk_out='SLD D2O', scalefactor='Scalefactor 1', resolution='Resolution 1', domain_ratio='Domain Ratio 1', model=['down', 'up']) return test_project @@ -165,7 +165,7 @@ def custom_xy_problem(): problem.contrastCustomFiles = [1] problem.contrastDomainRatios = [0] problem.resample = [False] - problem.dataPresent = [1] + problem.dataPresent = [0] problem.oilChiDataPresent = [0] problem.numberOfContrasts = 1 problem.numberOfLayers = 0 @@ -240,9 +240,9 @@ def custom_xy_cells(): """The expected cells object from "custom_xy_project".""" cells = Cells() cells.f1 = [[0, 1]] - cells.f2 = [np.array([[0.0, 0.0, 0.0]])] - cells.f3 = [[0.0, 0.0]] - cells.f4 = [[0.0, 0.0]] + cells.f2 = [np.empty([0, 3])] + cells.f3 = [[]] + cells.f4 = [[]] cells.f5 = [0] cells.f6 = [0] cells.f7 = ['Substrate Roughness', 'Test Thickness', 'Test SLD', 'Test Roughness'] @@ -530,7 +530,6 @@ def check_problem_equal(actual_problem, expected_problem) -> None: "contrastDomainRatios", "resample", "dataPresent", "oilChiDataPresent", "fitParams", "otherParams", "fitLimits", "otherLimits"] - fields_equal = [] for scalar_field in scalar_fields: assert getattr(actual_problem, scalar_field) == getattr(expected_problem, scalar_field) for array_field in array_fields: diff --git a/tests/test_outputs.py b/tests/test_outputs.py new file mode 100644 index 00000000..f5e79417 --- /dev/null +++ b/tests/test_outputs.py @@ -0,0 +1,30 @@ +""" +Test the outputs module using the example calculation from "DSPC_standard_layers.py". + +We use the example for both a reflectivity calculation, and Bayesian analysis using the Dream algorithm. +""" + +import pytest + +import RAT +import RAT.outputs +import RAT.rat_core +from RAT.utils.enums import Procedures + +from tests.utils import check_results_equal + + +@pytest.mark.parametrize(["test_procedure", "test_output_results", "test_bayes", "test_results"], [ + (Procedures.Calculate, "reflectivity_calculation_output_results", None, "reflectivity_calculation_results"), + (Procedures.Dream, "dream_output_results", "dream_bayes", "dream_results"), +]) +def test_make_results(test_procedure, test_output_results, test_bayes, test_results, request) -> None: + """The python results object should contain the relevant parameters defined in the C++ results and bayes objects.""" + test_output_results = request.getfixturevalue(test_output_results) + if test_bayes: + test_bayes = request.getfixturevalue(test_bayes) + + test_results = request.getfixturevalue(test_results) + results = RAT.outputs.make_results(test_procedure, test_output_results, test_bayes) + + check_results_equal(test_results, results) diff --git a/tests/test_run.py b/tests/test_run.py new file mode 100644 index 00000000..f5a509a9 --- /dev/null +++ b/tests/test_run.py @@ -0,0 +1,266 @@ +""" +Test the run module using the example calculation from "DSPC_standard_layers.py". + +We use the example for both a reflectivity calculation, and Bayesian analysis using the Dream algorithm. +""" + +import numpy as np +import pytest +import unittest.mock as mock + +import RAT +import RAT.outputs +import RAT.rat_core +from RAT.utils.enums import Calculations, Geometries, LayerModels, Procedures + +from tests.utils import check_results_equal + + +@pytest.fixture +def input_project(): + """A cut-down version of the input Project object for a reflectivity calculation set out in + "DSPC_standard_layers.py". + """ + project = RAT.Project(name="original_dspc_bilayer", calculation="non polarised", model="standard layers", + geometry="substrate/liquid", absorption=False) + + # Set up the relevant parameters + project.parameters.append(name="Oxide Thickness", min=5.0, value=19.54, max=60.0, fit=True, prior_type="uniform", + mu=0.0, sigma=np.inf) + project.parameters.append(name="Oxide SLD", min=3.39e-06, value=3.39e-06, max=3.41e-06, fit=False, + prior_type="uniform", mu=0.0, sigma=np.inf) + project.parameters.append(name="SAM Tails Thickness", min=15.0, value=22.66, max=40.0, fit=True, + prior_type="uniform", mu=0.0, sigma=np.inf) + project.parameters.append(name="SAM Tails SLD", min=-5e-07, value=-4.01e-07, max=-3e-07, fit=False, + prior_type="uniform", mu=0.0, sigma=np.inf) + project.parameters.append(name="SAM Tails Hydration", min=1.0, value=5.252, max=50.0, fit=True, + prior_type="uniform", mu=0.0, sigma=np.inf) + project.parameters.append(name="SAM Roughness", min=1.0, value=5.64, max=15.0, fit=True, prior_type="uniform", + mu=0.0, sigma=np.inf) + project.parameters.append(name="CW Thickness", min=10.0, value=17.12, max=28.0, fit=True, prior_type="uniform", + mu=0.0, sigma=np.inf) + project.parameters.append(name="CW SLD", min=0.0, value=0.0, max=1e-09, fit=False, prior_type="uniform", mu=0.0, + sigma=np.inf) + project.parameters.append(name="SAM Heads Thickness", min=5.0, value=8.56, max=17.0, fit=True, + prior_type="gaussian", mu=10.0, sigma=2.0) + project.parameters.append(name="SAM Heads SLD", min=1.0e-07, value=1.75e-06, max=2.0e-06, fit=False, + prior_type="uniform", mu=0.0, sigma=np.inf) + project.parameters.append(name="SAM Heads Hydration", min=10.0, value=45.45, max=50.0, fit=True, + prior_type="uniform", mu=30.0, sigma=3.0) + project.parameters.append(name="Bilayer Heads Thickness", min=7.0, value=10.7, max=17.0, fit=True, + prior_type="gaussian", mu=10.0, sigma=2.0) + project.parameters.append(name="Bilayer Heads SLD", min=5.0e-07, value=1.47e-06, max=1.5e-06, fit=False, + prior_type="uniform", mu=0.0, sigma=np.inf) + project.parameters.append(name="Bilayer Roughness", min=2.0, value=6.014, max=15.0, fit=True, prior_type="uniform", + mu=0.0, sigma=np.inf) + project.parameters.append(name="Bilayer Tails Thickness", min=14.0, value=17.82, max=22.0, fit=True, + prior_type="uniform", mu=0.0, sigma=np.inf) + project.parameters.append(name="Bilayer Tails SLD", min=-5.0e-07, value=-4.61e-07, max=0.0, fit=False, + prior_type="uniform", mu=0.0, sigma=np.inf) + project.parameters.append(name="Bilayer Tails Hydration", min=10.0, value=17.64, max=50.0, fit=True, + prior_type="uniform", mu=0.0, sigma=np.inf) + project.parameters.append(name="Bilayer Heads Hydration", min=10.0, value=36.15, max=50.0, fit=True, + prior_type="gaussian", mu=30.0, sigma=3.0) + project.parameters.append(name="CW Hydration", min=99.9, value=100.0, max=100.0, fit=False, prior_type="uniform", + mu=0.0, sigma=np.inf) + project.parameters.append(name="Oxide Hydration", min=0.0, value=23.61, max=60.0, fit=True, prior_type="uniform", + mu=0.0, sigma=np.inf) + + project.parameters.set_fields(0, max=10) + + del project.bulk_in[0] + project.bulk_in.append(name="Silicon", min=2.0e-06, value=2.073e-06, max=2.1e-06, fit=False) + + del project.bulk_out[0] + project.bulk_out.append(name="D2O", min=5.50e-06, value=5.98e-06, max=6.4e-06, fit=True) + project.bulk_out.append(name="SMW", min=1.0e-06, value=2.21e-06, max=4.99e-06, fit=True) + + del project.scalefactors[0] + project.scalefactors.append(name="Scalefactor 1", min=0.05, value=0.10, max=0.2, fit=False) + project.scalefactors.append(name="Scalefactor 2", min=0.05, value=0.15, max=0.2, fit=False) + + del project.backgrounds[0] + del project.background_parameters[0] + project.background_parameters.append(name="Background parameter D2O", min=5.0e-10, value=2.23e-06, max=7.0e-06, + fit=True) + project.background_parameters.append(name="Background parameter SMW", min=1.0e-10, value=3.38e-06, max=4.99e-06, + fit=True) + + return project + + +@pytest.fixture +def reflectivity_calculation_problem(): + """The output C++ ProblemDefinition object for a reflectivity calculation of the project set out in + "DSPC_standard_layers.py". + """ + problem = RAT.rat_core.ProblemDefinition() + problem.TF = Calculations.NonPolarised + problem.modelType = LayerModels.StandardLayers + problem.geometry = Geometries.SubstrateLiquid + problem.useImaginary = False + problem.params = np.array([3.000e+00, 1.954e+01, 3.390e-06, 2.266e+01, -4.010e-07, 5.252e+00, + 5.640e+00, 1.712e+01, 0.000e+00, 8.560e+00, 1.750e-06, 4.545e+01, + 1.070e+01, 1.470e-06, 6.014e+00, 1.782e+01, -4.610e-07, 1.764e+01, + 3.615e+01, 1.000e+02, 2.361e+01]) + problem.bulkIn = np.array([2.073e-06]) + problem.bulkOut = np.array([5.98e-06, 2.21e-06]) + problem.qzshifts = np.array([0.0]) + problem.scalefactors = np.array([0.1, 0.15]) + problem.domainRatio = np.array([]) + problem.backgroundParams = np.array([2.23e-06, 3.38e-06]) + problem.resolutionParams = np.array([0.03]) + problem.contrastBulkIns = np.array([1.0, 1.0]) + problem.contrastBulkOuts = np.array([1.0, 2.0]) + problem.contrastQzshifts = np.array([0.0, 0.0]) + problem.contrastScalefactors = np.array([1.0, 2.0]) + problem.contrastBackgrounds = np.array([1.0, 2.0]) + problem.contrastBackgroundActions = np.array([1.0, 1.0]) + problem.contrastResolutions = np.array([1.0, 1.0]) + problem.contrastCustomFiles = np.array([np.nan, np.nan]) + problem.contrastDomainRatios = np.array([0.0, 0.0]) + problem.resample = np.array([0.0, 0.0]) + problem.dataPresent = np.array([1.0, 1.0]) + problem.oilChiDataPresent = np.array([0.0, 0.0]) + problem.numberOfContrasts = 2.0 + problem.numberOfLayers = 6.0 + problem.numberOfDomainContrasts = 0.0 + problem.fitParams = np.array([3.000e+00, 1.954e+01, 2.266e+01, 5.252e+00, 5.640e+00, 1.712e+01, 8.560e+00, + 4.545e+01, 1.070e+01, 6.014e+00, 1.782e+01, 1.764e+01, 3.615e+01, 2.361e+01, + 2.230e-06, 3.380e-06, 5.980e-06, 2.210e-06]) + problem.otherParams = np.array([3.390e-06, -4.010e-07, 0.000e+00, 1.750e-06, 1.470e-06, -4.610e-07, + 1.000e+02, 1.000e-01, 1.500e-01, 2.073e-06, 3.000e-02]) + problem.fitLimits = np.array([[1.00e+00, 1.00e+01], + [5.00e+00, 6.00e+01], + [1.50e+01, 3.50e+01], + [1.00e+00, 5.00e+01], + [1.00e+00, 1.50e+01], + [1.00e+01, 2.80e+01], + [5.00e+00, 1.70e+01], + [1.00e+01, 5.00e+01], + [7.00e+00, 1.70e+01], + [2.00e+00, 1.50e+01], + [1.40e+01, 2.20e+01], + [1.00e+01, 5.00e+01], + [1.00e+01, 5.00e+01], + [0.00e+00, 6.00e+01], + [5.00e-10, 7.00e-06], + [1.00e-10, 4.99e-06], + [5.50e-06, 6.40e-06], + [1.00e-06, 4.99e-06]]) + problem.otherLimits = np.array([[3.39e-06, 3.41e-06], + [-5.00e-07, -3.00e-07], + [0.00e+00, 1.00e-09], + [1.00e-07, 2.00e-06], + [5.00e-07, 1.50e-06], + [-5.00e-07, 0.00e+00], + [9.99e+01, 1.00e+02], + [5.00e-02, 2.00e-01], + [5.00e-02, 2.00e-01], + [2.00e-06, 2.10e-06], + [1.00e-02, 5.00e-02]]) + + return problem + + +@pytest.fixture +def dream_problem(): + """The output C++ ProblemDefinition object for a Dream optimisation of the project set out in + "DSPC_standard_layers.py". + + This optimisation used the parameters: nSamples=50000, nChains=10. + """ + problem = RAT.rat_core.ProblemDefinition() + problem.TF = Calculations.NonPolarised + problem.modelType = LayerModels.StandardLayers + problem.geometry = Geometries.SubstrateLiquid + problem.useImaginary = False + problem.params = np.array([6.19503045e+00, 1.84420960e+01, 3.39000000e-06, 2.11039621e+01, + -4.01000000e-07, 8.75538121e+00, 3.72292994e+00, 1.84624551e+01, + 0.00000000e+00, 1.02316734e+01, 1.75000000e-06, 2.31156093e+01, + 1.09906265e+01, 1.47000000e-06, 5.71005361e+00, 1.67933822e+01, + -4.61000000e-07, 1.72009856e+01, 3.00260126e+01, 1.00000000e+02, + 2.94448999e+01]) + problem.bulkIn = np.array([2.073e-06]) + problem.bulkOut = np.array([6.01489149e-06, 1.59371685e-06]) + problem.qzshifts = np.array([0.0]) + problem.scalefactors = np.array([0.1, 0.15]) + problem.domainRatio = np.array([]) + problem.backgroundParams = np.array([2.37113128e-06, 1.99006694e-06]) + problem.resolutionParams = np.array([0.03]) + problem.contrastBulkIns = np.array([1.0, 1.0]) + problem.contrastBulkOuts = np.array([1.0, 2.0]) + problem.contrastQzshifts = np.array([0.0, 0.0]) + problem.contrastScalefactors = np.array([1.0, 2.0]) + problem.contrastBackgrounds = np.array([1.0, 2.0]) + problem.contrastBackgroundActions = np.array([1.0, 1.0]) + problem.contrastResolutions = np.array([1.0, 1.0]) + problem.contrastCustomFiles = np.array([np.nan, np.nan]) + problem.contrastDomainRatios = np.array([0.0, 0.0]) + problem.resample = np.array([0.0, 0.0]) + problem.dataPresent = np.array([1.0, 1.0]) + problem.oilChiDataPresent = np.array([0.0, 0.0]) + problem.numberOfContrasts = 2.0 + problem.numberOfLayers = 6.0 + problem.numberOfDomainContrasts = 0.0 + problem.fitParams = np.array([6.19503045e+00, 1.84420960e+01, 2.11039621e+01, 8.75538121e+00, + 3.72292994e+00, 1.84624551e+01, 1.02316734e+01, 2.31156093e+01, + 1.09906265e+01, 5.71005361e+00, 1.67933822e+01, 1.72009856e+01, + 3.00260126e+01, 2.94448999e+01, 2.37113128e-06, 1.99006694e-06, + 6.01489149e-06, 1.59371685e-06]) + problem.otherParams = np.array([3.390e-06, -4.010e-07, 0.000e+00, 1.750e-06, 1.470e-06, -4.610e-07, + 1.000e+02, 1.000e-01, 1.500e-01, 2.073e-06, 3.000e-02, 0.000e+00]) + problem.fitLimits = np.array([[1.00e+00, 1.00e+01], + [5.00e+00, 6.00e+01], + [1.50e+01, 3.50e+01], + [1.00e+00, 5.00e+01], + [1.00e+00, 1.50e+01], + [1.00e+01, 2.80e+01], + [5.00e+00, 1.70e+01], + [1.00e+01, 5.00e+01], + [7.00e+00, 1.70e+01], + [2.00e+00, 1.50e+01], + [1.40e+01, 2.20e+01], + [1.00e+01, 5.00e+01], + [1.00e+01, 5.00e+01], + [0.00e+00, 6.00e+01], + [5.00e-10, 7.00e-06], + [1.00e-10, 4.99e-06], + [5.50e-06, 6.40e-06], + [1.00e-06, 4.99e-06]]) + problem.otherLimits = np.array([[3.39e-06, 3.41e-06], + [-5.00e-07, -3.00e-07], + [0.00e+00, 1.00e-09], + [1.00e-07, 2.00e-06], + [5.00e-07, 1.50e-06], + [-5.00e-07, 0.00e+00], + [9.99e+01, 1.00e+02], + [5.00e-02, 2.00e-01], + [5.00e-02, 2.00e-01], + [2.00e-06, 2.10e-06], + [1.00e-02, 5.00e-02], + [0.00e+00, 0.00e+00]]) + + return problem + + +@pytest.mark.parametrize(["test_procedure", "test_output_problem", "test_output_results", "test_bayes", "test_results"], [ + (Procedures.Calculate, "reflectivity_calculation_problem", "reflectivity_calculation_output_results", None, "reflectivity_calculation_results"), + (Procedures.Dream, "dream_problem", "dream_output_results", "dream_bayes", "dream_results"), +]) +def test_run(test_procedure, test_output_problem, test_output_results, test_bayes, test_results, request) -> None: + input_project = request.getfixturevalue("input_project") + test_output_problem = request.getfixturevalue(test_output_problem) + test_output_results = request.getfixturevalue(test_output_results) + if test_bayes: + test_bayes = request.getfixturevalue(test_bayes) + + test_results = request.getfixturevalue(test_results) + + with mock.patch.object(RAT.rat_core, "RATMain", mock.MagicMock(return_value=(test_output_problem, + test_output_results, + test_bayes))): + # Use default project as we patch RATMain to give the desired outputs + project, results = RAT.run(input_project, RAT.set_controls(procedure=test_procedure)) + + check_results_equal(test_results, results) diff --git a/tests/utils.py b/tests/utils.py index 199979e2..3112a626 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,5 +1,8 @@ +import numpy as np from typing import Any +import RAT.outputs + class InputAttributes: """Set input arguments as class attributes.""" @@ -16,3 +19,123 @@ def __eq__(self, other: Any): class SubInputAttributes(InputAttributes): """Trivial subclass of InputAttributes""" pass + + +def check_results_equal(actual_results, expected_results) -> None: + """Compare two instances of "Results" or "BayesResults" objects for equality. + + We focus here on the fields common to both results objects, and also check the equality of the subclasses + "CalculationResults" and "ContrastParams". + """ + + list_fields = ["reflectivity", "simulation", "shiftedData"] + double_list_fields = ["layerSlds", "sldProfiles", "resampledLayers"] + contrast_param_fields = ["backgroundParams", "scalefactors", "bulkIn", "bulkOut", "resolutionParams", "subRoughs", + "resample"] + + assert ((isinstance(actual_results, RAT.outputs.Results) and + isinstance(expected_results, RAT.outputs.Results)) or + (isinstance(actual_results, RAT.outputs.BayesResults) and + isinstance(expected_results, RAT.outputs.BayesResults))) + + # The first set of fields are either 1D or 2D python lists containing numpy arrays. + # Hence, we need to compare them element-wise. + for list_field in list_fields: + for (a, b) in zip(getattr(actual_results, list_field), getattr(expected_results, list_field)): + assert (a == b).all() + + for list_field in double_list_fields: + actual_list = getattr(actual_results, list_field) + expected_list = getattr(expected_results, list_field) + assert len(actual_list) == len(expected_list) + for i in range(len(actual_list)): + for (a, b) in zip(actual_list[i], expected_list[i]): + assert (a == b).all() + + # Compare the final fields + assert (actual_results.fitParams == expected_results.fitParams).all() + assert actual_results.fitNames == expected_results.fitNames + + # Compare the two subclasses defined within the class + assert actual_results.calculationResults.sumChi == expected_results.calculationResults.sumChi + assert (actual_results.calculationResults.chiValues == expected_results.calculationResults.chiValues).all() + + for field in contrast_param_fields: + assert (getattr(actual_results.contrastParams, field) == getattr(expected_results.contrastParams, field)).all() + + if isinstance(actual_results, RAT.outputs.BayesResults) and isinstance(expected_results, RAT.outputs.BayesResults): + check_bayes_fields_equal(actual_results, expected_results) + + return None + + +def check_bayes_fields_equal(actual_results, expected_results) -> None: + """Compare two instances of the "BayesResults" object for equality. + + We focus here on the fields and subclasses specific to the Bayesian optimisation. + """ + + # The BayesResults object consists of a number of subclasses, each containing fields of differing formats. + subclasses = ["predictionIntervals", "confidenceIntervals", "dreamParams", "dreamOutput", "nestedSamplerOutput"] + + param_fields = {"predictionIntervals": [], + "confidenceIntervals": [], + "dreamParams": ["nParams", "nChains", "nGenerations", "parallel", "CPU", "jumpProbability", + "pUnitGamma", "nCR", "delta", "steps", "zeta", "outlier", "adaptPCR", "thinning", + "epsilon", "ABC", "IO", "storeOutput"], + "dreamOutput": ["runtime", "iteration", "modelOutput"], + "nestedSamplerOutput": ["logZ"] + } + + list_fields = {"predictionIntervals": ["reflectivity", "reflectivityXData"], + "confidenceIntervals": [], + "dreamParams": [], + "dreamOutput": [], + "nestedSamplerOutput": [] + } + + double_list_fields = {"predictionIntervals": ["sld", "sldXData"], + "confidenceIntervals": [], + "dreamParams": [], + "dreamOutput": [], + "nestedSamplerOutput": [] + } + + array_fields = {"predictionIntervals": ["sampleChi"], + "confidenceIntervals": ["percentile65", "percentile95", "mean"], + "dreamParams": ["R"], + "dreamOutput": ["allChains", "outlierChains", "AR", "R_stat", "CR"], + "nestedSamplerOutput": ["nestSamples", "postSamples"], + } + + for subclass in subclasses: + actual_subclass = getattr(actual_results, subclass) + expected_subclass = getattr(expected_results, subclass) + + for field in param_fields[subclass]: + assert getattr(actual_subclass, field) == getattr(expected_subclass, field) + + for field in list_fields[subclass]: + for (a, b) in zip(getattr(actual_subclass, field), getattr(expected_subclass, field)): + assert (a == b).all() + + for field in double_list_fields[subclass]: + actual_list = getattr(actual_subclass, field) + expected_list = getattr(expected_subclass, field) + assert len(actual_list) == len(expected_list) + for i in range(len(actual_list)): + for (a, b) in zip(actual_list[i], expected_list[i]): + assert (a == b).all() + + # Need to account for the arrays that are initialised as "NaN" in the compiled code + for array in array_fields[subclass]: + actual_array = getattr(actual_subclass, array) + expected_array = getattr(expected_subclass, array) + for i in range(len(actual_array)): + assert ((actual_array == expected_array).all() or + (['NaN' if np.isnan(el) else el for el in actual_array[i]] == + ['NaN' if np.isnan(el) else el for el in expected_array[i]])) + + assert (actual_results.chain == expected_results.chain).all() + + return None