diff --git a/3rdParty/mcmcstat/runDram.m b/3rdParty/mcmcstat/runDram.m index 04596d271..87d148977 100644 --- a/3rdParty/mcmcstat/runDram.m +++ b/3rdParty/mcmcstat/runDram.m @@ -179,7 +179,7 @@ % predIntRef = predIntRef.predictionIntervals; % % % Make sure the calc SLD flag is set in controls... -% problem{2}.calcSldDuringFit = true; +% problem{2}.calcSLD = true; % predIntSld = mcmcpred_compile_sld(output.results,output.chain,[],output.data,problem,500); % predIntSld = predIntSld.predictionIntervals; % diff --git a/3rdParty/mcmcstat/sldModel.m b/3rdParty/mcmcstat/sldModel.m index 9708f9324..126b8274d 100644 --- a/3rdParty/mcmcstat/sldModel.m +++ b/3rdParty/mcmcstat/sldModel.m @@ -26,7 +26,7 @@ problemStruct = problem{1}; controls = problem{2}; -controls.calcSldDuringFit = true; +controls.calcSLD = true; problemStruct.fitParams = pars; problemStruct = unpackParams(problemStruct); diff --git a/API/RATMain.m b/API/RATMain.m index 454d9aa7e..17fcfd10d 100644 --- a/API/RATMain.m +++ b/API/RATMain.m @@ -34,15 +34,10 @@ results = makeEmptyResultStruct(problemStruct.numberOfContrasts, length(problemStruct.fitParams), domains); bayesResults = makeEmptyBayesResultsStruct(problemStruct.numberOfContrasts, domains, controls.nChains); - % Set controls.calcSLD to 1 if we are doing customXY - if strcmpi(problemStruct.modelType, coderEnums.modelTypes.CustomXY) - controls.calcSldDuringFit = true; - end - if problemStruct.numberOfContrasts > 0 switch controls.procedure case coderEnums.procedures.Calculate % Just a single reflectivity calculation - controls.calcSldDuringFit = true; + controls.calcSLD = true; results = reflectivityCalculation(problemStruct,controls); case coderEnums.procedures.Simplex if ~strcmpi(controls.display, coderEnums.displayOptions.Off) diff --git a/API/controlsClass.m b/API/controlsClass.m index d32a9e829..e79fa186d 100644 --- a/API/controlsClass.m +++ b/API/controlsClass.m @@ -31,8 +31,6 @@ % How the calculation should be parallelised (This uses the Parallel Computing Toolbox). Can be 'single', 'contrasts' or 'points'. % procedure : procedures, default: procedures.Calculate % Which procedure RAT should execute. Can be 'calculate', 'simplex', 'de', 'ns', or 'dream'. - % calcSldDuringFit : logical, default: false - % Whether SLD will be calculated during fit (for live plotting etc.) % numSimulationPoints : whole number, default: 500 % The number of points used for a reflectivity simulation where no data is present. % resampleMinAngle : float, default: 0.9 @@ -94,7 +92,6 @@ procedure = procedures.Calculate.value parallel = parallelOptions.Single.value - calcSldDuringFit = false numSimulationPoints = 500 resampleMinAngle = 0.9 resampleNPoints = 50 @@ -147,11 +144,6 @@ obj.procedure = validateOption(val, 'procedures', message).value; end - function set.calcSldDuringFit(obj,val) - validateLogical(val, 'calcSldDuringFit must be logical ''true'' or ''false'''); - obj.calcSldDuringFit = val; - end - function set.display(obj,val) message = sprintf('display must be a displayOptions enum or one of the following strings (%s)', ... strjoin(displayOptions.values(), ', ')); @@ -455,7 +447,6 @@ function groups = getPropertyGroups(obj) masterPropList = struct('parallel', {obj.parallel},... 'procedure', {obj.procedure},... - 'calcSldDuringFit', {obj.calcSldDuringFit},... 'display', {obj.display},... 'xTolerance', {obj.xTolerance},... 'funcTolerance', {obj.funcTolerance},... @@ -539,15 +530,13 @@ % % The parameters that can be set when using calculate procedure are % 1) parallel - % 2) calcSldDuringFit - % 3) numSimulationPoints - % 4) resampleMinAngle - % 5) resampleNPoints - % 6) display + % 2) numSimulationPoints + % 3) resampleMinAngle + % 4) resampleNPoints + % 5) display % The default values for Calculate defaultParallel = parallelOptions.Single.value; - defaultCalcSldDuringFit = false; defaultNumSimulationPoints = 500; defaultResampleMinAngle = 0.9; defaultResampleNPoints = 50; @@ -557,7 +546,6 @@ p = inputParser; p.PartialMatching = false; addParameter(p,'parallel', defaultParallel, @(x) isText(x) || isenum(x)); - addParameter(p,'calcSldDuringFit', defaultCalcSldDuringFit, @islogical); addParameter(p,'numSimulationPoints', defaultNumSimulationPoints, @isnumeric); addParameter(p,'resampleMinAngle', defaultResampleMinAngle, @isnumeric); addParameter(p,'resampleNPoints', defaultResampleNPoints, @isnumeric); @@ -565,12 +553,11 @@ properties = varargin{:}; % Parses the input or raises invalidOption error - errorMsg = 'Only parallel, calcSldDuringFit, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the Calculate procedure'; + errorMsg = 'Only parallel, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the Calculate procedure'; inputBlock = obj.parseInputs(p, properties, errorMsg); % Sets the values the for Calculate parameters obj.parallel = inputBlock.parallel; - obj.calcSldDuringFit = inputBlock.calcSldDuringFit; obj.numSimulationPoints = inputBlock.numSimulationPoints; obj.resampleMinAngle = inputBlock.resampleMinAngle; obj.resampleNPoints = inputBlock.resampleNPoints; @@ -590,11 +577,10 @@ % 5) updateFreq % 6) updatePlotFreq % 7) parallel - % 8) calcSldDuringFit - % 9) numSimulationPoints - % 10) resampleMinAngle - % 11) resampleNPoints - % 12) display + % 8) numSimulationPoints + % 9) resampleMinAngle + % 10) resampleNPoints + % 11) display % The simplex default values defaultXTolerance = 1e-6; @@ -604,7 +590,6 @@ defaultUpdateFreq = 1; defaultUpdatePlotFreq = 20; defaultParallel = parallelOptions.Single.value; - defaultCalcSldDuringFit = false; defaultNumSimulationPoints = 500; defaultResampleMinAngle = 0.9; defaultResampleNPoints = 50; @@ -620,7 +605,6 @@ addParameter(p,'updateFreq', defaultUpdateFreq, @isnumeric); addParameter(p,'updatePlotFreq', defaultUpdatePlotFreq, @isnumeric); addParameter(p,'parallel', defaultParallel, @(x) isText(x) || isenum(x)); - addParameter(p,'calcSldDuringFit', defaultCalcSldDuringFit, @islogical); addParameter(p,'numSimulationPoints', defaultNumSimulationPoints, @isnumeric); addParameter(p,'resampleMinAngle', defaultResampleMinAngle, @isnumeric); addParameter(p,'resampleNPoints', defaultResampleNPoints, @isnumeric); @@ -628,7 +612,7 @@ properties = varargin{:}; % Parses the input or raises invalidOption error - errorMsg = 'Only xTolerance, funcTolerance, maxFuncEvals, maxIterations, updateFreq, updatePlotFreq, parallel, calcSldDuringFit, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the Simplex procedure.'; + errorMsg = 'Only xTolerance, funcTolerance, maxFuncEvals, maxIterations, updateFreq, updatePlotFreq, parallel, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the Simplex procedure.'; inputBlock = obj.parseInputs(p, properties, errorMsg); % Sets the values the for simplex parameters @@ -639,7 +623,6 @@ obj.updateFreq = inputBlock.updateFreq; obj.updatePlotFreq = inputBlock.updatePlotFreq; obj.parallel = inputBlock.parallel; - obj.calcSldDuringFit = inputBlock.calcSldDuringFit; obj.numSimulationPoints = inputBlock.numSimulationPoints; obj.resampleMinAngle = inputBlock.resampleMinAngle; obj.resampleNPoints = inputBlock.resampleNPoints; @@ -659,13 +642,12 @@ % 5) targetValue % 6) numGenerations % 7) parallel - % 8) calcSldDuringFit - % 9) numSimulationPoints - % 10) resampleMinAngle - % 11) resampleNPoints - % 12) display - % 13) updateFreq - % 14) updatePlotFreq + % 8) numSimulationPoints + % 9) resampleMinAngle + % 10) resampleNPoints + % 11) display + % 12) updateFreq + % 13) updatePlotFreq % The default values for DE defaultPopulationSize = 20; @@ -675,7 +657,6 @@ defaultTargetValue = 1; defaultNumGenerations = 500; defaultParallel = parallelOptions.Single.value; - defaultCalcSldDuringFit = false; defaultNumSimulationPoints = 500; defaultResampleMinAngle = 0.9; defaultResampleNPoints = 50; @@ -693,7 +674,6 @@ addParameter(p,'targetValue', defaultTargetValue, @isnumeric); addParameter(p,'numGenerations', defaultNumGenerations, @isnumeric); addParameter(p,'parallel', defaultParallel, @(x) isText(x) || isenum(x)); - addParameter(p,'calcSldDuringFit', defaultCalcSldDuringFit, @islogical); addParameter(p,'numSimulationPoints', defaultNumSimulationPoints, @isnumeric); addParameter(p,'resampleMinAngle', defaultResampleMinAngle, @isnumeric); addParameter(p,'resampleNPoints', defaultResampleNPoints, @isnumeric); @@ -703,7 +683,7 @@ properties = varargin{:}; % Parses the input or raises invalidOption error - errorMsg = 'Only populationSize, fWeight, crossoverProbability, strategy, targetValue, numGenerations, parallel, calcSldDuringFit, numSimulationPoints, resampleMinAngle, resampleNPoints, display, updateFreq, and updatePlotFreq can be set while using the Differential Evolution procedure'; + errorMsg = 'Only populationSize, fWeight, crossoverProbability, strategy, targetValue, numGenerations, parallel, numSimulationPoints, resampleMinAngle, resampleNPoints, display, updateFreq, and updatePlotFreq can be set while using the Differential Evolution procedure'; inputBlock = obj.parseInputs(p, properties, errorMsg); % Sets the values the for DE parameters @@ -714,7 +694,6 @@ obj.targetValue = inputBlock.targetValue; obj.numGenerations = inputBlock.numGenerations; obj.parallel = inputBlock.parallel; - obj.calcSldDuringFit = inputBlock.calcSldDuringFit; obj.numSimulationPoints = inputBlock.numSimulationPoints; obj.resampleMinAngle = inputBlock.resampleMinAngle; obj.resampleNPoints = inputBlock.resampleNPoints; @@ -734,11 +713,10 @@ % 3) propScale % 4) nsTolerance % 5) parallel - % 6) calcSldDuringFit - % 7) numSimulationPoints - % 8) resampleMinAngle - % 9) resampleNPoints - % 10) display + % 6) numSimulationPoints + % 7) resampleMinAngle + % 8) resampleNPoints + % 9) display % The default values for NS defaultnLive = 150; @@ -746,7 +724,6 @@ defaultPropScale = 0.1; defaultNsTolerance = 0.1; defaultParallel = parallelOptions.Single.value; - defaultCalcSldDuringFit = false; defaultNumSimulationPoints = 500; defaultResampleMinAngle = 0.9; defaultResampleNPoints = 50; @@ -760,7 +737,6 @@ addParameter(p,'propScale', defaultPropScale, @isnumeric); addParameter(p,'nsTolerance', defaultNsTolerance, @isnumeric); addParameter(p,'parallel', defaultParallel, @(x) isText(x) || isenum(x)); - addParameter(p,'calcSldDuringFit', defaultCalcSldDuringFit, @islogical); addParameter(p,'numSimulationPoints', defaultNumSimulationPoints, @isnumeric); addParameter(p,'resampleMinAngle', defaultResampleMinAngle, @isnumeric); addParameter(p,'resampleNPoints', defaultResampleNPoints, @isnumeric); @@ -768,7 +744,7 @@ properties = varargin{:}; % Parses the input or raises invalidOption error - errorMsg = 'Only nLive, nMCMC, propScale, nsTolerance, parallel, calcSldDuringFit, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the Nested Sampler procedure'; + errorMsg = 'Only nLive, nMCMC, propScale, nsTolerance, parallel, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the Nested Sampler procedure'; inputBlock = obj.parseInputs(p, properties, errorMsg); % Sets the values the for NS parameters @@ -777,7 +753,6 @@ obj.propScale = inputBlock.propScale; obj.nsTolerance = inputBlock.nsTolerance; obj.parallel = inputBlock.parallel; - obj.calcSldDuringFit = inputBlock.calcSldDuringFit; obj.numSimulationPoints = inputBlock.numSimulationPoints; obj.resampleMinAngle = inputBlock.resampleMinAngle; obj.resampleNPoints = inputBlock.resampleNPoints; @@ -797,11 +772,10 @@ % 5) boundHandling % 6) adaptPCR % 7) parallel - % 8) calcSldDuringFit - % 9) numSimulationPoints - % 10) resampleMinAngle - % 11) resampleNPoints - % 12) display + % 8) numSimulationPoints + % 9) resampleMinAngle + % 10) resampleNPoints + % 11) display % The default values for Dream defaultNSamples = 50000; @@ -811,7 +785,6 @@ defaultBoundHandling = boundHandlingOptions.Fold.value; defaultAdaptPCR = false; defaultParallel = parallelOptions.Single.value; - defaultCalcSldDuringFit = false; defaultNumSimulationPoints = 500; defaultResampleMinAngle = 0.9; defaultResampleNPoints = 50; @@ -827,7 +800,6 @@ addParameter(p,'boundHandling', defaultBoundHandling, @(x) isText(x) || isenum(x)); addParameter(p,'adaptPCR', defaultAdaptPCR, @islogical); addParameter(p,'parallel', defaultParallel, @(x) isText(x) || isenum(x)); - addParameter(p,'calcSldDuringFit', defaultCalcSldDuringFit, @islogical); addParameter(p,'numSimulationPoints', defaultNumSimulationPoints, @isnumeric); addParameter(p,'resampleMinAngle', defaultResampleMinAngle, @isnumeric); addParameter(p,'resampleNPoints', defaultResampleNPoints, @isnumeric); @@ -835,7 +807,7 @@ properties = varargin{:}; % Parses the input or raises invalidOption error - errorMsg = 'Only nSamples, nChains, jumpProbability, pUnitGamma, boundHandling, adaptPCR, parallel, calcSldDuringFit, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the DREAM procedure'; + errorMsg = 'Only nSamples, nChains, jumpProbability, pUnitGamma, boundHandling, adaptPCR, parallel, numSimulationPoints, resampleMinAngle, resampleNPoints and display can be set while using the DREAM procedure'; inputBlock = obj.parseInputs(p, properties, errorMsg); % Sets the values the for Dream parameters @@ -846,7 +818,6 @@ obj.boundHandling = inputBlock.boundHandling; obj.adaptPCR = inputBlock.adaptPCR; obj.parallel = inputBlock.parallel; - obj.calcSldDuringFit = inputBlock.calcSldDuringFit; obj.numSimulationPoints = inputBlock.numSimulationPoints; obj.resampleMinAngle = inputBlock.resampleMinAngle; obj.resampleNPoints = inputBlock.resampleNPoints; diff --git a/API/parseClassToStructs.m b/API/parseClassToStructs.m index 2134b644a..553571b1e 100644 --- a/API/parseClassToStructs.m +++ b/API/parseClassToStructs.m @@ -300,6 +300,7 @@ controls.(controlsFields{i}) = inputControls.(controlsFields{i}); end +controls.calcSLD = false; controls.IPCFilePath = inputControls.getIPCFilePath(); %% Finally, populate the fitParams and fitLimits arrays diff --git a/compile/fullCompile/makeCompileArgsFull.m b/compile/fullCompile/makeCompileArgsFull.m index 5bb701be0..5fd91f858 100644 --- a/compile/fullCompile/makeCompileArgsFull.m +++ b/compile/fullCompile/makeCompileArgsFull.m @@ -84,7 +84,6 @@ ARGS_1_2 = struct; ARGS_1_2.procedure = coder.typeof('X',[1 maxArraySize],[0 1]); ARGS_1_2.parallel = coder.typeof('X',[1 maxArraySize],[0 1]); -ARGS_1_2.calcSldDuringFit = coder.typeof(true); ARGS_1_2.numSimulationPoints = coder.typeof(0); ARGS_1_2.resampleMinAngle = coder.typeof(0); ARGS_1_2.resampleNPoints = coder.typeof(0); @@ -111,6 +110,7 @@ ARGS_1_2.pUnitGamma = coder.typeof(0); ARGS_1_2.boundHandling = coder.typeof('X',[1 maxArraySize],[0 1]); ARGS_1_2.adaptPCR = coder.typeof(true); +ARGS_1_2.calcSLD = coder.typeof(true); ARGS_1_2.IPCFilePath = coder.typeof('X',[1 maxArraySize],[0 1]); ARGS{1}{2} = coder.typeof(ARGS_1_2); diff --git a/compile/reflectivityCalculation/makeCompileArgs.m b/compile/reflectivityCalculation/makeCompileArgs.m index 5b462b65c..a7e1d168f 100644 --- a/compile/reflectivityCalculation/makeCompileArgs.m +++ b/compile/reflectivityCalculation/makeCompileArgs.m @@ -84,7 +84,6 @@ ARGS_1_2 = struct; ARGS_1_2.procedure = coder.typeof('X',[1 maxArraySize],[0 1]); ARGS_1_2.parallel = coder.typeof('X',[1 maxArraySize],[0 1]); -ARGS_1_2.calcSldDuringFit = coder.typeof(true); ARGS_1_2.numSimulationPoints = coder.typeof(0); ARGS_1_2.resampleMinAngle = coder.typeof(0); ARGS_1_2.resampleNPoints = coder.typeof(0); @@ -111,6 +110,7 @@ ARGS_1_2.pUnitGamma = coder.typeof(0); ARGS_1_2.boundHandling = coder.typeof('X',[1 maxArraySize],[0 1]); ARGS_1_2.adaptPCR = coder.typeof(true); +ARGS_1_2.calcSLD = coder.typeof(true); ARGS_1_2.IPCFilePath = coder.typeof('X',[1 maxArraySize],[0 1]); ARGS{1}{2} = coder.typeof(ARGS_1_2); diff --git a/examples/miscellaneous/bayesBenchmark/directCompare2D.m b/examples/miscellaneous/bayesBenchmark/directCompare2D.m index 299b90c58..a105936da 100644 --- a/examples/miscellaneous/bayesBenchmark/directCompare2D.m +++ b/examples/miscellaneous/bayesBenchmark/directCompare2D.m @@ -24,7 +24,6 @@ d2oproblem = r1ToProjectClass(fullfile(root, 'utilities', 'misc', 'defaultR1ProjectTemplate.mat')); controls = controlsClass(); -controls.calcSldDuringFit = true; controls.nsTolerance = 1; controls.nLive = 500; d2oproblem.setScalefactor(1,'fit',false); diff --git a/examples/miscellaneous/bayesBenchmark/directCompare3D.m b/examples/miscellaneous/bayesBenchmark/directCompare3D.m index b48cfe3dc..cc00f7782 100644 --- a/examples/miscellaneous/bayesBenchmark/directCompare3D.m +++ b/examples/miscellaneous/bayesBenchmark/directCompare3D.m @@ -24,7 +24,6 @@ d2oproblem = r1ToProjectClass(fullfile(root, 'utilities', 'misc', 'defaultR1ProjectTemplate.mat')); controls = controlsClass(); -controls.calcSldDuringFit = true; controls.nsTolerance = 1; controls.nLive = 500; diff --git a/minimisers/DE/runDE.m b/minimisers/DE/runDE.m index 7c3b6906d..f4a5035e8 100644 --- a/minimisers/DE/runDE.m +++ b/minimisers/DE/runDE.m @@ -79,7 +79,7 @@ S_struct.FVr_lim_lo = FVr_lim_lo; S_struct.I_NP = I_NP; - S_struct.fWeight = fWeight; + S_struct.fWeight = fWeight; S_struct.F_CR = F_CR; S_struct.I_D = I_D; S_struct.FVr_minbound = FVr_minbound; @@ -97,7 +97,7 @@ problemStruct.fitParams = res; problemStruct = unpackParams(problemStruct); % Ensure SLD is calculated for final result - controls.calcSldDuringFit = true; + controls.calcSLD = true; result = reflectivityCalculation(problemStruct,controls); if ~strcmpi(controls.display, coderEnums.displayOptions.Off) diff --git a/minimisers/generalUtils/bayesStats/processBayes.m b/minimisers/generalUtils/bayesStats/processBayes.m index 2038c0ea1..b05d13dc4 100644 --- a/minimisers/generalUtils/bayesStats/processBayes.m +++ b/minimisers/generalUtils/bayesStats/processBayes.m @@ -20,7 +20,7 @@ % The Bayesian-specific results from the optimisation. % Need to impose that we calculate the SLD -controls.calcSldDuringFit = true; +controls.calcSLD = true; % ... and use the Bayes best params problemStruct.fitParams = bayesOutputs.bestParams; diff --git a/minimisers/simplex/runSimplex.m b/minimisers/simplex/runSimplex.m index 7fddddeca..c002543bd 100644 --- a/minimisers/simplex/runSimplex.m +++ b/minimisers/simplex/runSimplex.m @@ -128,7 +128,7 @@ problemStruct.fitParams = x'; problemStruct = unpackParams(problemStruct); % Ensure SLD is calculated for final result -controls.calcSldDuringFit = true; +controls.calcSLD = true; result = reflectivityCalculation(problemStruct,controls); end diff --git a/targetFunctions/+domainsTF/domainsReflectivity.m b/targetFunctions/+domainsTF/domainsReflectivity.m index 85f92416e..507a1aa86 100644 --- a/targetFunctions/+domainsTF/domainsReflectivity.m +++ b/targetFunctions/+domainsTF/domainsReflectivity.m @@ -18,7 +18,7 @@ ] = extractProblemParams(problemStruct); nParams = length(problemStruct.params); - calcSld = controls.calcSldDuringFit; + calcSld = controls.calcSLD; parallel = controls.parallel; numSimulationPoints = controls.numSimulationPoints; resampleMinAngle = controls.resampleMinAngle; diff --git a/targetFunctions/+normalTF/normalReflectivity.m b/targetFunctions/+normalTF/normalReflectivity.m index 1fb96b724..66c30a083 100644 --- a/targetFunctions/+normalTF/normalReflectivity.m +++ b/targetFunctions/+normalTF/normalReflectivity.m @@ -18,7 +18,7 @@ ] = extractProblemParams(problemStruct); nParams = length(problemStruct.params); - calcSld = controls.calcSldDuringFit; + calcSld = controls.calcSLD; parallel = controls.parallel; numSimulationPoints = controls.numSimulationPoints; resampleMinAngle = controls.resampleMinAngle; diff --git a/targetFunctions/common/callReflectivity/coreLayersCalculation.m b/targetFunctions/common/callReflectivity/coreLayersCalculation.m index 44801cb27..56bddd26f 100644 --- a/targetFunctions/common/callReflectivity/coreLayersCalculation.m +++ b/targetFunctions/common/callReflectivity/coreLayersCalculation.m @@ -35,22 +35,27 @@ % We process real and imaginary parts of the SLD separately ReSLDLayers = layers(:, [1:2,4:end]); - ImSLDLayers = layers(:, [1,3:end]); - - % Note bulkIn and bulkOut = 0 since there is never any imaginary part - % for the bulk phases. sldProfile = makeSLDProfile(bulkIn,bulkOut,ReSLDLayers,ssubs,repeatLayers); - sldProfileIm = makeSLDProfile(0,0,ImSLDLayers,ssubs,repeatLayers); end % If required, then resample the SLD if resample == 1 + + % Here, we need the imaginary part of the SLD + % Note bulkIn and bulkOut = 0 since there is never any imaginary part + % for the bulk phases. + ImSLDLayers = layers(:, [1,3:end]); + sldProfileIm = makeSLDProfile(0,0,ImSLDLayers,ssubs,repeatLayers); + resampledLayers = resampleLayers(sldProfile,sldProfileIm,resampleMinAngle,resampleNPoints); inputLayers = resampledLayers; repeatLayers = 1; + else + inputLayers = layers; + end % Calculate the reflectivity diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomLayersInputs.mat b/tests/domainsTFReflectivityCalculation/domainsCustomLayersInputs.mat index 023253c58..55e9e6e8f 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomLayersInputs.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomLayersInputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomLayersOutputs.mat b/tests/domainsTFReflectivityCalculation/domainsCustomLayersOutputs.mat index 307d8f7ba..2b4b8ebfb 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomLayersOutputs.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomLayersOutputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomLayersTFParams.mat b/tests/domainsTFReflectivityCalculation/domainsCustomLayersTFParams.mat index e3672f99e..01b20c51f 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomLayersTFParams.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomLayersTFParams.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomXYInputs.mat b/tests/domainsTFReflectivityCalculation/domainsCustomXYInputs.mat index 2d4832182..02dbeb9f3 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomXYInputs.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomXYInputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomXYOutputs.mat b/tests/domainsTFReflectivityCalculation/domainsCustomXYOutputs.mat index 8afe30a4f..8eb9c78b6 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomXYOutputs.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomXYOutputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsCustomXYTFParams.mat b/tests/domainsTFReflectivityCalculation/domainsCustomXYTFParams.mat index 3883a78e9..f76b67340 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsCustomXYTFParams.mat and b/tests/domainsTFReflectivityCalculation/domainsCustomXYTFParams.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsStandardLayersInputs.mat b/tests/domainsTFReflectivityCalculation/domainsStandardLayersInputs.mat index 21e37a9c0..83b7b1d77 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsStandardLayersInputs.mat and b/tests/domainsTFReflectivityCalculation/domainsStandardLayersInputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsStandardLayersOutputs.mat b/tests/domainsTFReflectivityCalculation/domainsStandardLayersOutputs.mat index feac67b19..de8883898 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsStandardLayersOutputs.mat and b/tests/domainsTFReflectivityCalculation/domainsStandardLayersOutputs.mat differ diff --git a/tests/domainsTFReflectivityCalculation/domainsStandardLayersTFParams.mat b/tests/domainsTFReflectivityCalculation/domainsStandardLayersTFParams.mat index 3e04f2b63..b922030cc 100644 Binary files a/tests/domainsTFReflectivityCalculation/domainsStandardLayersTFParams.mat and b/tests/domainsTFReflectivityCalculation/domainsStandardLayersTFParams.mat differ diff --git a/tests/normalTFReflectivityCalculation/absorptionInputs.mat b/tests/normalTFReflectivityCalculation/absorptionInputs.mat index 08b307928..6cdba013e 100644 Binary files a/tests/normalTFReflectivityCalculation/absorptionInputs.mat and b/tests/normalTFReflectivityCalculation/absorptionInputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/absorptionOutputs.mat b/tests/normalTFReflectivityCalculation/absorptionOutputs.mat index 8a172d013..450b87d06 100644 Binary files a/tests/normalTFReflectivityCalculation/absorptionOutputs.mat and b/tests/normalTFReflectivityCalculation/absorptionOutputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/absorptionTFParams.mat b/tests/normalTFReflectivityCalculation/absorptionTFParams.mat index 86f6113b3..6a7cbecc5 100644 Binary files a/tests/normalTFReflectivityCalculation/absorptionTFParams.mat and b/tests/normalTFReflectivityCalculation/absorptionTFParams.mat differ diff --git a/tests/normalTFReflectivityCalculation/customLayersInputs.mat b/tests/normalTFReflectivityCalculation/customLayersInputs.mat index b1b1aa793..365167495 100644 Binary files a/tests/normalTFReflectivityCalculation/customLayersInputs.mat and b/tests/normalTFReflectivityCalculation/customLayersInputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customLayersOutputs.mat b/tests/normalTFReflectivityCalculation/customLayersOutputs.mat index 8a8e059a4..843d86c2e 100644 Binary files a/tests/normalTFReflectivityCalculation/customLayersOutputs.mat and b/tests/normalTFReflectivityCalculation/customLayersOutputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customLayersTFParams.mat b/tests/normalTFReflectivityCalculation/customLayersTFParams.mat index 76e63401e..e5db0bfc7 100644 Binary files a/tests/normalTFReflectivityCalculation/customLayersTFParams.mat and b/tests/normalTFReflectivityCalculation/customLayersTFParams.mat differ diff --git a/tests/normalTFReflectivityCalculation/customXYInputs.mat b/tests/normalTFReflectivityCalculation/customXYInputs.mat index 8b80d0191..bba07e910 100644 Binary files a/tests/normalTFReflectivityCalculation/customXYInputs.mat and b/tests/normalTFReflectivityCalculation/customXYInputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customXYOutputs.mat b/tests/normalTFReflectivityCalculation/customXYOutputs.mat index 09c4f687e..c31369eb0 100644 Binary files a/tests/normalTFReflectivityCalculation/customXYOutputs.mat and b/tests/normalTFReflectivityCalculation/customXYOutputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customXYTFParams.mat b/tests/normalTFReflectivityCalculation/customXYTFParams.mat index 199f9f4ab..ce08b7ad5 100644 Binary files a/tests/normalTFReflectivityCalculation/customXYTFParams.mat and b/tests/normalTFReflectivityCalculation/customXYTFParams.mat differ diff --git a/tests/normalTFReflectivityCalculation/standardLayersInputs.mat b/tests/normalTFReflectivityCalculation/standardLayersInputs.mat index c0dc309d2..5a2ee430e 100644 Binary files a/tests/normalTFReflectivityCalculation/standardLayersInputs.mat and b/tests/normalTFReflectivityCalculation/standardLayersInputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/standardLayersOutputs.mat b/tests/normalTFReflectivityCalculation/standardLayersOutputs.mat index ab70b970d..f3229d72d 100644 Binary files a/tests/normalTFReflectivityCalculation/standardLayersOutputs.mat and b/tests/normalTFReflectivityCalculation/standardLayersOutputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/standardLayersTFParams.mat b/tests/normalTFReflectivityCalculation/standardLayersTFParams.mat index 5eb429f74..e404db035 100644 Binary files a/tests/normalTFReflectivityCalculation/standardLayersTFParams.mat and b/tests/normalTFReflectivityCalculation/standardLayersTFParams.mat differ diff --git a/tests/testControlsClass.m b/tests/testControlsClass.m index 289b2557e..18d8cc009 100644 --- a/tests/testControlsClass.m +++ b/tests/testControlsClass.m @@ -99,18 +99,6 @@ function setResampleNPoints(value) end end - function testCalcSldDuringFit(testCase) - % Test if set.calcSldDuringFit method is working - testCase.controls.calcSldDuringFit = true; - testCase.verifyTrue(testCase.controls.calcSldDuringFit, 'set.calcSldDuringFit method is not working') - testCase.controls.calcSldDuringFit = false; - testCase.verifyFalse(testCase.controls.calcSldDuringFit, 'set.calcSldDuringFit method is not working') - testCase.verifyError(@setCalcSldDuringFit, exceptions.invalidType.errorID); % bad calcSldDuringFit option - function setCalcSldDuringFit - testCase.controls.calcSldDuringFit = 2; - end - end - function testUpdateFreq(testCase) % Test if UpdateFreq property is working testCase.controls.updateFreq = 5; @@ -340,7 +328,7 @@ function setPUnitGamma(value) testCase.controls.boundHandling = 'random'; end - % Test if set.calcSldDuringFit method is working + % Test if set.adaptPCR method is working testCase.controls.adaptPCR = true; testCase.verifyTrue(testCase.controls.adaptPCR, 'set.adaptPCR method is not working') testCase.controls.adaptPCR = false; @@ -419,7 +407,6 @@ function testSetProcedureWithDream(testCase) testCase.verifyEqual(testCase.controls.boundHandling, boundHandlingOptions.Reflect.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.adaptPCR, true, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Single.value, 'setProcedure method is not working'); - testCase.verifyEqual(testCase.controls.calcSldDuringFit, false, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numSimulationPoints, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.9, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 50, 'setProcedure method is not working'); @@ -434,7 +421,6 @@ function testSetProcedureWithDream(testCase) 'boundHandling', boundHandlingOptions.Reflect.value,... 'adaptPCR', true,... 'parallel', parallelOptions.Contrasts.value,... - 'calcSldDuringFit', true,... 'numSimulationPoints', 1000,... 'resampleMinAngle', 0.1,... 'resampleNPoints', 10,... @@ -447,7 +433,6 @@ function testSetProcedureWithDream(testCase) testCase.verifyEqual(testCase.controls.boundHandling, boundHandlingOptions.Reflect.value, 'setProcedure method is not working'); testCase.verifyTrue(testCase.controls.adaptPCR, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Contrasts.value, 'setProcedure method is not working'); - testCase.verifyTrue(testCase.controls.calcSldDuringFit, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working'); @@ -472,7 +457,6 @@ function testSetProcedureWithNS(testCase) testCase.verifyEqual(testCase.controls.propScale, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.nsTolerance, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Single.value, 'setProcedure method is not working'); - testCase.verifyEqual(testCase.controls.calcSldDuringFit, false, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numSimulationPoints, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.9, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 50, 'setProcedure method is not working'); @@ -485,7 +469,6 @@ function testSetProcedureWithNS(testCase) 'propScale', 0.8,... 'nsTolerance', 0.5,... 'parallel', parallelOptions.Contrasts.value,... - 'calcSldDuringFit', true,... 'numSimulationPoints', 1000,... 'resampleMinAngle', 0.1,... 'resampleNPoints', 10,... @@ -496,7 +479,6 @@ function testSetProcedureWithNS(testCase) testCase.verifyEqual(testCase.controls.propScale, 0.8, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.nsTolerance, 0.5, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Contrasts.value, 'setProcedure method is not working'); - testCase.verifyEqual(testCase.controls.calcSldDuringFit, true, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working'); @@ -520,7 +502,6 @@ function testSetProcedureWithDE(testCase) testCase.verifyEqual(testCase.controls.targetValue, 1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numGenerations, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Single.value, 'setProcedure method is not working'); - testCase.verifyEqual(testCase.controls.calcSldDuringFit, false, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numSimulationPoints, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.9, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 50, 'setProcedure method is not working'); @@ -537,7 +518,6 @@ function testSetProcedureWithDE(testCase) 'targetValue', 2,... 'numGenerations', 3,... 'parallel', parallelOptions.Contrasts.value,... - 'calcSldDuringFit', true,... 'numSimulationPoints', 1000,... 'resampleMinAngle', 0.1,... 'resampleNPoints', 10,... @@ -552,7 +532,6 @@ function testSetProcedureWithDE(testCase) testCase.verifyEqual(testCase.controls.targetValue, 2, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numGenerations, 3, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Contrasts.value, 'setProcedure method is not working'); - testCase.verifyEqual(testCase.controls.calcSldDuringFit, true, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working'); @@ -578,7 +557,6 @@ function testSetProcedureWithSimplex(testCase) testCase.verifyEqual(testCase.controls.updateFreq, 1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.updatePlotFreq, 20, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Single.value, 'setProcedure method is not working'); - testCase.verifyEqual(testCase.controls.calcSldDuringFit, false, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numSimulationPoints, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.9, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 50, 'setProcedure method is not working'); @@ -593,7 +571,6 @@ function testSetProcedureWithSimplex(testCase) 'updateFreq', 1,... 'updatePlotFreq', 4, ... 'parallel', parallelOptions.Contrasts.value,... - 'calcSldDuringFit', true,... 'numSimulationPoints', 1000,... 'resampleMinAngle', 0.1,... 'resampleNPoints', 10,... @@ -606,7 +583,6 @@ function testSetProcedureWithSimplex(testCase) testCase.verifyEqual(testCase.controls.updateFreq, 1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.updatePlotFreq, 4, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Contrasts.value, 'setProcedure method is not working'); - testCase.verifyEqual(testCase.controls.calcSldDuringFit, true, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working'); @@ -624,7 +600,6 @@ function testSetProcedureWithCalculate(testCase) testCase.controls = testCase.controls.setProcedure(procedures.Calculate.value); testCase.verifyEqual(testCase.controls.procedure, procedures.Calculate.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Single.value, 'setProcedure method is not working'); - testCase.verifyEqual(testCase.controls.calcSldDuringFit, false, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numSimulationPoints, 500, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.9, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 50, 'setProcedure method is not working'); @@ -633,14 +608,12 @@ function testSetProcedureWithCalculate(testCase) % Test passing valid parameter values for Calculate procedure testCase.controls = testCase.controls.setProcedure(procedures.Calculate.value,... 'parallel', parallelOptions.Contrasts.value,... - 'calcSldDuringFit', true,... 'numSimulationPoints', 1000,... 'resampleMinAngle', 0.1,... 'resampleNPoints', 10,... 'display', displayOptions.Notify.value); testCase.verifyEqual(testCase.controls.procedure, procedures.Calculate.value, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Contrasts.value, 'setProcedure method is not working'); - testCase.verifyEqual(testCase.controls.calcSldDuringFit, true, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working'); testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working'); @@ -651,7 +624,6 @@ function testSetProcedureWithCalculate(testCase) testCase.verifyError(@() testCase.controls.setProcedure(procedures.Calculate.value, 'crossoverProbability', 0.7), exceptions.invalidOption.errorID); % DE Parameter testCase.verifyError(@() testCase.controls.setProcedure(procedures.Calculate.value, 'nMCMC', 1), exceptions.invalidOption.errorID); % NS Parameter testCase.verifyError(@() testCase.controls.setProcedure(procedures.Calculate.value, 'nSamples', 10), exceptions.invalidOption.errorID); % Dream Parameter - testCase.verifyError(@() testCase.controls.setProcedure(procedures.Calculate.value, 'calcSldDuringFit', 1), 'MATLAB:InputParser:ArgumentFailedValidation'); % Test exception testCase.verifyError(@() testCase.controls.setProcedure('bayes'), exceptions.invalidOption.errorID); diff --git a/tests/testProjectConversion/DSPCBilayerProjectClass.mat b/tests/testProjectConversion/DSPCBilayerProjectClass.mat index d62df1d4c..b226877af 100644 Binary files a/tests/testProjectConversion/DSPCBilayerProjectClass.mat and b/tests/testProjectConversion/DSPCBilayerProjectClass.mat differ diff --git a/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat b/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat index 642c543db..a7c637772 100644 Binary files a/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat and b/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat differ diff --git a/utilities/plotting/useLivePlot.m b/utilities/plotting/useLivePlot.m index c7096e157..b74d062b6 100644 --- a/utilities/plotting/useLivePlot.m +++ b/utilities/plotting/useLivePlot.m @@ -43,8 +43,7 @@ % Register the close function with the figure set(h,'CloseRequestFcn', @(varargin) obj.closeFigure()); - fprintf(['Live updating plot started in figure %d.\n To ensure slds are plotted, ' ... - 'set controls.calcSldDuringFit = true\n'], figureId); + fprintf('Live updating plot started in figure %d.\n', figureId); end end methods (Hidden)