Functions | |
BaseDirectory * | newBaseDirectory (char *directoryName) |
char ** | constructOutputFilenames (BaseDirectory *baseDir, const char *UniqueFilename, int muStep, int sigmaStep, int NAlpha) |
void | addParmsToFilename (BaseDirectory *baseName, int value1, int value2, BOOLEAN debug) |
void | addParmsToFilename2 (BaseDirectory *baseName, int *values, int nValues, BOOLEAN debug) |
char ** | finishFilenamesWExt (BaseDirectory *baseDir, const char *UniqueFilename, int NAlpha, BOOLEAN compress, BOOLEAN debug, const char *extension) |
char ** | finishFilenames (BaseDirectory *baseDir, const char *UniqueFilename, int NAlpha, BOOLEAN compress, BOOLEAN debug) |
char * | finishFilename (BaseDirectory *baseName, const char *UniqueFilename, BOOLEAN compress, BOOLEAN debug) |
char ** | constructBFilenames (BaseDirectory *baseDir, const char *UniqueFilename, int nVectors) |
char ** | constructDTildaFilenames (const BaseDirectory *baseDir, const char *UniqueFilename, int nFiles, int *fnameLength) |
char ** | constructAvgCovFilenames (const BaseDirectory *baseDir, const char *UniqueFilename, int nFiles, int nAvgKernels, int nVectors, int *fnameLength) |
void | freeNFilenames (char **filenames, int nFiles, int fnameLength) |
Variables | |
char * | BaseDirectory::Name |
Character string containing the base output directory. Will always end with a directory separator. Is changed and reused. | |
int | BaseDirectory::dirLength |
length of base dir name; start writing parameters at this point. Changes to match Name; | |
int | BaseDirectory::debugLength |
end of debug base file name. | |
int | BaseDirectory::baseLength |
end of base file name. | |
int | BaseDirectory::maxLength |
number of chars allocated for dirName, any filename cannot exceed this value. Cannot change this value once set. | |
char * | BaseDirectory::filenameBank [MAX_ALPHA] |
bank of strings for constructing output filenames. |
BaseDirectory operations reuse BaseDirectory.Name character string. Offsets are maintained into this string of the base output directory and the end of the base output filename.
void addParmsToFilename | ( | BaseDirectory * | baseName, | |
int | value1, | |||
int | value2, | |||
BOOLEAN | debug | |||
) |
Add two parameters to the ouptut filename. Usually, they are the input parameters (mu and sigma). Since most output files contain the input parameter steps, the output filename kept in a BaseDirectory object holds the information. Value1 and value2 are appended to base name. Base name = <baseName>value1_value2_ This function is also used to add debug parameters to the intermediate matrix filename.
[in,out] | baseName | BaseDirectory object already initialized with base directory information. |
[in] | value1 | value for first parameter. |
[in] | value2 | value for second parameter. |
[in] | debug | True if running with debug option; false otherwise. If debug, then we are adding the x and y components of the wave number to the output filename. |
void addParmsToFilename2 | ( | BaseDirectory * | baseName, | |
int * | values, | |||
int | nValues, | |||
BOOLEAN | debug | |||
) |
Add a variable number of parameters to the ouptut filename. Usually, they are the input parameters (mu and sigma). Since most output files contain the input parameter steps, the output filename kept in a BaseDirectory object holds the information. Value1 and value2 are appended to base name. Base name = <baseName>value1_value2_ This function is also used to add debug parameters to the intermediate matrix filename.
[in,out] | baseName | BaseDirectory object already initialized with base directory information. |
[in] | values | List of values for parameters. |
[in] | nValues | Number of parameters. |
[in] | debug | True if running with debug option; false otherwise. If debug, then we are adding the x and y components of the wave number to the output filename. |
char** constructAvgCovFilenames | ( | const BaseDirectory * | baseDir, | |
const char * | UniqueFilename, | |||
int | nFiles, | |||
int | nAvgKernels, | |||
int | nVectors, | |||
int * | fnameLength | |||
) |
Construct list of filenames for averaging kernel or covariance matrices for RLS 3d. They have a special format: <parm1Step>_<parm2Step>_<matrix name>_<depth>_<vector><vector>.fits <vector><vector> is xx, xy, xz, yx, yy, etc. and is only for RLS 3D vector problems. <Matrix><N>.fits where N is an integer. Notice, there is no underscore between Matrix name and N. Always compress the output files.
[in] | baseDir | BaseDirectory structure containing output base directory information. |
[in] | UniqueFilename | Matrix name |
[in] | nFiles | number of filenames |
[in] | nAvgKernels | number of averaging kernels |
[in] | nVectors | number of vectors, usually 1 or 3. |
[in,out] | fnameLength | length of each filename; keep and use when freeing the filenames. |
char** constructBFilenames | ( | BaseDirectory * | baseDir, | |
const char * | UniqueFilename, | |||
int | nVectors | |||
) |
no underscore <Matrix><suffix> where suffix is 'v_x', 'v_y', or 'v_z' if RLS 3D Vector problem.
[in] | baseDir | BaseDirectory structure containing output base directory information. |
[in] | UniqueFilename | Matrix name |
[in] | nVectors | Number of vectors in problem, usually 1 for RLS 1D and 3D scalar; 3 for RLS 3D vector. |
char** constructDTildaFilenames | ( | const BaseDirectory * | baseDir, | |
const char * | UniqueFilename, | |||
int | nFiles, | |||
int * | fnameLength | |||
) |
Construct list of filenames with this format <Matrix><N>.fits where N is an integer. Notice, there is no underscore between Matrix name and N. Always compress the output files.
[in] | baseDir | BaseDirectory structure containing output base directory information. |
[in] | UniqueFilename | Matrix name |
[in] | nFiles | number of filenames |
[in,out] | fnameLength | length of each filename; used when freeing the filenames |
char** constructOutputFilenames | ( | BaseDirectory * | baseDir, | |
const char * | UniqueFilename, | |||
int | muStep, | |||
int | sigmaStep, | |||
int | NAlpha | |||
) |
Construct a complete file name, assuming no previous strings other than base directory. Use this when X and Y, in pattern basedir/X_Y_M_A.fits, have different meaning than mu and sigma steps. Note: UniqueFilename must be base name, like T, q, etc. No extension.
[in,out] | baseDir | BaseDirectory object already initialized with base directory information. |
[in] | UniqueFilename | Name of output matrix (M); UniqueFilename must be base name, like T, q, etc. No extension. |
[in] | muStep | Value used as X in pattern; integer indicating the nth-value of mu parameter. |
[in] | sigmaStep | Value used as Y in pattern; integer indicating the nth-value of sigma parameter. |
[in] | NAlpha | The number of scatterers. If 3d_vector problem, this value can be greater than one. For 3d_scalar and 2d, this value is always 1; |
char* finishFilename | ( | BaseDirectory * | baseName, | |
const char * | UniqueFilename, | |||
BOOLEAN | compress, | |||
BOOLEAN | debug | |||
) |
Add the matrix name to construct a single output file.
[in] | baseName | BaseDirectory structure containing output base directory information. |
[in] | UniqueFilename | Matrix name |
[in] | compress | True if output file should be compressed using gzip. |
[in] | debug | True if using debug file naming convention. |
char** finishFilenames | ( | BaseDirectory * | baseDir, | |
const char * | UniqueFilename, | |||
int | NAlpha, | |||
BOOLEAN | compress, | |||
BOOLEAN | debug | |||
) |
Insert the matrix name plus any alpha values Assumes the mu and sigma parameters are already inserted.
[in] | baseDir | BaseDirectory structure containing output base directory information. |
[in] | UniqueFilename | Matrix name. |
[in] | NAlpha | number of alpha parameters, usually three. |
[in] | compress | True if output file should be compressed using gzip. |
[in] | debug | True if using debug file naming convention. |
char** finishFilenamesWExt | ( | BaseDirectory * | baseDir, | |
const char * | UniqueFilename, | |||
int | NAlpha, | |||
BOOLEAN | compress, | |||
BOOLEAN | debug, | |||
const char * | extension | |||
) |
Insert the matrix name plus any alpha values Assumes the mu and sigma parameters are already inserted.
[in] | baseDir | BaseDirectory structure containing output base directory information. |
[in] | UniqueFilename | Matrix name. |
[in] | NAlpha | number of alpha parameters, usually three. |
[in] | compress | True if output file should be compressed using gzip. |
[in] | debug | True if using debug file naming convention. |
[in] | extension | File name extension. |
void freeNFilenames | ( | char ** | filenames, | |
int | nFiles, | |||
int | fnameLength | |||
) |
Free list of filenames dynamically allocated (i.e. not those from file bank).
[in] | filenames | Pointer to array of filenames |
[in] | nFiles | number of filenames |
[in] | fnameLength | maximum length of each filename |
BaseDirectory* newBaseDirectory | ( | char * | directoryName | ) |
Set the base directory for all output files.
[in] | directoryName | Output base directory. |
int BaseDirectory::baseLength [inherited] |
end of base file name.
int BaseDirectory::debugLength [inherited] |
end of debug base file name.
int BaseDirectory::dirLength [inherited] |
length of base dir name; start writing parameters at this point. Changes to match Name;
char* BaseDirectory::filenameBank[MAX_ALPHA] [inherited] |
bank of strings for constructing output filenames.
int BaseDirectory::maxLength [inherited] |
number of chars allocated for dirName, any filename cannot exceed this value. Cannot change this value once set.
char* BaseDirectory::Name [inherited] |
Character string containing the base output directory. Will always end with a directory separator. Is changed and reused.