diff --git a/API/createProject.m b/API/createProject.m index cf87c1e9d..1166cb806 100644 --- a/API/createProject.m +++ b/API/createProject.m @@ -7,10 +7,10 @@ % absorption terms are included in the refractive index. % All of the arguments are optional. % - % project = createProject(name='New experiment', calc='non polarised'); + % project = createProject(name='New experiment', calc='normal'); arguments options.name {mustBeTextScalar} = '' - options.calcType = calculationTypes.NonPolarised + options.calcType = calculationTypes.Normal options.model = modelTypes.StandardLayers options.geometry = geometryOptions.AirSubstrate options.absorption {mustBeA(options.absorption,'logical')} = false diff --git a/API/enums/calculationTypes.m b/API/enums/calculationTypes.m index eeb8d7cac..ab294b7b9 100644 --- a/API/enums/calculationTypes.m +++ b/API/enums/calculationTypes.m @@ -14,7 +14,7 @@ end enumeration - NonPolarised ('non polarised') + Normal ('normal') Domains ('domains') OilWater ('oil water') Magnetic ('magnetic') diff --git a/API/makeEmptyResultStruct.m b/API/makeEmptyResultStruct.m index a367f3e63..527fef828 100644 --- a/API/makeEmptyResultStruct.m +++ b/API/makeEmptyResultStruct.m @@ -4,7 +4,7 @@ % % nParams = number of fitted parameters % nContrasts = number of contrasts - % nDomains = number of domains - 1 for non-polarised, 2 for domains + % nDomains = number of domains - 1 for normal, 2 for domains % % result = % diff --git a/API/projectClass/domainsClass.m b/API/projectClass/domainsClass.m index 928aaedab..d1acca6ce 100644 --- a/API/projectClass/domainsClass.m +++ b/API/projectClass/domainsClass.m @@ -53,10 +53,10 @@ % Alias of the converter routine from domainsClass to % projectClass. % This routine takes the currently defined project and - % converts it to a nonPolarised calculation, preserving all + % converts it to a normal calculation, preserving all % currently defined properties. % - % nonPolarisedProject = project.toProjectClass(); + % normalProject = project.toProjectClass(); projectObj = obj.projectClass(); end @@ -245,11 +245,11 @@ function projectObj = projectClass(obj) % Converter routine from domainsClass to projectClass. % This routine takes the currently defined project and - % converts it to a nonPolarised calculation, preserving all + % converts it to a normal calculation, preserving all % currently defined properties. % - % nonPolarisedProject = project.projectClass(); - projectObj = projectClass(obj.experimentName, calculationTypes.NonPolarised, obj.modelType, obj.geometry, obj.absorption); + % normalProject = project.projectClass(); + projectObj = projectClass(obj.experimentName, calculationTypes.Normal, obj.modelType, obj.geometry, obj.absorption); projectObj = copyProperties(obj, projectObj); % Need to treat contrasts separately due to changes in the diff --git a/API/projectClass/projectClass.m b/API/projectClass/projectClass.m index 51b6d7061..2a58e9194 100644 --- a/API/projectClass/projectClass.m +++ b/API/projectClass/projectClass.m @@ -64,7 +64,7 @@ % project = projectClass('New experiment'); arguments experimentName {mustBeTextScalar} = '' - calculationType = calculationTypes.NonPolarised + calculationType = calculationTypes.Normal modelType = modelTypes.StandardLayers geometry = geometryOptions.AirSubstrate absorption {mustBeA(absorption,'logical')} = false diff --git a/examples/domains/README.md b/examples/domains/README.md index 7f650a5b4..027e226d8 100644 --- a/examples/domains/README.md +++ b/examples/domains/README.md @@ -2,7 +2,7 @@ This folder contains examples of how to use RAT to analyse what are referred to as 'Domains TF' samples, which are those where an incoherent sum is required -in order to calculate the reflectivity. As is the case for normal reflectivity i.e. non-polarised TF, +in order to calculate the reflectivity. As is the case for normal reflectivity i.e. normal TF, it is possible to use either 'Standard Layers', 'Custom Layers' or 'Custom XY' models. The basic principle for all three is that there is an additional fittable diff --git a/examples/miscellaneous/absorption/absorptionDPPC50.m b/examples/miscellaneous/absorption/absorptionDPPC50.m index f0a3ec491..75730ca62 100644 --- a/examples/miscellaneous/absorption/absorptionDPPC50.m +++ b/examples/miscellaneous/absorption/absorptionDPPC50.m @@ -2,7 +2,7 @@ % Set up the initial project.... -problem = createProject(name = 'DPPC_50_3pcBins', calcType = 'non polarised',... +problem = createProject(name = 'DPPC_50_3pcBins', calcType = 'normal',... model = 'custom layers', geometry = 'substrate/liquid', absorption = true); % Add the required parameters (substrate reference as already there by default).... diff --git a/examples/miscellaneous/backgroundTypes/DSPCScriptWithDataBackground.m b/examples/miscellaneous/backgroundTypes/DSPCScriptWithDataBackground.m index eac0113e7..633c07b01 100644 --- a/examples/miscellaneous/backgroundTypes/DSPCScriptWithDataBackground.m +++ b/examples/miscellaneous/backgroundTypes/DSPCScriptWithDataBackground.m @@ -1,7 +1,7 @@ % Standard Layers fit of a DSPC floating bilayer % Make the project -problem = createProject(name='original_dspc_bilayer', calcType='non polarised', model='standard layers', geometry='substrate/liquid', absorption=false); +problem = createProject(name='original_dspc_bilayer', calcType='normal', model='standard layers', geometry='substrate/liquid', absorption=false); % Make priors visible problem.showPriors(true); diff --git a/examples/miscellaneous/backgroundTypes/DSPCScriptWithFunctionBackground.m b/examples/miscellaneous/backgroundTypes/DSPCScriptWithFunctionBackground.m index 1ccae8473..f29c79708 100644 --- a/examples/miscellaneous/backgroundTypes/DSPCScriptWithFunctionBackground.m +++ b/examples/miscellaneous/backgroundTypes/DSPCScriptWithFunctionBackground.m @@ -1,7 +1,7 @@ % Standard Layers fit of a DSPC floating bilayer % Make the project -problem = createProject(name='original_dspc_bilayer', calcType='non polarised', model='standard layers', geometry='substrate/liquid', absorption=false); +problem = createProject(name='original_dspc_bilayer', calcType='normal', model='standard layers', geometry='substrate/liquid', absorption=false); % Make priors visible problem.showPriors(true); diff --git a/examples/normalReflectivity/README.md b/examples/normalReflectivity/README.md index 039c044f5..deab18b2e 100644 --- a/examples/normalReflectivity/README.md +++ b/examples/normalReflectivity/README.md @@ -1,7 +1,7 @@ -## 'Non-polarised Target Functions' Examples +## 'Normal Target Functions' Examples This folder contains examples of how to use RAT to analyse what are referred -to as 'Non-polarised TF' samples. This refers to reflectivity data that does not use +to as 'Normal TF' samples. This refers to reflectivity data that does not use absorption (i.e. an imaginary SLD), and is not analysed as magnetic, polarised or oil-water data. diff --git a/examples/normalReflectivity/customLayers/customLayersDSPCSheet.mlx b/examples/normalReflectivity/customLayers/customLayersDSPCSheet.mlx index 6510bc6a5..8fa4b2e9b 100644 Binary files a/examples/normalReflectivity/customLayers/customLayersDSPCSheet.mlx and b/examples/normalReflectivity/customLayers/customLayersDSPCSheet.mlx differ diff --git a/examples/normalReflectivity/standardLayers/standardLayersDSPCScript.m b/examples/normalReflectivity/standardLayers/standardLayersDSPCScript.m index dbe55acfa..be94b1171 100644 --- a/examples/normalReflectivity/standardLayers/standardLayersDSPCScript.m +++ b/examples/normalReflectivity/standardLayers/standardLayersDSPCScript.m @@ -1,7 +1,7 @@ % Standard Layers fit of a DSPC floating bilayer % Make the project -problem = createProject(name='original_dspc_bilayer', calcType='non polarised', model='standard layers', geometry='substrate/liquid', absorption=false); +problem = createProject(name='original_dspc_bilayer', calcType='normal', model='standard layers', geometry='substrate/liquid', absorption=false); % Make priors visible.. problem.showPriors = true; diff --git a/examples/normalReflectivity/standardLayers/standardLayersDSPCSheet.mlx b/examples/normalReflectivity/standardLayers/standardLayersDSPCSheet.mlx index 9c1e8f6bc..598488ace 100644 Binary files a/examples/normalReflectivity/standardLayers/standardLayersDSPCSheet.mlx and b/examples/normalReflectivity/standardLayers/standardLayersDSPCSheet.mlx differ diff --git a/targetFunctions/+domainsTF/customLayers.m b/targetFunctions/+domainsTF/customLayers.m index 368f13c27..ee8b8b5a8 100644 --- a/targetFunctions/+domainsTF/customLayers.m +++ b/targetFunctions/+domainsTF/customLayers.m @@ -163,11 +163,11 @@ % Call the core layers calculation - need to do this once for each % domain - [sldProfile1,reflect1,simul1,~,layerSld1,resampledLayer1,~] = nonPolarisedTF.coreLayersCalculation(calcAllLayers1,roughness,... + [sldProfile1,reflect1,simul1,~,layerSld1,resampledLayer1,~] = normalTF.coreLayersCalculation(calcAllLayers1,roughness,... geometry,bulkInValue,bulkOutValue,resample,calcSld,shiftedData,simLimits,repeatLayers,... resolutionParamValue,background,backgroundAction,nParams,parallel,resampleMinAngle,resampleNPoints,useImaginary); - [sldProfile2,reflect2,simul2,shiftedData,layerSld2,resampledLayer2,~] = nonPolarisedTF.coreLayersCalculation(calcAllLayers2,roughness,... + [sldProfile2,reflect2,simul2,shiftedData,layerSld2,resampledLayer2,~] = normalTF.coreLayersCalculation(calcAllLayers2,roughness,... geometry,bulkInValue,bulkOutValue,resample,calcSld,shiftedData,simLimits,repeatLayers,... resolutionParamValue,background,backgroundAction,nParams,parallel,resampleMinAngle,resampleNPoints,useImaginary); diff --git a/targetFunctions/+domainsTF/standardLayers.m b/targetFunctions/+domainsTF/standardLayers.m index 8e899e2b2..48fd5034b 100644 --- a/targetFunctions/+domainsTF/standardLayers.m +++ b/targetFunctions/+domainsTF/standardLayers.m @@ -176,11 +176,11 @@ % Call the core layers calculation - need to do this once for each % domain - [sldProfile1,reflect1,simul1,~,layerSld1,resampledLayer1,~] = nonPolarisedTF.coreLayersCalculation(thisContrastLayers1,roughness,... + [sldProfile1,reflect1,simul1,~,layerSld1,resampledLayer1,~] = normalTF.coreLayersCalculation(thisContrastLayers1,roughness,... geometry,bulkInValue,bulkOutValue,resample,calcSld,shiftedData,simLimits,repeatLayers,... resolutionParamValue,background,backgroundAction,nParams,parallel,resampleMinAngle,resampleNPoints,useImaginary); - [sldProfile2,reflect2,simul2,shiftedData,layerSld2,resampledLayer2,~] = nonPolarisedTF.coreLayersCalculation(thisContrastLayers2,roughness,... + [sldProfile2,reflect2,simul2,shiftedData,layerSld2,resampledLayer2,~] = normalTF.coreLayersCalculation(thisContrastLayers2,roughness,... geometry,bulkInValue,bulkOutValue,resample,calcSld,shiftedData,simLimits,repeatLayers,... resolutionParamValue,background,backgroundAction,nParams,parallel,resampleMinAngle,resampleNPoints,useImaginary); diff --git a/targetFunctions/+nonPolarisedTF/+customLayers/processCustomFunction.m b/targetFunctions/+normalTF/+customLayers/processCustomFunction.m similarity index 100% rename from targetFunctions/+nonPolarisedTF/+customLayers/processCustomFunction.m rename to targetFunctions/+normalTF/+customLayers/processCustomFunction.m diff --git a/targetFunctions/+nonPolarisedTF/+customXY/processCustomFunction.m b/targetFunctions/+normalTF/+customXY/processCustomFunction.m similarity index 100% rename from targetFunctions/+nonPolarisedTF/+customXY/processCustomFunction.m rename to targetFunctions/+normalTF/+customXY/processCustomFunction.m diff --git a/targetFunctions/+nonPolarisedTF/coreLayersCalculation.m b/targetFunctions/+normalTF/coreLayersCalculation.m similarity index 98% rename from targetFunctions/+nonPolarisedTF/coreLayersCalculation.m rename to targetFunctions/+normalTF/coreLayersCalculation.m index 6cbc102e1..dbebdf483 100644 --- a/targetFunctions/+nonPolarisedTF/coreLayersCalculation.m +++ b/targetFunctions/+normalTF/coreLayersCalculation.m @@ -4,7 +4,7 @@ resolution,background,backgroundAction,params,parallelPoints,resampleMinAngle,resampleNPoints,useImaginary) % This is the main reflectivity calculation for all Layers models in the -% non polarised target function. +% normal target function. % % The function first arranges the % roughness' in the correct order according diff --git a/targetFunctions/+nonPolarisedTF/customLayers.m b/targetFunctions/+normalTF/customLayers.m similarity index 94% rename from targetFunctions/+nonPolarisedTF/customLayers.m rename to targetFunctions/+normalTF/customLayers.m index 287316681..dadb1f180 100644 --- a/targetFunctions/+nonPolarisedTF/customLayers.m +++ b/targetFunctions/+normalTF/customLayers.m @@ -1,10 +1,10 @@ function [qzshifts,scalefactors,bulkIns,bulkOuts,... resolutionParams,chis,reflectivity,simulation,shiftedData,backgrounds,layerSlds,... sldProfiles,resampledLayers,subRoughs] = customLayers(problemStruct,problemCells,controls) - % The custom layers, nonPolarisedTF reflectivity calculation. + % The custom layers, normalTF reflectivity calculation. % The function extracts the relevant parameters from the input arrays, % allocates these on a pre-contrast basis, then calls the - % 'coreLayersCalculation' (the core layers nonPolarisedTF calc is + % 'coreLayersCalculation' (the core layers normalTF calc is % shared between multiple calculation types). % Extract individual cell arrays @@ -44,7 +44,7 @@ sldProfiles = cell(numberOfContrasts,1); % Process the custom models - [resampledLayers,subRoughs] = nonPolarisedTF.customLayers.processCustomFunction(contrastBulkInIndices,contrastBulkOutIndices,... + [resampledLayers,subRoughs] = normalTF.customLayers.processCustomFunction(contrastBulkInIndices,contrastBulkOutIndices,... bulkInArray,bulkOutArray,cCustFiles,numberOfContrasts,customFiles,params,useImaginary); if strcmpi(parallel, coderEnums.parallelOptions.Contrasts) @@ -120,7 +120,7 @@ % Call the core layers calculation [sldProfile,reflectivity,simulation,shiftedData,layerSld,resampledLayer,... - chi] = nonPolarisedTF.coreLayersCalculation(layer,roughness,... + chi] = normalTF.coreLayersCalculation(layer,roughness,... geometry,bulkInValue,bulkOutValue,resample,calcSld,shiftedData,simLimits,repeatLayers,... resolutionParamValue,background,backgroundAction,nParams,parallel,resampleMinAngle,resampleNPoints,useImaginary); diff --git a/targetFunctions/+nonPolarisedTF/customXY.m b/targetFunctions/+normalTF/customXY.m similarity index 97% rename from targetFunctions/+nonPolarisedTF/customXY.m rename to targetFunctions/+normalTF/customXY.m index 2ebf6517d..eec61819a 100644 --- a/targetFunctions/+nonPolarisedTF/customXY.m +++ b/targetFunctions/+normalTF/customXY.m @@ -39,7 +39,7 @@ resampledLayers = cell(numberOfContrasts,1); % Process the custom models - [sldProfiles,subRoughs] = nonPolarisedTF.customXY.processCustomFunction(contrastBulkInIndices,contrastBulkOutIndices,... + [sldProfiles,subRoughs] = normalTF.customXY.processCustomFunction(contrastBulkInIndices,contrastBulkOutIndices,... bulkInArray,bulkOutArray,cCustFiles,numberOfContrasts,customFiles,params); if strcmpi(parallel, coderEnums.parallelOptions.Contrasts) diff --git a/targetFunctions/+nonPolarisedTF/standardLayers.m b/targetFunctions/+normalTF/standardLayers.m similarity index 98% rename from targetFunctions/+nonPolarisedTF/standardLayers.m rename to targetFunctions/+normalTF/standardLayers.m index 11e3916c9..a9184c3e3 100644 --- a/targetFunctions/+nonPolarisedTF/standardLayers.m +++ b/targetFunctions/+normalTF/standardLayers.m @@ -133,7 +133,7 @@ % Call the core layers calculation [sldProfile,reflectivity,simulation,shiftedData,layerSld,resampledLayer,... - chi] = nonPolarisedTF.coreLayersCalculation(thisContrastLayers,roughness,... + chi] = normalTF.coreLayersCalculation(thisContrastLayers,roughness,... geometry,bulkInValue,bulkOutValue,resample,calcSld,shiftedData,simLimits,repeatLayers,... resolutionParamValue,background,backgroundAction,nParams,parallel,resampleMinAngle,resampleNPoints,useImaginary); diff --git a/targetFunctions/reflectivityCalculation.m b/targetFunctions/reflectivityCalculation.m index 02e4ad14c..4bbc277cd 100644 --- a/targetFunctions/reflectivityCalculation.m +++ b/targetFunctions/reflectivityCalculation.m @@ -7,13 +7,13 @@ % (i.e. 'Target function' is required, and call the relevant routines. % The types of available target functions are:* % -% * non polarised - The main basic target function type, for non polarised neutrons (or x-rays) with non-absorbing samples. Different model types are specified in sub functions from here. +% * normal - The main basic target function type, for non polarised neutrons (or x-rays) with non-absorbing samples. Different model types are specified in sub functions from here. % -% * oil water - Target function for oil-water samples +% * oil water - Target function for oil-water samples % -% * domains - Target function for samples consisting of domains which are larger than the beam lateral coherence length. +% * domains - Target function for samples consisting of domains which are larger than the beam lateral coherence length. % -% * magnetic - Target function for cases for polarised neutrons with polarisation analysis. +% * magnetic - Target function for cases for polarised neutrons with polarisation analysis. % % Decide which target function we are calling and call the relevant routines @@ -21,7 +21,7 @@ modelType = problemStruct.modelType; switch targetFunction - case coderEnums.calculationTypes.NonPolarised + case coderEnums.calculationTypes.Normal switch lower(modelType) @@ -30,21 +30,21 @@ [qzshifts,scalefactors,bulkIns,bulkOuts,... resolutionParams,chis,reflectivity,simulation,shiftedData,... backgrounds,layerSlds,sldProfiles,resampledLayers,... - subRoughs] = nonPolarisedTF.standardLayers(problemStruct,problemCells,controls); + subRoughs] = normalTF.standardLayers(problemStruct,problemCells,controls); case coderEnums.modelTypes.CustomLayers [qzshifts,scalefactors,bulkIns,bulkOuts,... resolutionParams,chis,reflectivity,simulation,shiftedData,... backgrounds,layerSlds,sldProfiles,resampledLayers,... - subRoughs] = nonPolarisedTF.customLayers(problemStruct,problemCells,controls); + subRoughs] = normalTF.customLayers(problemStruct,problemCells,controls); case coderEnums.modelTypes.CustomXY [qzshifts,scalefactors,bulkIns,bulkOuts,... resolutionParams,chis,reflectivity,simulation,shiftedData,... backgrounds,layerSlds,sldProfiles,resampledLayers,... - subRoughs] = nonPolarisedTF.customXY(problemStruct,problemCells,controls); + subRoughs] = normalTF.customXY(problemStruct,problemCells,controls); otherwise error('The model type "%s" is not supported', modelType); diff --git a/tests/nonPolarisedTFReflectivityCalculation/customLayersInputs.mat b/tests/nonPolarisedTFReflectivityCalculation/customLayersInputs.mat deleted file mode 100644 index 4f84b8782..000000000 Binary files a/tests/nonPolarisedTFReflectivityCalculation/customLayersInputs.mat and /dev/null differ diff --git a/tests/nonPolarisedTFReflectivityCalculation/customLayersOutputs.mat b/tests/nonPolarisedTFReflectivityCalculation/customLayersOutputs.mat deleted file mode 100644 index f28ce6e5f..000000000 Binary files a/tests/nonPolarisedTFReflectivityCalculation/customLayersOutputs.mat and /dev/null differ diff --git a/tests/nonPolarisedTFReflectivityCalculation/customLayersTFParams.mat b/tests/nonPolarisedTFReflectivityCalculation/customLayersTFParams.mat deleted file mode 100644 index d25dd4a58..000000000 Binary files a/tests/nonPolarisedTFReflectivityCalculation/customLayersTFParams.mat and /dev/null differ diff --git a/tests/nonPolarisedTFReflectivityCalculation/customXYInputs.mat b/tests/nonPolarisedTFReflectivityCalculation/customXYInputs.mat deleted file mode 100644 index d4a13ae29..000000000 Binary files a/tests/nonPolarisedTFReflectivityCalculation/customXYInputs.mat and /dev/null differ diff --git a/tests/nonPolarisedTFReflectivityCalculation/customXYOutputs.mat b/tests/nonPolarisedTFReflectivityCalculation/customXYOutputs.mat deleted file mode 100644 index a04df36c2..000000000 Binary files a/tests/nonPolarisedTFReflectivityCalculation/customXYOutputs.mat and /dev/null differ diff --git a/tests/nonPolarisedTFReflectivityCalculation/customXYTFParams.mat b/tests/nonPolarisedTFReflectivityCalculation/customXYTFParams.mat deleted file mode 100644 index def2634b7..000000000 Binary files a/tests/nonPolarisedTFReflectivityCalculation/customXYTFParams.mat and /dev/null differ diff --git a/tests/nonPolarisedTFReflectivityCalculation/standardLayersInputs.mat b/tests/nonPolarisedTFReflectivityCalculation/standardLayersInputs.mat deleted file mode 100644 index 868cc5a6e..000000000 Binary files a/tests/nonPolarisedTFReflectivityCalculation/standardLayersInputs.mat and /dev/null differ diff --git a/tests/nonPolarisedTFReflectivityCalculation/standardLayersOutputs.mat b/tests/nonPolarisedTFReflectivityCalculation/standardLayersOutputs.mat deleted file mode 100644 index 54d8b9e47..000000000 Binary files a/tests/nonPolarisedTFReflectivityCalculation/standardLayersOutputs.mat and /dev/null differ diff --git a/tests/nonPolarisedTFReflectivityCalculation/standardLayersTFParams.mat b/tests/nonPolarisedTFReflectivityCalculation/standardLayersTFParams.mat deleted file mode 100644 index 623fa133a..000000000 Binary files a/tests/nonPolarisedTFReflectivityCalculation/standardLayersTFParams.mat and /dev/null differ diff --git a/tests/nonPolarisedTFReflectivityCalculation/DPPCCustomXY.m b/tests/normalTFReflectivityCalculation/DPPCCustomXY.m similarity index 100% rename from tests/nonPolarisedTFReflectivityCalculation/DPPCCustomXY.m rename to tests/normalTFReflectivityCalculation/DPPCCustomXY.m diff --git a/tests/nonPolarisedTFReflectivityCalculation/DPPCCustomXYScript.m b/tests/normalTFReflectivityCalculation/DPPCCustomXYScript.m similarity index 98% rename from tests/nonPolarisedTFReflectivityCalculation/DPPCCustomXYScript.m rename to tests/normalTFReflectivityCalculation/DPPCCustomXYScript.m index 0c11267a9..80c11021e 100644 --- a/tests/nonPolarisedTFReflectivityCalculation/DPPCCustomXYScript.m +++ b/tests/normalTFReflectivityCalculation/DPPCCustomXYScript.m @@ -34,7 +34,7 @@ %% % Now add the custom file to the project.. -project.addCustomFile('DPPC Model','DPPCCustomXY.m','matlab','tests/nonPolarisedTFReflectivityCalculation/'); +project.addCustomFile('DPPC Model','DPPCCustomXY.m','matlab','tests/normalTFReflectivityCalculation/'); %% diff --git a/tests/nonPolarisedTFReflectivityCalculation/DPPCStandardLayers.m b/tests/normalTFReflectivityCalculation/DPPCStandardLayers.m similarity index 100% rename from tests/nonPolarisedTFReflectivityCalculation/DPPCStandardLayers.m rename to tests/normalTFReflectivityCalculation/DPPCStandardLayers.m diff --git a/tests/nonPolarisedTFReflectivityCalculation/c_PLP0016596.dat b/tests/normalTFReflectivityCalculation/c_PLP0016596.dat similarity index 100% rename from tests/nonPolarisedTFReflectivityCalculation/c_PLP0016596.dat rename to tests/normalTFReflectivityCalculation/c_PLP0016596.dat diff --git a/tests/nonPolarisedTFReflectivityCalculation/c_PLP0016601.dat b/tests/normalTFReflectivityCalculation/c_PLP0016601.dat similarity index 100% rename from tests/nonPolarisedTFReflectivityCalculation/c_PLP0016601.dat rename to tests/normalTFReflectivityCalculation/c_PLP0016601.dat diff --git a/tests/nonPolarisedTFReflectivityCalculation/c_PLP0016607.dat b/tests/normalTFReflectivityCalculation/c_PLP0016607.dat similarity index 100% rename from tests/nonPolarisedTFReflectivityCalculation/c_PLP0016607.dat rename to tests/normalTFReflectivityCalculation/c_PLP0016607.dat diff --git a/tests/nonPolarisedTFReflectivityCalculation/customBilayer.m b/tests/normalTFReflectivityCalculation/customBilayer.m similarity index 100% rename from tests/nonPolarisedTFReflectivityCalculation/customBilayer.m rename to tests/normalTFReflectivityCalculation/customBilayer.m diff --git a/tests/normalTFReflectivityCalculation/customLayersInputs.mat b/tests/normalTFReflectivityCalculation/customLayersInputs.mat new file mode 100644 index 000000000..9ab8c53fc Binary files /dev/null and b/tests/normalTFReflectivityCalculation/customLayersInputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customLayersOutputs.mat b/tests/normalTFReflectivityCalculation/customLayersOutputs.mat new file mode 100644 index 000000000..519fa0f5a Binary files /dev/null and b/tests/normalTFReflectivityCalculation/customLayersOutputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customLayersTFParams.mat b/tests/normalTFReflectivityCalculation/customLayersTFParams.mat new file mode 100644 index 000000000..d85a76a3a Binary files /dev/null and b/tests/normalTFReflectivityCalculation/customLayersTFParams.mat differ diff --git a/tests/normalTFReflectivityCalculation/customXYInputs.mat b/tests/normalTFReflectivityCalculation/customXYInputs.mat new file mode 100644 index 000000000..26d5d0860 Binary files /dev/null and b/tests/normalTFReflectivityCalculation/customXYInputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customXYOutputs.mat b/tests/normalTFReflectivityCalculation/customXYOutputs.mat new file mode 100644 index 000000000..e9195fd56 Binary files /dev/null and b/tests/normalTFReflectivityCalculation/customXYOutputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/customXYTFParams.mat b/tests/normalTFReflectivityCalculation/customXYTFParams.mat new file mode 100644 index 000000000..a0fcf27f4 Binary files /dev/null and b/tests/normalTFReflectivityCalculation/customXYTFParams.mat differ diff --git a/tests/nonPolarisedTFReflectivityCalculation/dppc.mat b/tests/normalTFReflectivityCalculation/dppc.mat similarity index 100% rename from tests/nonPolarisedTFReflectivityCalculation/dppc.mat rename to tests/normalTFReflectivityCalculation/dppc.mat diff --git a/tests/nonPolarisedTFReflectivityCalculation/makeInputsAndOutputs.m b/tests/normalTFReflectivityCalculation/makeInputsAndOutputs.m similarity index 83% rename from tests/nonPolarisedTFReflectivityCalculation/makeInputsAndOutputs.m rename to tests/normalTFReflectivityCalculation/makeInputsAndOutputs.m index 148462d44..f0251d778 100644 --- a/tests/nonPolarisedTFReflectivityCalculation/makeInputsAndOutputs.m +++ b/tests/normalTFReflectivityCalculation/makeInputsAndOutputs.m @@ -21,7 +21,7 @@ inputs.controlsInput = controlsInput; inputs.controls = controls; -save([root filesep 'tests/nonPolarisedTFReflectivityCalculation/customLayersInputs'],'inputs'); +save([root filesep 'tests/normalTFReflectivityCalculation/customLayersInputs'],'inputs'); % (b) Outputs resultStruct = reflectivityCalculation(problemStruct,problemCells,problemLimits,controls); @@ -39,12 +39,12 @@ outputs.project = project; outputs.result = result; -save([root filesep 'tests/nonPolarisedTFReflectivityCalculation/customLayersOutputs'],'outputs'); +save([root filesep 'tests/normalTFReflectivityCalculation/customLayersOutputs'],'outputs'); % (c) TF Parameters [qzshifts,scalefactors,bulkIn,bulkOut,resolutionParams,... chis,reflectivity,simulation,shiftedData,backgrounds,layerSlds,sldProfiles,... - resampledLayers,subRoughs] = nonPolarisedTF.customLayers(problemStruct,problemCells,controls); + resampledLayers,subRoughs] = normalTF.customLayers(problemStruct,problemCells,controls); TFParams.qzshifts = qzshifts; TFParams.scalefactors = scalefactors; @@ -62,7 +62,7 @@ TFParams.sldProfiles = sldProfiles; TFParams.resampledLayers = resampledLayers; -save([root filesep 'tests/nonPolarisedTFReflectivityCalculation/customLayersTFParams'],'TFParams'); +save([root filesep 'tests/normalTFReflectivityCalculation/customLayersTFParams'],'TFParams'); %% 2. Custom XY. % (a) Inputs @@ -82,7 +82,7 @@ inputs.controlsInput = controlsInput; inputs.controls = controls; -save([root filesep 'tests/nonPolarisedTFReflectivityCalculation/customXYInputs'],'inputs'); +save([root filesep 'tests/normalTFReflectivityCalculation/customXYInputs'],'inputs'); % (b) Outputs resultStruct = reflectivityCalculation(problemStruct,problemCells,problemLimits,controls); @@ -100,12 +100,12 @@ outputs.project = project; outputs.result = result; -save([root filesep 'tests/nonPolarisedTFReflectivityCalculation/customXYOutputs'],'outputs'); +save([root filesep 'tests/normalTFReflectivityCalculation/customXYOutputs'],'outputs'); % (c) TF Parameters [qzshifts,scalefactors,bulkIn,bulkOut,resolutionParams,... chis,reflectivity,simulation,shiftedData,backgrounds,layerSlds,sldProfiles,... - resampledLayers, subRoughs] = nonPolarisedTF.customXY(problemStruct,problemCells,controls); + resampledLayers, subRoughs] = normalTF.customXY(problemStruct,problemCells,controls); TFParams.qzshifts = qzshifts; TFParams.scalefactors = scalefactors; @@ -123,7 +123,7 @@ TFParams.sldProfiles = sldProfiles; TFParams.resampledLayers = resampledLayers; -save([root filesep 'tests/nonPolarisedTFReflectivityCalculation/customXYTFParams'],'TFParams'); +save([root filesep 'tests/normalTFReflectivityCalculation/customXYTFParams'],'TFParams'); %% 3. Standard Layers % (a) Inputs @@ -144,7 +144,7 @@ inputs.controlsInput = controlsInput; inputs.controls = controls; -save([root filesep 'tests/nonPolarisedTFReflectivityCalculation/standardLayersInputs'],'inputs'); +save([root filesep 'tests/normalTFReflectivityCalculation/standardLayersInputs'],'inputs'); % (b) Outputs resultStruct = reflectivityCalculation(problemStruct,problemCells,problemLimits,controls); @@ -162,12 +162,12 @@ outputs.project = project; outputs.result = result; -save([root filesep 'tests/nonPolarisedTFReflectivityCalculation/standardLayersOutputs'],'outputs'); +save([root filesep 'tests/normalTFReflectivityCalculation/standardLayersOutputs'],'outputs'); % (c) TF Parameters [qzshifts,scalefactors,bulkIn,bulkOut,resolutionParams,... chis,reflectivity,simulation,shiftedData,backgrounds,layerSlds,sldProfiles,... - resampledLayers,subRoughs] = nonPolarisedTF.standardLayers(problemStruct,problemCells,controls); + resampledLayers,subRoughs] = normalTF.standardLayers(problemStruct,problemCells,controls); TFParams.qzshifts = qzshifts; TFParams.scalefactors = scalefactors; @@ -185,7 +185,7 @@ TFParams.sldProfiles = sldProfiles; TFParams.resampledLayers = resampledLayers; -save([root filesep 'tests/nonPolarisedTFReflectivityCalculation/standardLayersTFParams'],'TFParams'); +save([root filesep 'tests/normalTFReflectivityCalculation/standardLayersTFParams'],'TFParams'); %% 4. Converting between RAT and RASCAL diff --git a/tests/nonPolarisedTFReflectivityCalculation/orsoDSPCCustomLayers.m b/tests/normalTFReflectivityCalculation/orsoDSPCCustomLayers.m similarity index 98% rename from tests/nonPolarisedTFReflectivityCalculation/orsoDSPCCustomLayers.m rename to tests/normalTFReflectivityCalculation/orsoDSPCCustomLayers.m index 6def13bdb..387f07539 100644 --- a/tests/nonPolarisedTFReflectivityCalculation/orsoDSPCCustomLayers.m +++ b/tests/normalTFReflectivityCalculation/orsoDSPCCustomLayers.m @@ -71,7 +71,7 @@ % % Add the custom file to the project.... -project.addCustomFile('DSPC Model','customBilayer.m','matlab','tests/nonPolarisedTFReflectivityCalculation/'); +project.addCustomFile('DSPC Model','customBilayer.m','matlab','tests/normalTFReflectivityCalculation/'); %% % % diff --git a/tests/normalTFReflectivityCalculation/standardLayersInputs.mat b/tests/normalTFReflectivityCalculation/standardLayersInputs.mat new file mode 100644 index 000000000..33cc5c486 Binary files /dev/null and b/tests/normalTFReflectivityCalculation/standardLayersInputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/standardLayersOutputs.mat b/tests/normalTFReflectivityCalculation/standardLayersOutputs.mat new file mode 100644 index 000000000..833399d03 Binary files /dev/null and b/tests/normalTFReflectivityCalculation/standardLayersOutputs.mat differ diff --git a/tests/normalTFReflectivityCalculation/standardLayersTFParams.mat b/tests/normalTFReflectivityCalculation/standardLayersTFParams.mat new file mode 100644 index 000000000..891949179 Binary files /dev/null and b/tests/normalTFReflectivityCalculation/standardLayersTFParams.mat differ diff --git a/tests/nonPolarisedTFReflectivityCalculation/testReflectivityCalculations.m b/tests/normalTFReflectivityCalculation/testReflectivityCalculations.m similarity index 97% rename from tests/nonPolarisedTFReflectivityCalculation/testReflectivityCalculations.m rename to tests/normalTFReflectivityCalculation/testReflectivityCalculations.m index b7bc98013..2a5f20148 100644 --- a/tests/nonPolarisedTFReflectivityCalculation/testReflectivityCalculations.m +++ b/tests/normalTFReflectivityCalculation/testReflectivityCalculations.m @@ -3,7 +3,7 @@ % testReflectivityCalculations Class based unit tests for RAT API, the % reflectivity calculation and pre- and post-processing routines. % -% We are using the test cases for a non-polarised TF reflectivity +% We are using the test cases for a normal TF reflectivity % calculation to test the routines. We consider standard layers, custom % layers and custom XY examples. For the reflectivity calculation itself, % we consider the serial and parallel versions (both points and contrasts), @@ -62,7 +62,7 @@ methods (TestClassSetup, ParameterCombination='sequential') function addDataPath(testCase) import matlab.unittest.fixtures.PathFixture - path = fullfile(getappdata(0, 'root'), 'tests', 'nonPolarisedTFReflectivityCalculation'); + path = fullfile(getappdata(0, 'root'), 'tests', 'normalTFReflectivityCalculation'); testCase.applyFixture(PathFixture(path)) end @@ -170,7 +170,7 @@ function testReflectivityCalculation(testCase, whichParallel, useCompiled) testCase.verifyEqual(result, testCase.expectedResultStruct, 'RelTol', testCase.tolerance, 'AbsTol', testCase.absTolerance); end - function testNonPolarisedTFReflectivityCalculation(testCase, whichParallel, TFFile) + function testNormalTFReflectivityCalculation(testCase, whichParallel, TFFile) testCase.controls.parallel = whichParallel; @@ -179,17 +179,17 @@ function testNonPolarisedTFReflectivityCalculation(testCase, whichParallel, TFFi case 'standardLayersTFParams.mat' [qzshifts,scalefactors,bulkIn,bulkOut,resolutionParams,chis,reflectivity,... simulation,shiftedData,backgrounds,layerSLDs,SLDProfiles,resampledLayers,... - subRoughs] = nonPolarisedTF.standardLayers(testCase.problemStruct,testCase.problemCells,... + subRoughs] = normalTF.standardLayers(testCase.problemStruct,testCase.problemCells,... testCase.controls); case 'customLayersTFParams.mat' [qzshifts,scalefactors,bulkIn,bulkOut,resolutionParams,chis,reflectivity,... simulation,shiftedData,backgrounds,layerSLDs,SLDProfiles,resampledLayers,... - subRoughs] = nonPolarisedTF.customLayers(testCase.problemStruct,testCase.problemCells,... + subRoughs] = normalTF.customLayers(testCase.problemStruct,testCase.problemCells,... testCase.controls); case 'customXYTFParams.mat' [qzshifts,scalefactors,bulkIn,bulkOut,resolutionParams,chis,reflectivity,... simulation,shiftedData,backgrounds,layerSLDs,SLDProfiles,resampledLayers,... - subRoughs] = nonPolarisedTF.customXY(testCase.problemStruct,testCase.problemCells,... + subRoughs] = normalTF.customXY(testCase.problemStruct,testCase.problemCells,... testCase.controls); end diff --git a/tests/testContrastsClass.m b/tests/testContrastsClass.m index 1974b6ffc..4aba9b211 100644 --- a/tests/testContrastsClass.m +++ b/tests/testContrastsClass.m @@ -78,7 +78,7 @@ methods (TestClassSetup) function readClassData(testCase) import matlab.unittest.fixtures.PathFixture - path = fullfile(getappdata(0, 'root'), 'tests', 'nonPolarisedTFReflectivityCalculation'); + path = fullfile(getappdata(0, 'root'), 'tests', 'normalTFReflectivityCalculation'); testCase.applyFixture(PathFixture(path)) % Read in the data used in the example calculation diff --git a/tests/testCreateProject.m b/tests/testCreateProject.m index 02ea9d3a6..4a62ca87b 100644 --- a/tests/testCreateProject.m +++ b/tests/testCreateProject.m @@ -9,8 +9,8 @@ calculationType = {calculationTypes.Domains, ... calculationTypes.Magnetic, ... calculationTypes.MagneticDomains, ... - calculationTypes.NonPolarised, ... - calculationTypes.NonPolarised, ... + calculationTypes.Normal, ... + calculationTypes.Normal, ... calculationTypes.OilWater ... } SLDValues = {{'SLD'}, ... diff --git a/tests/testCustomFileClass.m b/tests/testCustomFileClass.m index 0083d8003..ce001110e 100644 --- a/tests/testCustomFileClass.m +++ b/tests/testCustomFileClass.m @@ -27,8 +27,8 @@ {2, 'language', supportedLanguages.Python, 'filename', 'model.m', 'functionName', 'modelFunc', 'name', 'New Model', 'path', pwd},... } expectedRow = {["New Model", "DPPCCustomXY.m", "DPPCCustomXY", string(supportedLanguages.Matlab.value), "../../"],... - ["DPPC Model", "model.m", "model", string(supportedLanguages.Matlab.value), "tests/nonPolarisedTFReflectivityCalculation/"],... - ["DSPC Model", "customBilayer.m", "customBilayer", string(supportedLanguages.Python.value), "tests/nonPolarisedTFReflectivityCalculation/"],... + ["DPPC Model", "model.m", "model", string(supportedLanguages.Matlab.value), "tests/normalTFReflectivityCalculation/"],... + ["DSPC Model", "customBilayer.m", "customBilayer", string(supportedLanguages.Python.value), "tests/normalTFReflectivityCalculation/"],... ["New Model", "model.m", "modelFunc", string(supportedLanguages.Python.value), pwd],... } invalidInputData = {{'DPPC Model', 'name', 42},... @@ -52,7 +52,7 @@ methods (TestClassSetup) function addDataPath(testCase) import matlab.unittest.fixtures.PathFixture - path = fullfile(getappdata(0, 'root'), 'tests', 'nonPolarisedTFReflectivityCalculation'); + path = fullfile(getappdata(0, 'root'), 'tests', 'normalTFReflectivityCalculation'); testCase.applyFixture(PathFixture(path)) end @@ -77,8 +77,8 @@ function initialiseCustomFileClass(testCase) % "DPPCCustomXY.m" and "orsoDSPCCustomLayers.m" testCase.exampleClass = customFileClass(); - testCase.exampleClass.varTable(1,:) = {'DPPC Model', 'DPPCCustomXY.m', 'DPPCCustomXY', 'matlab', 'tests/nonPolarisedTFReflectivityCalculation/'}; - testCase.exampleClass.varTable(2,:) = {'DSPC Model', 'customBilayer.m', 'customBilayer', 'matlab', 'tests/nonPolarisedTFReflectivityCalculation/'}; + testCase.exampleClass.varTable(1,:) = {'DPPC Model', 'DPPCCustomXY.m', 'DPPCCustomXY', 'matlab', 'tests/normalTFReflectivityCalculation/'}; + testCase.exampleClass.varTable(2,:) = {'DSPC Model', 'customBilayer.m', 'customBilayer', 'matlab', 'tests/normalTFReflectivityCalculation/'}; testCase.numRows = height(testCase.exampleClass.varTable); testCase.numCols = width(testCase.exampleClass.varTable); diff --git a/tests/testDomainsClass.m b/tests/testDomainsClass.m index 659b3cb8e..b9f8409f6 100644 --- a/tests/testDomainsClass.m +++ b/tests/testDomainsClass.m @@ -91,13 +91,13 @@ function testConversion(testCase) testCase.verifyEqual(testCase.project.calculationType, calculationTypes.Domains.value, 'Calculation Type not set correctly'); testCase.verifyTrue(testCase.project.contrasts.domainsCalc, 'Calculation Type not set correctly') - nonPolarised = testCase.project.toProjectClass(); - testCase.verifyClass(nonPolarised, 'projectClass') - testCase.verifyEqual(nonPolarised.experimentName, testCase.project.experimentName, 'Experiment name not copied correctly'); - testCase.verifyEqual(nonPolarised.calculationType, calculationTypes.NonPolarised.value, 'Calculation Type not set correctly'); - testCase.verifyFalse(nonPolarised.contrasts.domainsCalc, 'Calculation Type not set correctly') - testCase.verifyEqual(nonPolarised.parameters, testCase.project.parameters, 'Parameters not copied correctly'); - testCase.verifyEqual(nonPolarised.layers, testCase.project.layers, 'Layers not copied correctly'); + normal = testCase.project.toProjectClass(); + testCase.verifyClass(normal, 'projectClass') + testCase.verifyEqual(normal.experimentName, testCase.project.experimentName, 'Experiment name not copied correctly'); + testCase.verifyEqual(normal.calculationType, calculationTypes.Normal.value, 'Calculation Type not set correctly'); + testCase.verifyFalse(normal.contrasts.domainsCalc, 'Calculation Type not set correctly') + testCase.verifyEqual(normal.parameters, testCase.project.parameters, 'Parameters not copied correctly'); + testCase.verifyEqual(normal.layers, testCase.project.layers, 'Layers not copied correctly'); end function testModelType(testCase) diff --git a/tests/testProjectClass.m b/tests/testProjectClass.m index dcbccb2c4..597b1cece 100644 --- a/tests/testProjectClass.m +++ b/tests/testProjectClass.m @@ -82,10 +82,10 @@ function testCreation(testCase) % Tests project class can be created and the experiment name is set correctly newProject = projectClass(); testCase.verifyEqual(newProject.experimentName, '', 'Experiment name not set correctly'); - testCase.verifyEqual(newProject.calculationType, calculationTypes.NonPolarised.value, 'Calculation Type not set correctly'); + testCase.verifyEqual(newProject.calculationType, calculationTypes.Normal.value, 'Calculation Type not set correctly'); newProject = projectClass('New experiment'); testCase.verifyEqual(newProject.experimentName, 'New experiment', 'Experiment name not set correctly'); - testCase.verifyEqual(newProject.calculationType, calculationTypes.NonPolarised.value, 'Calculation Type not set correctly'); + testCase.verifyEqual(newProject.calculationType, calculationTypes.Normal.value, 'Calculation Type not set correctly'); testCase.verifyError(@() projectClass(1), 'MATLAB:validators:mustBeTextScalar') end @@ -107,7 +107,7 @@ function testConversion(testCase) % Tests project class can be converted to domains class and % the properties are copied over testCase.verifyClass(testCase.project, 'projectClass') - testCase.verifyEqual(testCase.project.calculationType, calculationTypes.NonPolarised.value, 'Calculation Type not set correctly'); + testCase.verifyEqual(testCase.project.calculationType, calculationTypes.Normal.value, 'Calculation Type not set correctly'); testCase.verifyFalse(testCase.project.contrasts.domainsCalc, 'Calculation Type not set correctly') domains = testCase.project.toDomainsClass(); @@ -293,7 +293,7 @@ function testLayers(testCase) function testLayersExceptions(testCase) % Ensure layers are not defined for a custom model, % and the routines modifying the layers raise an error - customProject = projectClass('custom project', calculationTypes.NonPolarised, modelTypes.CustomLayers); + customProject = projectClass('custom project', calculationTypes.Normal, modelTypes.CustomLayers); testCase.verifyEmpty(customProject.layers); testCase.verifyError(@() customProject.addLayerGroup({{'New Layer'}, {'Another Layer'}}), exceptions.invalidProperty.errorID) testCase.verifyError(@() customProject.addLayer('New Layer'), exceptions.invalidProperty.errorID) @@ -557,7 +557,7 @@ function testToStruct(testCase) projectStruct = testCase.project.toStruct(); testCase.verifyEqual(projectStruct.experimentName, testCase.project.experimentName, 'toStruct method not working'); testCase.verifyEqual(projectStruct.geometry, testCase.project.geometry, 'toStruct method not working'); - testCase.verifyEqual(projectStruct.TF, calculationTypes.NonPolarised.value, 'toStruct method not working'); + testCase.verifyEqual(projectStruct.TF, calculationTypes.Normal.value, 'toStruct method not working'); testCase.verifyEqual(projectStruct.paramNames, {'Substrate Roughness'}, 'toStruct method not working'); testCase.verifyEqual(projectStruct.backgroundNames, testCase.project.background.backgrounds.varTable{:, 1}, 'toStruct method not working'); testCase.verifyEqual(projectStruct.backgroundTypes, testCase.project.background.backgrounds.varTable{:, 2}, 'toStruct method not working'); diff --git a/tests/testProjectConversion/DSPCBilayerProjectClass.mat b/tests/testProjectConversion/DSPCBilayerProjectClass.mat index 4d0112a96..5efe2020c 100644 Binary files a/tests/testProjectConversion/DSPCBilayerProjectClass.mat and b/tests/testProjectConversion/DSPCBilayerProjectClass.mat differ diff --git a/tests/testProjectConversion/eventDemo.m b/tests/testProjectConversion/eventDemo.m new file mode 100644 index 000000000..fca886457 --- /dev/null +++ b/tests/testProjectConversion/eventDemo.m @@ -0,0 +1,20 @@ +%% Non-Domain Event example + +problem = load('DSPCBilayerProjectClass.mat').thisProjectClass; + +% Make a controls block +controls = controlsClass(); +controls.parallel = parallelOptions.Points; +controls.procedure = procedures.Simplex; +controls.maxIterations = 1000; + +%figure(2); clf +% eventManager.register(eventTypes.Plot, 'plotRefSLDHelper') +% eventManager.register(eventTypes.Message, 'disp') +useLivePlot(2) +controls.calcSldDuringFit = true; +[problem1, result1] = RAT(problem, controls); + +% plotRefSLD(problem1, result1); + +eventManager.clear() \ No newline at end of file diff --git a/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat b/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat index 6fc398a81..065daba4d 100644 Binary files a/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat and b/tests/testProjectConversion/monolayerVolumeModelProjectClass.mat differ