Home > atmlab > tests > verify_colloc_constants.m

verify_colloc_constants

PURPOSE ^

verify_colloc_constants Check colloc_constants for consistency

SYNOPSIS ^

function verify_colloc_constants

DESCRIPTION ^

 verify_colloc_constants Check colloc_constants for consistency

 colloc_constants defines columns more or less twice, for historical
 reasons. Once in .overlap/.data/.meandata, and once in .stored.
 This m-file checks that they are consistent.

 There is no input and nothing is returned, but all 'missing' entries are
 printed to stdout. A human (such as Gerrit) should then interpret whether
 this is okay.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

verify_colloc_constants.m

SOURCE CODE ^

0001 function verify_colloc_constants
0002 
0003 % verify_colloc_constants Check colloc_constants for consistency
0004 %
0005 % colloc_constants defines columns more or less twice, for historical
0006 % reasons. Once in .overlap/.data/.meandata, and once in .stored.
0007 % This m-file checks that they are consistent.
0008 %
0009 % There is no input and nothing is returned, but all 'missing' entries are
0010 % printed to stdout. A human (such as Gerrit) should then interpret whether
0011 % this is okay.
0012 
0013 % Gerrit Holl 2011-06-14
0014 %
0015 % $Id: verify_colloc_constants.m 7017 2011-06-14 16:13:46Z gerrit $
0016 
0017 % those names are allowed to be missing in .stored
0018 special_names = {'filter_double', 'NCOLS'};
0019 
0020 constants = colloc_constants();
0021 allnames = fieldnames(constants);
0022 for f = allnames.'
0023     fn = f{1};
0024     if strcmp(fn(1:4), 'cols')
0025         cols = constants.(fn);
0026         stored_names = fieldnames(cols.stored).';
0027         internal_names = [fieldnames(cols.overlap).' fieldnames(cols.data).'];
0028         if isfield(cols, 'meandata')
0029             internal_names = [internal_names fieldnames(cols.meandata).'];
0030         end
0031         % verify all internal names are also in stored names
0032         for intrn = internal_names
0033             if ~(ismember(intrn{1}, stored_names) || ...
0034                  ismember(intrn{1}, special_names))
0035                 logtext(1, 'internal but not stored: %s, %s\n', fn, intrn{1});
0036             end
0037         end
0038         for strd = stored_names
0039             if ~(ismember(strd{1}, internal_names))
0040                 logtext(1, 'stored but not internal: %s, %s\n', fn, strd{1});
0041             end
0042         end
0043     end
0044 end
0045 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005