Utilities#

utilities.misc.projectClassToR1(project, varargin)#

Converts projectClass instance to RasCAL1 (r1) struct. Also creates the datafiles directory and saves the data if asked. The functions takes in a projectClass instance and other optional arguments then outputs r1 struct.

Example Usage:

r1Struct = projectClassToR1(project, 'saveProject', false);
Parameters:
  • project (projectClass) – An instance of the projectClass to convert to r1.

  • varargin

    Keyword/value pair to configure conversion, the following are allowed
    • r1Problem (struct, default: defaultR1ProjectTemplate) a r1 struct which will be updated with equivalent projectClass values.

    • dirName (string or char array, default: ‘newDirectory’) directory where the files are saved.

    • dirPath (string or char array, default: pwd) path where the new directory is created.

    • saveProject (logical, default: false) indicates if files are saved to filesystem.

    • fileName (string or char array, default: newFile appended with current timestamp): The filename of the resulting r1 struct.

Returns:

newR1Problem – r1 struct which should be equivalent to the given RAT projectClass instance.

Return type:

struct

utilities.misc.r1ToProjectClass(r1Problem)#

Converts RasCAL1 (r1) struct to an equivalent projectClass instance. The function takes the path of the r1 struct .mat file.

Example Usage:

project = r1ToProjectClass('DSPCBilayerStructInput.mat');  % Load from current directory
project = r1ToProjectClass('examples/DSPCBilayerStructInput.mat');  % Load from the example subdirectory
Parameters:

r1Problem (string or char array) – The path of a mat file that contains a RasCAL1 struct.

Returns:

project – An instance of the projectClass which should be equivalent to the given R1 problem.

Return type:

projectClass