From 4a715e63d8c28dd32c8605d3553bb335f283017c Mon Sep 17 00:00:00 2001 From: Paul Sharp <44529197+DrPaulSharp@users.noreply.github.com> Date: Mon, 1 Sep 2025 13:07:17 +0100 Subject: [PATCH 1/3] Adds validator to warn for resample=False for custom XY --- cpp/RAT | 2 +- ratapi/project.py | 17 +++++++++++++++-- tests/test_data/prist.json | 2 +- tests/test_inputs.py | 2 +- tests/test_project.py | 17 +++++++++++++++++ 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/cpp/RAT b/cpp/RAT index 16f3ebef..aae3dc14 160000 --- a/cpp/RAT +++ b/cpp/RAT @@ -1 +1 @@ -Subproject commit 16f3ebef737f4c85ca601046f7a30ffabee4eb47 +Subproject commit aae3dc141b6a10c6e10dfb47cd62e07a2a11857d diff --git a/ratapi/project.py b/ratapi/project.py index 860f23b7..4914b915 100644 --- a/ratapi/project.py +++ b/ratapi/project.py @@ -361,8 +361,8 @@ def model_post_init(self, __context: Any) -> None: """Set up the Class to protect against disallowed modification. We initialise the class handle in the ClassLists for empty data fields, set protected parameters, get names of - all defined parameters, determine the contents of the "model" field in contrasts, - and wrap ClassList routines to control revalidation. + all defined parameters, determine the contents of the "model" field in contrasts, and wrap ClassList routines + to control revalidation. """ # Ensure all ClassLists have the correct _class_handle defined for field in (fields := Project.model_fields): @@ -454,6 +454,19 @@ def set_layers(self) -> "Project": self.layers.data = [] return self + @model_validator(mode="after") + def set_resample(self) -> "Project": + """If we are using a custom XY model, warn that the resample setting for each contrast must always be True.""" + if self.model == LayerModels.CustomXY: + for contrast in self.contrasts: + if "resample" in contrast.model_fields_set and contrast.resample is False: + warnings.warn( + 'For a custom XY calculation, "resample" must be True for each contrast - resetting to True.', + stacklevel=2, + ) + contrast.resample = True + return self + @model_validator(mode="after") def set_calculation(self) -> "Project": """Apply the calc setting to the project.""" diff --git a/tests/test_data/prist.json b/tests/test_data/prist.json index 3b36893e..d78cee66 100644 --- a/tests/test_data/prist.json +++ b/tests/test_data/prist.json @@ -1 +1 @@ -{"name": "Example Project", "calculation": "normal", "model": "standard layers", "geometry": "air/substrate", "absorption": false, "parameters": [{"name": "Substrate Roughness", "min": 1.0, "value": 3.0, "max": 5.0, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 Thickness", "min": 20.0, "value": 20.0, "max": 20.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 Roughness", "min": 3.0, "value": 3.0, "max": 3.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 SLD", "min": 5.715275837467511e-06, "value": 5.715275837467511e-06, "max": 5.715275837467511e-06, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 Thickness", "min": 93.0, "value": 93.0, "max": 93.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 Roughness", "min": 3.0, "value": 3.0, "max": 3.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 SLD", "min": 6.720584953375607e-07, "value": 6.720584953375607e-07, "max": 6.720584953375607e-07, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "bulk_in": [{"name": "vacuum SLD", "min": 0.0, "value": 0.0, "max": 0.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "bulk_out": [{"name": "Si SLD", "min": 2.07370547828562e-06, "value": 2.07370547828562e-06, "max": 2.07370547828562e-06, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "scalefactors": [{"name": "Scalefactor", "min": 0.0, "value": 1.0, "max": 1.5, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "domain_ratios": [], "background_parameters": [{"name": "Background Parameter", "min": 0.0, "value": 0.025, "max": 1.0, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "backgrounds": [{"name": "Background", "type": "constant", "source": "Background Parameter", "value_1": "", "value_2": "", "value_3": "", "value_4": "", "value_5": ""}], "resolution_parameters": [{"name": "Resolution Param 1", "min": 0.01, "value": 0.03, "max": 0.05, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "resolutions": [{"name": "Data Resolution", "type": "data", "source": "", "value_1": "", "value_2": "", "value_3": "", "value_4": "", "value_5": ""}], "custom_files": [], "data": [{"name": "Simulation", "data": [], "data_range": [], "simulation_range": [0.005, 0.7]}, {"name": "prist4", "data": [[0.0021999999999999997, 0.004724119389721505, 0.004724119389721505, 0.00019999999999999987], [0.0026, 0.0, 0.0, 0.0002000000000000001], [0.003, 0.0049441079014990305, 0.0028632759811688313, 0.0002000000000000001], [0.0034000000000000002, 0.00539571466421478, 0.0027033018099334193, 0.00019999999999999987], [0.0038, 0.011948517768746966, 0.0037903477990210636, 0.0002000000000000001], [0.004200000000000001, 0.016302332669940297, 0.003972317564845323, 0.0002000000000000001], [0.0046, 0.02265216487165058, 0.0045763672802481776, 0.0002000000000000001], [0.005, 0.023020814468949415, 0.00425372711337262, 0.00019999999999999966], [0.0054, 0.027305557750665344, 0.004428700971127359, 0.0002000000000000001], [0.0058, 0.019457945835850306, 0.0037817426451169783, 0.0002000000000000001], [0.006200000000000001, 0.027645506109865266, 0.004267993991409073, 0.0002000000000000001], [0.0066, 0.024223034347324195, 0.0037655052701117517, 0.0002000000000000001], [0.007, 0.028408308819418325, 0.0037377941755602716, 0.00019999999999999966], [0.0074, 0.057460495308053604, 0.0052154049057105455, 0.0002000000000000001], [0.0078, 0.1489883351950982, 0.00754789840356179, 0.0002000000000000001], [0.008199999999999999, 0.3520480929443021, 0.011146891694516669, 0.00019999999999999966], [0.0086, 0.5317657760789548, 0.01351725179531962, 0.00019999999999999966], [0.009, 0.7914500646501588, 0.016276277463585134, 0.00020000000000000052], [0.009399999999999999, 0.9680331047846104, 0.01782748799306378, 0.00019999999999999966], [0.0098, 1.0324643310179094, 0.018104900945963596, 0.00020000000000000052], [0.010204081632653062, 0.6287661683321234, 0.013873373556929145, 0.00020408163265306107], [0.010620574760516453, 0.3506955915110479, 0.010136613757789808, 0.00021241149521033023], [0.011054067607884473, 0.23477751708069897, 0.008109962639928676, 0.000221081352157689], [0.011505254040859348, 0.18964302712880826, 0.007180573014831645, 0.00023010508081718756], [0.011974856246608712, 0.14285208497806512, 0.006016224926747713, 0.00023949712493217482], [0.012463625889327434, 0.12188457497836602, 0.005435279585343197, 0.00024927251778654805], [0.012972345313381616, 0.10530945504618572, 0.005027517945960155, 0.00025944690626763297], [0.013501828795560456, 0.08038795087657985, 0.004197556276825506, 0.0002700365759112089], [0.014052923848440476, 0.07313672279549625, 0.003958200398418697, 0.00028105847696880976], [0.01462651257694825, 0.06129841978151465, 0.0034783001152817426, 0.0002925302515389659], [0.01522351309029308, 0.06240905936586468, 0.003479800062460076, 0.000304470261805862], [0.015844880971529533, 0.05651280096554304, 0.0032223775371921573, 0.00031689761943059103], [0.016491610807102167, 0.05044073793552524, 0.00290210672478378, 0.0003298322161420439], [0.017164737778820625, 0.0502775250441711, 0.002825286449304508, 0.00034329475557641313], [0.0178653393208133, 0.05168970509722787, 0.002811814341605395, 0.0003573067864162654], [0.018594536844111803, 0.0530076187705834, 0.0027685413804410695, 0.00037189073688223724], [0.019353497531626573, 0.0490707566771454, 0.0025677593751218504, 0.00038706995063253133], [0.020143436206386842, 0.04687883170966378, 0.0024119133732668076, 0.0004028687241277376], [0.020965617276035284, 0.04919955377214455, 0.0024276503561561644, 0.0004193123455207056], [0.021821356756689787, 0.05204111270310913, 0.00245561515567379, 0.00043642713513379616], [0.022712024379411822, 0.04925178172610669, 0.0023335505076022252, 0.00045424048758823873], [0.02363904578265312, 0.04317260894774357, 0.00211385396560445, 0.0004727809156530611], [0.024603904794189984, 0.0383043276355005, 0.0019158755178575817, 0.0004920780958838009], [0.02560814580619774, 0.04444220010645997, 0.002018641932709427, 0.0005121629161239545], [0.026653376247267036, 0.039587001147536376, 0.0018488058581743547, 0.0005330675249453423], [0.027741269155318757, 0.036677858215866437, 0.0017473224966445143, 0.0005548253831063766], [0.028873565855535847, 0.037663512267048754, 0.0017682821318945074, 0.0005774713171107174], [0.030052078747598535, 0.036755569252809664, 0.0017350440273063527, 0.0006010415749519698], [0.03127869420668419, 0.03854639441776167, 0.0017965558626918197, 0.0006255738841336837], [0.032555375602875386, 0.032866785139061716, 0.0016217721152892931, 0.000651107512057509], [0.03388416644380907, 0.0315131968037535, 0.0016061232808323794, 0.0006776833288761816], [0.0352671936455972, 0.030280345918169513, 0.0015885947028228238, 0.0007053438729119448], [0.03670667093725423, 0.025036982048446406, 0.0014176844815086535, 0.0007341334187450851], [0.038204902404080934, 0.02083180456328542, 0.001280336546816776, 0.0007640980480816198], [0.03976428617567608, 0.019376976329704945, 0.0012712203272554497, 0.0007952857235135231], [0.04138731826447918, 0.016729675515039004, 0.0011715497338181137, 0.000827746365289584], [0.04307659656098854, 0.013996303090353096, 0.0010654383375290077, 0.0008615319312197701], [0.0448348249920493, 0.010621480384334052, 0.0009246807782300395, 0.0008966964998409904], [0.04666481784886764, 0.007820332463525126, 0.0008093102454836752, 0.000933296356977354], [0.04856950429167857, 0.0060428022894521575, 0.0007183835413384203, 0.0009713900858335685], [0.050551933038277694, 0.004095892971484393, 0.0005841670446995313, 0.0010110386607655557], [0.05261527724392169, 0.005111525161941947, 0.0006658003030884043, 0.0010523055448784409], [0.05476283958040829, 0.0020207116612746484, 0.0004143866059231477, 0.0010952567916081637], [0.05699805752246577, 0.001711568931414378, 0.00038529038925611664, 0.0011399611504493146], [0.05932450884991336, 0.0008496305883131249, 0.00027095330976641694, 0.001186490176998272], [0.06174591737439962, 0.0008142116035177235, 0.00027251395576638693, 0.0012349183474879948], [0.06426615889988532, 8.92042382623096e-05, 8.920423826322552e-05, 0.0012853231779977048], [0.06688926742641126, 9.339736346561163e-05, 9.339736346489978e-05, 0.0013377853485282282], [0.06961944160708111, 0.00040599169078880156, 0.0002030320824188672, 0.0013923888321416208], [0.07246105146859462, 0.0002183257352075823, 0.00015439324988622013, 0.0014492210293718943], [0.07541864540608828, 0.00012684339163879, 0.00012684339163797725, 0.001508372908121773], [0.07849695746347965, 0.0, 0.0, 0.001569939149269589], [0.08170091491096862, 0.0, 0.0, 0.0016340182982193738], [0.08503564613182449, 0.0004165748322677754, 0.00024090333523406435, 0.001700712922636495], [0.08850648883108263, 0.0, 0.0, 0.0017701297766216512], [0.09211899857929008, 0.0, 0.0, 0.001842379971585803], [0.0958789577049754, 0.0, 0.0, 0.0019175791540995135], [0.09979238455007644, 0.0, 0.0, 0.001995847691001529], [0.10386554310314079, 0.0, 0.0, 0.0020773108620628228]], "data_range": [0.0021999999999999997, 0.10386554310314079], "simulation_range": [0.0021999999999999997, 0.10386554310314079]}], "layers": [{"name": "Al2O3", "thickness": "Al2O3 Thickness", "SLD": "Al2O3 SLD", "roughness": "Al2O3 Roughness", "hydration": "", "hydrate_with": "bulk out"}, {"name": "Ti0.27Co0.73", "thickness": "Ti0.27Co0.73 Thickness", "SLD": "Ti0.27Co0.73 SLD", "roughness": "Ti0.27Co0.73 Roughness", "hydration": "", "hydrate_with": "bulk out"}], "domain_contrasts": [], "contrasts": [{"name": "prist4", "data": "prist4", "background": "Background", "background_action": "add", "bulk_in": "vacuum SLD", "bulk_out": "Si SLD", "scalefactor": "Scalefactor", "resolution": "Data Resolution", "resample": false, "model": ["Al2O3", "Ti0.27Co0.73"]}]} \ No newline at end of file +{"name": "Example Project", "calculation": "normal", "model": "standard layers", "geometry": "air/substrate", "absorption": false, "parameters": [{"name": "Substrate Roughness", "min": 1.0, "value": 3.0, "max": 5.0, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 Thickness", "min": 20.0, "value": 20.0, "max": 20.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 Roughness", "min": 3.0, "value": 3.0, "max": 3.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 SLD", "min": 5.715275837467511e-06, "value": 5.715275837467511e-06, "max": 5.715275837467511e-06, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 Thickness", "min": 93.0, "value": 93.0, "max": 93.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 Roughness", "min": 3.0, "value": 3.0, "max": 3.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 SLD", "min": 6.720584953375609e-07, "value": 6.720584953375609e-07, "max": 6.720584953375609e-07, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "bulk_in": [{"name": "vacuum SLD", "min": 0.0, "value": 0.0, "max": 0.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "bulk_out": [{"name": "Si SLD", "min": 2.07370547828562e-06, "value": 2.07370547828562e-06, "max": 2.07370547828562e-06, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "scalefactors": [{"name": "Scalefactor", "min": 0.0, "value": 1.0, "max": 1.5, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "domain_ratios": [], "background_parameters": [{"name": "Background Parameter", "min": 0.0, "value": 0.025, "max": 1.0, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "backgrounds": [{"name": "Background", "type": "constant", "source": "Background Parameter", "value_1": "", "value_2": "", "value_3": "", "value_4": "", "value_5": ""}], "resolution_parameters": [{"name": "Resolution Param 1", "min": 0.01, "value": 0.03, "max": 0.05, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "resolutions": [{"name": "Data Resolution", "type": "data", "source": "", "value_1": "", "value_2": "", "value_3": "", "value_4": "", "value_5": ""}], "custom_files": [], "data": [{"name": "Simulation", "data": [], "data_range": [], "simulation_range": [0.005, 0.7]}, {"name": "prist4", "data": [[0.0021999999999999997, 0.004724119389721505, 0.004724119389721505, 0.00019999999999999987], [0.0026, 0.0, 0.0, 0.0002000000000000001], [0.003, 0.0049441079014990305, 0.0028632759811688313, 0.0002000000000000001], [0.0034000000000000002, 0.00539571466421478, 0.0027033018099334193, 0.00019999999999999987], [0.0038, 0.011948517768746966, 0.0037903477990210636, 0.0002000000000000001], [0.004200000000000001, 0.016302332669940297, 0.003972317564845323, 0.0002000000000000001], [0.0046, 0.02265216487165058, 0.0045763672802481776, 0.0002000000000000001], [0.005, 0.023020814468949415, 0.00425372711337262, 0.00019999999999999966], [0.0054, 0.027305557750665344, 0.004428700971127359, 0.0002000000000000001], [0.0058, 0.019457945835850306, 0.0037817426451169783, 0.0002000000000000001], [0.006200000000000001, 0.027645506109865266, 0.004267993991409073, 0.0002000000000000001], [0.0066, 0.024223034347324195, 0.0037655052701117517, 0.0002000000000000001], [0.007, 0.028408308819418325, 0.0037377941755602716, 0.00019999999999999966], [0.0074, 0.057460495308053604, 0.0052154049057105455, 0.0002000000000000001], [0.0078, 0.1489883351950982, 0.00754789840356179, 0.0002000000000000001], [0.008199999999999999, 0.3520480929443021, 0.011146891694516669, 0.00019999999999999966], [0.0086, 0.5317657760789548, 0.01351725179531962, 0.00019999999999999966], [0.009, 0.7914500646501588, 0.016276277463585134, 0.00020000000000000052], [0.009399999999999999, 0.9680331047846104, 0.01782748799306378, 0.00019999999999999966], [0.0098, 1.0324643310179094, 0.018104900945963596, 0.00020000000000000052], [0.010204081632653062, 0.6287661683321234, 0.013873373556929145, 0.00020408163265306107], [0.010620574760516453, 0.3506955915110479, 0.010136613757789808, 0.00021241149521033023], [0.011054067607884473, 0.23477751708069897, 0.008109962639928676, 0.000221081352157689], [0.011505254040859348, 0.18964302712880826, 0.007180573014831645, 0.00023010508081718756], [0.011974856246608712, 0.14285208497806512, 0.006016224926747713, 0.00023949712493217482], [0.012463625889327434, 0.12188457497836602, 0.005435279585343197, 0.00024927251778654805], [0.012972345313381616, 0.10530945504618572, 0.005027517945960155, 0.00025944690626763297], [0.013501828795560456, 0.08038795087657985, 0.004197556276825506, 0.0002700365759112089], [0.014052923848440476, 0.07313672279549625, 0.003958200398418697, 0.00028105847696880976], [0.01462651257694825, 0.06129841978151465, 0.0034783001152817426, 0.0002925302515389659], [0.01522351309029308, 0.06240905936586468, 0.003479800062460076, 0.000304470261805862], [0.015844880971529533, 0.05651280096554304, 0.0032223775371921573, 0.00031689761943059103], [0.016491610807102167, 0.05044073793552524, 0.00290210672478378, 0.0003298322161420439], [0.017164737778820625, 0.0502775250441711, 0.002825286449304508, 0.00034329475557641313], [0.0178653393208133, 0.05168970509722787, 0.002811814341605395, 0.0003573067864162654], [0.018594536844111803, 0.0530076187705834, 0.0027685413804410695, 0.00037189073688223724], [0.019353497531626573, 0.0490707566771454, 0.0025677593751218504, 0.00038706995063253133], [0.020143436206386842, 0.04687883170966378, 0.0024119133732668076, 0.0004028687241277376], [0.020965617276035284, 0.04919955377214455, 0.0024276503561561644, 0.0004193123455207056], [0.021821356756689787, 0.05204111270310913, 0.00245561515567379, 0.00043642713513379616], [0.022712024379411822, 0.04925178172610669, 0.0023335505076022252, 0.00045424048758823873], [0.02363904578265312, 0.04317260894774357, 0.00211385396560445, 0.0004727809156530611], [0.024603904794189984, 0.0383043276355005, 0.0019158755178575817, 0.0004920780958838009], [0.02560814580619774, 0.04444220010645997, 0.002018641932709427, 0.0005121629161239545], [0.026653376247267036, 0.039587001147536376, 0.0018488058581743547, 0.0005330675249453423], [0.027741269155318757, 0.036677858215866437, 0.0017473224966445143, 0.0005548253831063766], [0.028873565855535847, 0.037663512267048754, 0.0017682821318945074, 0.0005774713171107174], [0.030052078747598535, 0.036755569252809664, 0.0017350440273063527, 0.0006010415749519698], [0.03127869420668419, 0.03854639441776167, 0.0017965558626918197, 0.0006255738841336837], [0.032555375602875386, 0.032866785139061716, 0.0016217721152892931, 0.000651107512057509], [0.03388416644380907, 0.0315131968037535, 0.0016061232808323794, 0.0006776833288761816], [0.0352671936455972, 0.030280345918169513, 0.0015885947028228238, 0.0007053438729119448], [0.03670667093725423, 0.025036982048446406, 0.0014176844815086535, 0.0007341334187450851], [0.038204902404080934, 0.02083180456328542, 0.001280336546816776, 0.0007640980480816198], [0.03976428617567608, 0.019376976329704945, 0.0012712203272554497, 0.0007952857235135231], [0.04138731826447918, 0.016729675515039004, 0.0011715497338181137, 0.000827746365289584], [0.04307659656098854, 0.013996303090353096, 0.0010654383375290077, 0.0008615319312197701], [0.0448348249920493, 0.010621480384334052, 0.0009246807782300395, 0.0008966964998409904], [0.04666481784886764, 0.007820332463525126, 0.0008093102454836752, 0.000933296356977354], [0.04856950429167857, 0.0060428022894521575, 0.0007183835413384203, 0.0009713900858335685], [0.050551933038277694, 0.004095892971484393, 0.0005841670446995313, 0.0010110386607655557], [0.05261527724392169, 0.005111525161941947, 0.0006658003030884043, 0.0010523055448784409], [0.05476283958040829, 0.0020207116612746484, 0.0004143866059231477, 0.0010952567916081637], [0.05699805752246577, 0.001711568931414378, 0.00038529038925611664, 0.0011399611504493146], [0.05932450884991336, 0.0008496305883131249, 0.00027095330976641694, 0.001186490176998272], [0.06174591737439962, 0.0008142116035177235, 0.00027251395576638693, 0.0012349183474879948], [0.06426615889988532, 8.92042382623096e-05, 8.920423826322552e-05, 0.0012853231779977048], [0.06688926742641126, 9.339736346561163e-05, 9.339736346489978e-05, 0.0013377853485282282], [0.06961944160708111, 0.00040599169078880156, 0.0002030320824188672, 0.0013923888321416208], [0.07246105146859462, 0.0002183257352075823, 0.00015439324988622013, 0.0014492210293718943], [0.07541864540608828, 0.00012684339163879, 0.00012684339163797725, 0.001508372908121773], [0.07849695746347965, 0.0, 0.0, 0.001569939149269589], [0.08170091491096862, 0.0, 0.0, 0.0016340182982193738], [0.08503564613182449, 0.0004165748322677754, 0.00024090333523406435, 0.001700712922636495], [0.08850648883108263, 0.0, 0.0, 0.0017701297766216512], [0.09211899857929008, 0.0, 0.0, 0.001842379971585803], [0.0958789577049754, 0.0, 0.0, 0.0019175791540995135], [0.09979238455007644, 0.0, 0.0, 0.001995847691001529], [0.10386554310314079, 0.0, 0.0, 0.0020773108620628228]], "data_range": [0.0021999999999999997, 0.10386554310314079], "simulation_range": [0.0021999999999999997, 0.10386554310314079]}], "layers": [{"name": "Al2O3", "thickness": "Al2O3 Thickness", "SLD": "Al2O3 SLD", "roughness": "Al2O3 Roughness", "hydration": "", "hydrate_with": "bulk out"}, {"name": "Ti0.27Co0.73", "thickness": "Ti0.27Co0.73 Thickness", "SLD": "Ti0.27Co0.73 SLD", "roughness": "Ti0.27Co0.73 Roughness", "hydration": "", "hydrate_with": "bulk out"}], "domain_contrasts": [], "contrasts": [{"name": "prist4", "data": "prist4", "background": "Background", "background_action": "add", "bulk_in": "vacuum SLD", "bulk_out": "Si SLD", "scalefactor": "Scalefactor", "resolution": "Data Resolution", "resample": false, "model": ["Al2O3", "Ti0.27Co0.73"]}]} \ No newline at end of file diff --git a/tests/test_inputs.py b/tests/test_inputs.py index db5b6646..e7a1560e 100644 --- a/tests/test_inputs.py +++ b/tests/test_inputs.py @@ -306,7 +306,7 @@ def custom_xy_problem(test_names, test_checks): problem.contrastResolutionTypes = ["constant"] problem.contrastCustomFiles = [1] problem.contrastDomainRatios = [0] - problem.resample = [False] + problem.resample = [True] problem.dataPresent = [0] problem.data = [np.empty([0, 6])] problem.dataLimits = [[0.0, 0.0]] diff --git a/tests/test_project.py b/tests/test_project.py index c2ea92a2..80acd5c2 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -443,6 +443,23 @@ def test_set_layers(project_parameters: dict) -> None: assert project.layers == [] +@pytest.mark.parametrize( + "project_parameters", + [ + ({"model": LayerModels.CustomXY, "contrasts": [ratapi.models.Contrast(name="Test Contrast")]}), + ], +) +def test_set_resample(project_parameters: dict) -> None: + """If we are using a custom XY model, the "resample" field of all the contrasts should always be True.""" + project = ratapi.Project(**project_parameters) + assert all(contrast.resample for contrast in project.contrasts) + with pytest.warns( + match='For a custom XY calculation, "resample" must be True for each contrast - resetting to True.' + ): + project.contrasts.append(name="New Contrast", resample=False) + assert all(contrast.resample for contrast in project.contrasts) + + @pytest.mark.parametrize( ["input_calculation", "input_contrast", "new_calculation", "new_contrast_model", "num_domain_ratios"], [ From 430eccc2268d473618bff0c9092c2ee5251e4cfe Mon Sep 17 00:00:00 2001 From: Paul Sharp <44529197+DrPaulSharp@users.noreply.github.com> Date: Mon, 1 Sep 2025 16:00:07 +0100 Subject: [PATCH 2/3] Adds "repeat_layers" option to contrasts --- ratapi/inputs.py | 2 +- ratapi/models.py | 9 +++++++++ ratapi/project.py | 14 ++++++++++++++ tests/test_project.py | 23 +++++++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/ratapi/inputs.py b/ratapi/inputs.py index 890066f9..7d0a8720 100644 --- a/ratapi/inputs.py +++ b/ratapi/inputs.py @@ -302,7 +302,7 @@ def make_problem(project: ratapi.Project) -> ProblemDefinition: problem.numberOfContrasts = len(project.contrasts) problem.geometry = project.geometry problem.useImaginary = project.absorption - problem.repeatLayers = [1] * len(project.contrasts) + problem.repeatLayers = [contrast.repeat_layers for contrast in project.contrasts] problem.contrastBackgroundParams = contrast_background_params problem.contrastBackgroundTypes = contrast_background_types problem.contrastBackgroundActions = [contrast.background_action for contrast in project.contrasts] diff --git a/ratapi/models.py b/ratapi/models.py index e882af65..7d0d4f74 100644 --- a/ratapi/models.py +++ b/ratapi/models.py @@ -163,6 +163,8 @@ class Contrast(RATModel): The name of the instrument resolution for this contrast. resample : bool Whether adaptive resampling should be used for interface microslicing. + repeat_layers : int + For standard layers, the number of times the set of layers defined in the model should be repeated. model : list[str] If this is a standard layers model, this should be a list of layer names that make up the slab model for this contrast. @@ -180,6 +182,7 @@ class Contrast(RATModel): scalefactor: str = "" resolution: str = "" resample: bool = False + repeat_layers: int = Field(default=1, gt=0) model: list[str] = [] @model_validator(mode="before") @@ -208,6 +211,7 @@ def __str__(self): self.scalefactor, self.resolution, self.resample, + self.repeat_layers, model_entry, ] ) @@ -238,6 +242,8 @@ class ContrastWithRatio(RATModel): The name of the instrument resolution for this contrast. resample : bool Whether adaptive resampling should be used for interface microslicing. + repeat_layers : int + For standard layers, the number of times the set of layers defined in the model should be repeated. domain_ratio : str The name of the domain ratio parameter describing how the first domain should be weighted relative to the second. @@ -258,6 +264,7 @@ class ContrastWithRatio(RATModel): scalefactor: str = "" resolution: str = "" resample: bool = False + repeat_layers: int = Field(default=1, gt=0) domain_ratio: str = "" model: list[str] = [] @@ -276,6 +283,8 @@ def __str__(self): self.scalefactor, self.resolution, self.resample, + self.repeat_layers, + self.domain_ratio, model_entry, ] ) diff --git a/ratapi/project.py b/ratapi/project.py index 4914b915..88555539 100644 --- a/ratapi/project.py +++ b/ratapi/project.py @@ -454,6 +454,20 @@ def set_layers(self) -> "Project": self.layers.data = [] return self + @model_validator(mode="after") + def set_repeat_layers(self) -> "Project": + """If we are not using a standard layers model, warn that the repeat layers setting is not valid.""" + if self.model != LayerModels.StandardLayers: + for contrast in self.contrasts: + if "repeat_layers" in contrast.model_fields_set and contrast.repeat_layers != 1: + warnings.warn( + 'For a custom layers or custom XY calculation, the "repeat_layers" setting for each ' + "contrast is not valid - resetting to 1.", + stacklevel=2, + ) + contrast.repeat_layers = 1 + return self + @model_validator(mode="after") def set_resample(self) -> "Project": """If we are using a custom XY model, warn that the resample setting for each contrast must always be True.""" diff --git a/tests/test_project.py b/tests/test_project.py index 80acd5c2..7683dec9 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -443,6 +443,29 @@ def test_set_layers(project_parameters: dict) -> None: assert project.layers == [] +@pytest.mark.parametrize( + "project_parameters", + [ + ( + { + "model": LayerModels.CustomLayers, + "contrasts": [ratapi.models.Contrast(name="Test Contrast", repeat_layers=2)], + } + ), + ({"model": LayerModels.CustomXY, "contrasts": [ratapi.models.Contrast(name="Test Contrast", repeat_layers=2)]}), + ], +) +def test_set_repeat_layers(project_parameters: dict) -> None: + """If we are using a custom layers of custom XY model, the "resample" field of all the contrasts should always + be 1.""" + with pytest.warns( + match='For a custom layers or custom XY calculation, the "repeat_layers" setting for each ' + "contrast is not valid - resetting to 1." + ): + project = ratapi.Project(**project_parameters) + assert all(contrast.repeat_layers == 1 for contrast in project.contrasts) + + @pytest.mark.parametrize( "project_parameters", [ From 1494fc0baab8a7f4b467d582b610889b87b7160a Mon Sep 17 00:00:00 2001 From: Paul Sharp <44529197+DrPaulSharp@users.noreply.github.com> Date: Mon, 1 Sep 2025 16:35:01 +0100 Subject: [PATCH 3/3] Reverts changes to test data --- tests/test_data/prist.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_data/prist.json b/tests/test_data/prist.json index d78cee66..3b36893e 100644 --- a/tests/test_data/prist.json +++ b/tests/test_data/prist.json @@ -1 +1 @@ -{"name": "Example Project", "calculation": "normal", "model": "standard layers", "geometry": "air/substrate", "absorption": false, "parameters": [{"name": "Substrate Roughness", "min": 1.0, "value": 3.0, "max": 5.0, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 Thickness", "min": 20.0, "value": 20.0, "max": 20.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 Roughness", "min": 3.0, "value": 3.0, "max": 3.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 SLD", "min": 5.715275837467511e-06, "value": 5.715275837467511e-06, "max": 5.715275837467511e-06, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 Thickness", "min": 93.0, "value": 93.0, "max": 93.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 Roughness", "min": 3.0, "value": 3.0, "max": 3.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 SLD", "min": 6.720584953375609e-07, "value": 6.720584953375609e-07, "max": 6.720584953375609e-07, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "bulk_in": [{"name": "vacuum SLD", "min": 0.0, "value": 0.0, "max": 0.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "bulk_out": [{"name": "Si SLD", "min": 2.07370547828562e-06, "value": 2.07370547828562e-06, "max": 2.07370547828562e-06, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "scalefactors": [{"name": "Scalefactor", "min": 0.0, "value": 1.0, "max": 1.5, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "domain_ratios": [], "background_parameters": [{"name": "Background Parameter", "min": 0.0, "value": 0.025, "max": 1.0, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "backgrounds": [{"name": "Background", "type": "constant", "source": "Background Parameter", "value_1": "", "value_2": "", "value_3": "", "value_4": "", "value_5": ""}], "resolution_parameters": [{"name": "Resolution Param 1", "min": 0.01, "value": 0.03, "max": 0.05, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "resolutions": [{"name": "Data Resolution", "type": "data", "source": "", "value_1": "", "value_2": "", "value_3": "", "value_4": "", "value_5": ""}], "custom_files": [], "data": [{"name": "Simulation", "data": [], "data_range": [], "simulation_range": [0.005, 0.7]}, {"name": "prist4", "data": [[0.0021999999999999997, 0.004724119389721505, 0.004724119389721505, 0.00019999999999999987], [0.0026, 0.0, 0.0, 0.0002000000000000001], [0.003, 0.0049441079014990305, 0.0028632759811688313, 0.0002000000000000001], [0.0034000000000000002, 0.00539571466421478, 0.0027033018099334193, 0.00019999999999999987], [0.0038, 0.011948517768746966, 0.0037903477990210636, 0.0002000000000000001], [0.004200000000000001, 0.016302332669940297, 0.003972317564845323, 0.0002000000000000001], [0.0046, 0.02265216487165058, 0.0045763672802481776, 0.0002000000000000001], [0.005, 0.023020814468949415, 0.00425372711337262, 0.00019999999999999966], [0.0054, 0.027305557750665344, 0.004428700971127359, 0.0002000000000000001], [0.0058, 0.019457945835850306, 0.0037817426451169783, 0.0002000000000000001], [0.006200000000000001, 0.027645506109865266, 0.004267993991409073, 0.0002000000000000001], [0.0066, 0.024223034347324195, 0.0037655052701117517, 0.0002000000000000001], [0.007, 0.028408308819418325, 0.0037377941755602716, 0.00019999999999999966], [0.0074, 0.057460495308053604, 0.0052154049057105455, 0.0002000000000000001], [0.0078, 0.1489883351950982, 0.00754789840356179, 0.0002000000000000001], [0.008199999999999999, 0.3520480929443021, 0.011146891694516669, 0.00019999999999999966], [0.0086, 0.5317657760789548, 0.01351725179531962, 0.00019999999999999966], [0.009, 0.7914500646501588, 0.016276277463585134, 0.00020000000000000052], [0.009399999999999999, 0.9680331047846104, 0.01782748799306378, 0.00019999999999999966], [0.0098, 1.0324643310179094, 0.018104900945963596, 0.00020000000000000052], [0.010204081632653062, 0.6287661683321234, 0.013873373556929145, 0.00020408163265306107], [0.010620574760516453, 0.3506955915110479, 0.010136613757789808, 0.00021241149521033023], [0.011054067607884473, 0.23477751708069897, 0.008109962639928676, 0.000221081352157689], [0.011505254040859348, 0.18964302712880826, 0.007180573014831645, 0.00023010508081718756], [0.011974856246608712, 0.14285208497806512, 0.006016224926747713, 0.00023949712493217482], [0.012463625889327434, 0.12188457497836602, 0.005435279585343197, 0.00024927251778654805], [0.012972345313381616, 0.10530945504618572, 0.005027517945960155, 0.00025944690626763297], [0.013501828795560456, 0.08038795087657985, 0.004197556276825506, 0.0002700365759112089], [0.014052923848440476, 0.07313672279549625, 0.003958200398418697, 0.00028105847696880976], [0.01462651257694825, 0.06129841978151465, 0.0034783001152817426, 0.0002925302515389659], [0.01522351309029308, 0.06240905936586468, 0.003479800062460076, 0.000304470261805862], [0.015844880971529533, 0.05651280096554304, 0.0032223775371921573, 0.00031689761943059103], [0.016491610807102167, 0.05044073793552524, 0.00290210672478378, 0.0003298322161420439], [0.017164737778820625, 0.0502775250441711, 0.002825286449304508, 0.00034329475557641313], [0.0178653393208133, 0.05168970509722787, 0.002811814341605395, 0.0003573067864162654], [0.018594536844111803, 0.0530076187705834, 0.0027685413804410695, 0.00037189073688223724], [0.019353497531626573, 0.0490707566771454, 0.0025677593751218504, 0.00038706995063253133], [0.020143436206386842, 0.04687883170966378, 0.0024119133732668076, 0.0004028687241277376], [0.020965617276035284, 0.04919955377214455, 0.0024276503561561644, 0.0004193123455207056], [0.021821356756689787, 0.05204111270310913, 0.00245561515567379, 0.00043642713513379616], [0.022712024379411822, 0.04925178172610669, 0.0023335505076022252, 0.00045424048758823873], [0.02363904578265312, 0.04317260894774357, 0.00211385396560445, 0.0004727809156530611], [0.024603904794189984, 0.0383043276355005, 0.0019158755178575817, 0.0004920780958838009], [0.02560814580619774, 0.04444220010645997, 0.002018641932709427, 0.0005121629161239545], [0.026653376247267036, 0.039587001147536376, 0.0018488058581743547, 0.0005330675249453423], [0.027741269155318757, 0.036677858215866437, 0.0017473224966445143, 0.0005548253831063766], [0.028873565855535847, 0.037663512267048754, 0.0017682821318945074, 0.0005774713171107174], [0.030052078747598535, 0.036755569252809664, 0.0017350440273063527, 0.0006010415749519698], [0.03127869420668419, 0.03854639441776167, 0.0017965558626918197, 0.0006255738841336837], [0.032555375602875386, 0.032866785139061716, 0.0016217721152892931, 0.000651107512057509], [0.03388416644380907, 0.0315131968037535, 0.0016061232808323794, 0.0006776833288761816], [0.0352671936455972, 0.030280345918169513, 0.0015885947028228238, 0.0007053438729119448], [0.03670667093725423, 0.025036982048446406, 0.0014176844815086535, 0.0007341334187450851], [0.038204902404080934, 0.02083180456328542, 0.001280336546816776, 0.0007640980480816198], [0.03976428617567608, 0.019376976329704945, 0.0012712203272554497, 0.0007952857235135231], [0.04138731826447918, 0.016729675515039004, 0.0011715497338181137, 0.000827746365289584], [0.04307659656098854, 0.013996303090353096, 0.0010654383375290077, 0.0008615319312197701], [0.0448348249920493, 0.010621480384334052, 0.0009246807782300395, 0.0008966964998409904], [0.04666481784886764, 0.007820332463525126, 0.0008093102454836752, 0.000933296356977354], [0.04856950429167857, 0.0060428022894521575, 0.0007183835413384203, 0.0009713900858335685], [0.050551933038277694, 0.004095892971484393, 0.0005841670446995313, 0.0010110386607655557], [0.05261527724392169, 0.005111525161941947, 0.0006658003030884043, 0.0010523055448784409], [0.05476283958040829, 0.0020207116612746484, 0.0004143866059231477, 0.0010952567916081637], [0.05699805752246577, 0.001711568931414378, 0.00038529038925611664, 0.0011399611504493146], [0.05932450884991336, 0.0008496305883131249, 0.00027095330976641694, 0.001186490176998272], [0.06174591737439962, 0.0008142116035177235, 0.00027251395576638693, 0.0012349183474879948], [0.06426615889988532, 8.92042382623096e-05, 8.920423826322552e-05, 0.0012853231779977048], [0.06688926742641126, 9.339736346561163e-05, 9.339736346489978e-05, 0.0013377853485282282], [0.06961944160708111, 0.00040599169078880156, 0.0002030320824188672, 0.0013923888321416208], [0.07246105146859462, 0.0002183257352075823, 0.00015439324988622013, 0.0014492210293718943], [0.07541864540608828, 0.00012684339163879, 0.00012684339163797725, 0.001508372908121773], [0.07849695746347965, 0.0, 0.0, 0.001569939149269589], [0.08170091491096862, 0.0, 0.0, 0.0016340182982193738], [0.08503564613182449, 0.0004165748322677754, 0.00024090333523406435, 0.001700712922636495], [0.08850648883108263, 0.0, 0.0, 0.0017701297766216512], [0.09211899857929008, 0.0, 0.0, 0.001842379971585803], [0.0958789577049754, 0.0, 0.0, 0.0019175791540995135], [0.09979238455007644, 0.0, 0.0, 0.001995847691001529], [0.10386554310314079, 0.0, 0.0, 0.0020773108620628228]], "data_range": [0.0021999999999999997, 0.10386554310314079], "simulation_range": [0.0021999999999999997, 0.10386554310314079]}], "layers": [{"name": "Al2O3", "thickness": "Al2O3 Thickness", "SLD": "Al2O3 SLD", "roughness": "Al2O3 Roughness", "hydration": "", "hydrate_with": "bulk out"}, {"name": "Ti0.27Co0.73", "thickness": "Ti0.27Co0.73 Thickness", "SLD": "Ti0.27Co0.73 SLD", "roughness": "Ti0.27Co0.73 Roughness", "hydration": "", "hydrate_with": "bulk out"}], "domain_contrasts": [], "contrasts": [{"name": "prist4", "data": "prist4", "background": "Background", "background_action": "add", "bulk_in": "vacuum SLD", "bulk_out": "Si SLD", "scalefactor": "Scalefactor", "resolution": "Data Resolution", "resample": false, "model": ["Al2O3", "Ti0.27Co0.73"]}]} \ No newline at end of file +{"name": "Example Project", "calculation": "normal", "model": "standard layers", "geometry": "air/substrate", "absorption": false, "parameters": [{"name": "Substrate Roughness", "min": 1.0, "value": 3.0, "max": 5.0, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 Thickness", "min": 20.0, "value": 20.0, "max": 20.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 Roughness", "min": 3.0, "value": 3.0, "max": 3.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Al2O3 SLD", "min": 5.715275837467511e-06, "value": 5.715275837467511e-06, "max": 5.715275837467511e-06, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 Thickness", "min": 93.0, "value": 93.0, "max": 93.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 Roughness", "min": 3.0, "value": 3.0, "max": 3.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}, {"name": "Ti0.27Co0.73 SLD", "min": 6.720584953375607e-07, "value": 6.720584953375607e-07, "max": 6.720584953375607e-07, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "bulk_in": [{"name": "vacuum SLD", "min": 0.0, "value": 0.0, "max": 0.0, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "bulk_out": [{"name": "Si SLD", "min": 2.07370547828562e-06, "value": 2.07370547828562e-06, "max": 2.07370547828562e-06, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "scalefactors": [{"name": "Scalefactor", "min": 0.0, "value": 1.0, "max": 1.5, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "domain_ratios": [], "background_parameters": [{"name": "Background Parameter", "min": 0.0, "value": 0.025, "max": 1.0, "fit": true, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "backgrounds": [{"name": "Background", "type": "constant", "source": "Background Parameter", "value_1": "", "value_2": "", "value_3": "", "value_4": "", "value_5": ""}], "resolution_parameters": [{"name": "Resolution Param 1", "min": 0.01, "value": 0.03, "max": 0.05, "fit": false, "prior_type": "uniform", "mu": 0.0, "sigma": Infinity, "show_priors": false}], "resolutions": [{"name": "Data Resolution", "type": "data", "source": "", "value_1": "", "value_2": "", "value_3": "", "value_4": "", "value_5": ""}], "custom_files": [], "data": [{"name": "Simulation", "data": [], "data_range": [], "simulation_range": [0.005, 0.7]}, {"name": "prist4", "data": [[0.0021999999999999997, 0.004724119389721505, 0.004724119389721505, 0.00019999999999999987], [0.0026, 0.0, 0.0, 0.0002000000000000001], [0.003, 0.0049441079014990305, 0.0028632759811688313, 0.0002000000000000001], [0.0034000000000000002, 0.00539571466421478, 0.0027033018099334193, 0.00019999999999999987], [0.0038, 0.011948517768746966, 0.0037903477990210636, 0.0002000000000000001], [0.004200000000000001, 0.016302332669940297, 0.003972317564845323, 0.0002000000000000001], [0.0046, 0.02265216487165058, 0.0045763672802481776, 0.0002000000000000001], [0.005, 0.023020814468949415, 0.00425372711337262, 0.00019999999999999966], [0.0054, 0.027305557750665344, 0.004428700971127359, 0.0002000000000000001], [0.0058, 0.019457945835850306, 0.0037817426451169783, 0.0002000000000000001], [0.006200000000000001, 0.027645506109865266, 0.004267993991409073, 0.0002000000000000001], [0.0066, 0.024223034347324195, 0.0037655052701117517, 0.0002000000000000001], [0.007, 0.028408308819418325, 0.0037377941755602716, 0.00019999999999999966], [0.0074, 0.057460495308053604, 0.0052154049057105455, 0.0002000000000000001], [0.0078, 0.1489883351950982, 0.00754789840356179, 0.0002000000000000001], [0.008199999999999999, 0.3520480929443021, 0.011146891694516669, 0.00019999999999999966], [0.0086, 0.5317657760789548, 0.01351725179531962, 0.00019999999999999966], [0.009, 0.7914500646501588, 0.016276277463585134, 0.00020000000000000052], [0.009399999999999999, 0.9680331047846104, 0.01782748799306378, 0.00019999999999999966], [0.0098, 1.0324643310179094, 0.018104900945963596, 0.00020000000000000052], [0.010204081632653062, 0.6287661683321234, 0.013873373556929145, 0.00020408163265306107], [0.010620574760516453, 0.3506955915110479, 0.010136613757789808, 0.00021241149521033023], [0.011054067607884473, 0.23477751708069897, 0.008109962639928676, 0.000221081352157689], [0.011505254040859348, 0.18964302712880826, 0.007180573014831645, 0.00023010508081718756], [0.011974856246608712, 0.14285208497806512, 0.006016224926747713, 0.00023949712493217482], [0.012463625889327434, 0.12188457497836602, 0.005435279585343197, 0.00024927251778654805], [0.012972345313381616, 0.10530945504618572, 0.005027517945960155, 0.00025944690626763297], [0.013501828795560456, 0.08038795087657985, 0.004197556276825506, 0.0002700365759112089], [0.014052923848440476, 0.07313672279549625, 0.003958200398418697, 0.00028105847696880976], [0.01462651257694825, 0.06129841978151465, 0.0034783001152817426, 0.0002925302515389659], [0.01522351309029308, 0.06240905936586468, 0.003479800062460076, 0.000304470261805862], [0.015844880971529533, 0.05651280096554304, 0.0032223775371921573, 0.00031689761943059103], [0.016491610807102167, 0.05044073793552524, 0.00290210672478378, 0.0003298322161420439], [0.017164737778820625, 0.0502775250441711, 0.002825286449304508, 0.00034329475557641313], [0.0178653393208133, 0.05168970509722787, 0.002811814341605395, 0.0003573067864162654], [0.018594536844111803, 0.0530076187705834, 0.0027685413804410695, 0.00037189073688223724], [0.019353497531626573, 0.0490707566771454, 0.0025677593751218504, 0.00038706995063253133], [0.020143436206386842, 0.04687883170966378, 0.0024119133732668076, 0.0004028687241277376], [0.020965617276035284, 0.04919955377214455, 0.0024276503561561644, 0.0004193123455207056], [0.021821356756689787, 0.05204111270310913, 0.00245561515567379, 0.00043642713513379616], [0.022712024379411822, 0.04925178172610669, 0.0023335505076022252, 0.00045424048758823873], [0.02363904578265312, 0.04317260894774357, 0.00211385396560445, 0.0004727809156530611], [0.024603904794189984, 0.0383043276355005, 0.0019158755178575817, 0.0004920780958838009], [0.02560814580619774, 0.04444220010645997, 0.002018641932709427, 0.0005121629161239545], [0.026653376247267036, 0.039587001147536376, 0.0018488058581743547, 0.0005330675249453423], [0.027741269155318757, 0.036677858215866437, 0.0017473224966445143, 0.0005548253831063766], [0.028873565855535847, 0.037663512267048754, 0.0017682821318945074, 0.0005774713171107174], [0.030052078747598535, 0.036755569252809664, 0.0017350440273063527, 0.0006010415749519698], [0.03127869420668419, 0.03854639441776167, 0.0017965558626918197, 0.0006255738841336837], [0.032555375602875386, 0.032866785139061716, 0.0016217721152892931, 0.000651107512057509], [0.03388416644380907, 0.0315131968037535, 0.0016061232808323794, 0.0006776833288761816], [0.0352671936455972, 0.030280345918169513, 0.0015885947028228238, 0.0007053438729119448], [0.03670667093725423, 0.025036982048446406, 0.0014176844815086535, 0.0007341334187450851], [0.038204902404080934, 0.02083180456328542, 0.001280336546816776, 0.0007640980480816198], [0.03976428617567608, 0.019376976329704945, 0.0012712203272554497, 0.0007952857235135231], [0.04138731826447918, 0.016729675515039004, 0.0011715497338181137, 0.000827746365289584], [0.04307659656098854, 0.013996303090353096, 0.0010654383375290077, 0.0008615319312197701], [0.0448348249920493, 0.010621480384334052, 0.0009246807782300395, 0.0008966964998409904], [0.04666481784886764, 0.007820332463525126, 0.0008093102454836752, 0.000933296356977354], [0.04856950429167857, 0.0060428022894521575, 0.0007183835413384203, 0.0009713900858335685], [0.050551933038277694, 0.004095892971484393, 0.0005841670446995313, 0.0010110386607655557], [0.05261527724392169, 0.005111525161941947, 0.0006658003030884043, 0.0010523055448784409], [0.05476283958040829, 0.0020207116612746484, 0.0004143866059231477, 0.0010952567916081637], [0.05699805752246577, 0.001711568931414378, 0.00038529038925611664, 0.0011399611504493146], [0.05932450884991336, 0.0008496305883131249, 0.00027095330976641694, 0.001186490176998272], [0.06174591737439962, 0.0008142116035177235, 0.00027251395576638693, 0.0012349183474879948], [0.06426615889988532, 8.92042382623096e-05, 8.920423826322552e-05, 0.0012853231779977048], [0.06688926742641126, 9.339736346561163e-05, 9.339736346489978e-05, 0.0013377853485282282], [0.06961944160708111, 0.00040599169078880156, 0.0002030320824188672, 0.0013923888321416208], [0.07246105146859462, 0.0002183257352075823, 0.00015439324988622013, 0.0014492210293718943], [0.07541864540608828, 0.00012684339163879, 0.00012684339163797725, 0.001508372908121773], [0.07849695746347965, 0.0, 0.0, 0.001569939149269589], [0.08170091491096862, 0.0, 0.0, 0.0016340182982193738], [0.08503564613182449, 0.0004165748322677754, 0.00024090333523406435, 0.001700712922636495], [0.08850648883108263, 0.0, 0.0, 0.0017701297766216512], [0.09211899857929008, 0.0, 0.0, 0.001842379971585803], [0.0958789577049754, 0.0, 0.0, 0.0019175791540995135], [0.09979238455007644, 0.0, 0.0, 0.001995847691001529], [0.10386554310314079, 0.0, 0.0, 0.0020773108620628228]], "data_range": [0.0021999999999999997, 0.10386554310314079], "simulation_range": [0.0021999999999999997, 0.10386554310314079]}], "layers": [{"name": "Al2O3", "thickness": "Al2O3 Thickness", "SLD": "Al2O3 SLD", "roughness": "Al2O3 Roughness", "hydration": "", "hydrate_with": "bulk out"}, {"name": "Ti0.27Co0.73", "thickness": "Ti0.27Co0.73 Thickness", "SLD": "Ti0.27Co0.73 SLD", "roughness": "Ti0.27Co0.73 Roughness", "hydration": "", "hydrate_with": "bulk out"}], "domain_contrasts": [], "contrasts": [{"name": "prist4", "data": "prist4", "background": "Background", "background_action": "add", "bulk_in": "vacuum SLD", "bulk_out": "Si SLD", "scalefactor": "Scalefactor", "resolution": "Data Resolution", "resample": false, "model": ["Al2O3", "Ti0.27Co0.73"]}]} \ No newline at end of file