0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 function varargout = repo_test_func(varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 % DESCRIPTION: REPO_TEST_FUNC Tests the submit and retrieve of LTPDA objs in
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 % a LTPDA database, measuring the submit/retrieve time.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 % CALL: s = repo_test_func(pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 % INPUTS: pl - parameter list(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 % OUTPUTS: s - an array of plists containing the results of the test.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 % If the submission/retrieve is not performed, most of
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 % the keys will be empty
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 % In detail, each plist will contain:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 % OUTPUT PARAMETER LIST:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 % <key> <description>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 % ret_time_xml - time for retrieval of data from xml (s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 % ret_time_bin - time for retrieval of data from binary (s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 % sub_time - time for submission (s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 % t - absolute time of test execution
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 % test_ID - test identifier, also repeated in saved file
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 % status - result of comparison between submitted and retrieved objs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 % OBJids - submitted objs IDs assigned by database
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 % cid - submitted objs collection ID assigned by database
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 % start_time - beginning time of test execution
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 % stop_time - ending time of test execution
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 % obj_filesize - size on disk of the xml and binary versions of every object
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 % sinfo - a struct with infos about the connection
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 % INPUT PARAMETER LIST:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 % <key> <default value> <description>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 % 'RAND_N_OBJ' false produces a random number of objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 % at a time
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 % 'N_OBJ' 1 produces N_OBJ objects at a time.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 % Inserting <= 0 will produce random
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 % number of objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 % 'RAND_OBJ_TYPE' false produces a random object from ltpda_uo class
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 % 'OBJ_TYPE' 'ao' defines the object(s) to produce
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 % If empty or 'RAND', it will pick at random within
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 % the ltpda_uo class
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43 % 'RAND_AO' true Picks at random the parameters for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 % the AO(s) to produce and submit
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45 % 'AO_PARAMS' plist plist to build the AO(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 % 'RAND_PLIST' true Picks at random the parameters for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47 % the plist(s) to produce and submit
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
48 % 'PLIST_PARAMS' plist plist to build the plist(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
49 % 'RAND_MFIR' true Picks at random the parameters for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
50 % the mfir(s) to produce and submit
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
51 % 'MFIR_PARAMS' plist plist to build the mfir(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
52 % 'RAND_MIIR' true Picks at random the parameters for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
53 % the miir(s) to produce and submit
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
54 % 'MIIR_PARAMS' plist plist to build the miir(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
55 % 'RAND_PZMODEL' true Picks at random the parameters for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
56 % the pzmodel(s) to produce and submit
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
57 % 'PZMODEL_PARAMS' plist plist to build the pzmodel(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58 % 'RAND_TIMESPAN' true Picks at random the parameters for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59 % the timespan object(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60 % 'TIMESPAN_PARAMS' plist plist to build the timespan(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61 % 'RAND_SSM' true Picks at random the parameters for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62 % the ssm(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 % 'SSM_PARAMS' plist plist to build the ssm(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64 % 'RAND_PARFRAC' true Picks at random the parameters for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65 % the parfrac object(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66 % 'PARFRAC_PARAMS' plist plist to build the parfrac(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67 % 'RAND_RATIONAL' true Picks at random the parameters for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68 % the rational object(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69 % 'RATIONAL_PARAMS' plist plist to build the rational(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71 % 'HOSTNAME' '130.75.117.67' the repository host IP (for individual tests)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72 % 'DBASE' 'ltpda_test' the database name (for individual tests)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73 % 'COLL_RETRIEVE' false retrieves via the submitted collection ID
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74 % 'SAVE_OBJS' false saves the produced objs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75 % 'OBJ_FILENAME' 'submit_trial_obj' filename to save the produced
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76 % obj(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77 % 'OBJ_FILEFORMAT' 'xml' format for the filename to save the produced
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78 % obj(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79 % 'DIR' '/Users/MH/exper_data/test/obj_creation'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80 % path to save the produced obj(s) into
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81 % 'SUBMIT' false actually performs the submit/retrieve test
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82 % 'CONN' empty a conn struct if the connection was
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83 % already open (for group tests)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84 % 'SAVE_RESULTS' true saves the individual test results
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85 % 'RESULTS_FILENAME' 'repo_test' filename to save results in
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86 % 'OBJ_FILESIZE' true calculate sizes (in bytes) of all objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88 % VERSION: $Id: repo_test_func.m,v 1.6 2009/03/25 17:39:01 nicola Exp $
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90 % HISTORY: 05-12-2008 M Hueller
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91 % Creation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93 % M-FILE INFO: Get information about this methods by calling
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94 % >> ao.getInfo('repo_test_func')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96 % Get information about a specified set-plist by calling:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97 % >> ao.getInfo('repo_test_func', 'None')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99 % SEE ALSO: run_UTN_repo_test
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101 % SEE: <a href="matlab: help ao/Contents;">HELP: All Analysis Object Functions:</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102 % <a href="matlab: helpwin ao/Contents;">DOC: All Analysis Object Functions:</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
105
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
106 % global obj_size_xml obj_size_bin
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
107
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
108 %% Check if this is a call for parameters
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
109 if utils.helper.isinfocall(varargin{:})
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
110 varargout{1} = getInfo(varargin{3});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
111 return
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
112 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
113
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
114 % Collect input variable names
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
115 in_names = cell(size(varargin));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
116 for ii = 1:nargin
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
117 in_names{ii} = inputname(ii);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
118 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
119
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
120 % Collect all plists
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
121 pls = utils.helper.collect_objects(varargin(:), 'plist', in_names);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
122
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
123 %% ---------------- Produce one plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
124 if isa(pls, 'plist')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
125 pls = combine(pls, getDefaultPlist());
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
126 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
127 pls = getDefaultPlist();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
128 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
129
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
130 import utils.const.*;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
131
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
132 %% ---------------- Initial settings
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
133
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
134 % Checks if running on PC
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
135 if ispc
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
136 path_symbol = '\';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
137 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
138 path_symbol = '/';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
139 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
140
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
141 % Verify if the user wants only to produce objects or also test repository
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
142 if find(pls, 'SUBMIT')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
143 % Collects the conn struct.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
144 conn = find(pls, 'CONN');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
145 % If empty, goes ahead and looks for the repository IP and database, and
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
146 % opens the connection
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
147 if isempty(conn)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
148
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
149 % Get the hostname
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
150 hostname = find(pls, 'HOSTNAME');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
151
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
152 % Get the database name
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
153 database_name = find(pls, 'DBASE');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
154
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
155 % Opens the connection
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
156 conn = utils.mysql.connect(hostname, database_name);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
157 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
158 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
159 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
160 ' ','Submission switched off, only producing the objects ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
161 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
162
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
163 if ~find(pls, 'SAVE_OBJS')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
164 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
165 ' ','Saving switched off, only displaying the objects ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
166 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
167
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
168 %% Builds the trial objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
169
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
170 % Limiting the number of objects in the case of random number to
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
171 % something reasonable
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
172 N_MAX_OBJS = 100;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
173
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
174 % Limiting the number of poles and zeros in the case of random extraction to
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
175 % something reasonable
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
176 N_MAX_POLES = 100;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
177 N_MAX_ZEROS = 100;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
178
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
179 % Limitng the number of values for cdata and xydata to something
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
180 % reasonable
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
181 N_MAX_VALS = 1000;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
182
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
183 % Number of objects to be created
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
184 N_OBJ = find(pls, 'N_OBJ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
185
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
186 if N_OBJ < 1 || find(pls, 'RAND_N_OBJ')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
187 % Pick a random rumber between 1 and N_MAX_OBJS
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
188 N_OBJ = utils.math.randelement(N_MAX_OBJS, 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
189 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
190
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
191 % Finds the kind of objects requested by user
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
192 user_class_list = utils.helper.ltpda_userclasses;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
193
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
194 obj_type = find(pls, 'OBJ_TYPE');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
195 rand_obj_type = true;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
196 % Go for random value in the case of:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
197 % invalid or empty class name, or explicitely asked random
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
198 if ~isempty(obj_type) && ~strcmpi(obj_type, 'RAND') && ~find(pls, 'RAND_OBJ_TYPE')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
199 % Checks if user entered a user class name
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
200 for kk = 1:length(user_class_list)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
201 if strcmpi(user_class_list{kk}, obj_type)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
202 rand_obj_type = false;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
203 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
204 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
205 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
206
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
207 % Prepares the empty cell array for the object(s) and the plist(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
208 objs = cell(N_OBJ, 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
209 pl_objs = cell(N_OBJ, 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
210
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
211 % Main loop over the number of requested objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
212 for kk = 1:N_OBJ
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
213 if rand_obj_type
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
214 % Picks up at random one user class name
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
215 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
216 ' ',['User input class ' upper(obj_type) ' not used, go for random class']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
217 index = utils.math.randelement(length(user_class_list),1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
218 obj_type = user_class_list{index};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
219 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
220
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
221 % Test ID based on time elapsed since a reference time
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
222 ref_time = time('2008-01-01 00:00:00');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
223 test_ID = floor(time - ref_time);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
224
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
225 % For the time being SSM are disabled:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
226 if strcmp(obj_type,'ssm'), obj_type = 'ao'; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
227
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
228
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
229 switch obj_type
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
230 case 'ao'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
231 ao_params = find(pls, 'AO_PARAMS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
232 if isempty(ao_params) || ~ao_params.nparams || find(pls, 'RAND_AO');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
233 % The plist to build the object is built by picking at random from
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
234 % a "menu" list, based on
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
235 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
236 ' ',['Object from class ' upper(obj_type) ' built from random parameters']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
237 pl_obj = plist();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
238 p_menu = provide_menu('ao');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
239
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
240 % Extract at random a type of data
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
241 dtype = lower(cell2mat(utils.math.randelement(find(p_menu, 'dtype'), 1)));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
242 p_menu_sub = find(p_menu, dtype);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
243
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
244 switch lower(dtype)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
245 case 'tsdata'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
246 pl_obj = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
247 'waveform', cell2mat(utils.math.randelement(find(p_menu_sub, 'waveform'), 1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
248 'fs', utils.math.randelement(find(p_menu_sub,'fs'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
249 'nsecs', utils.math.randelement(find(p_menu_sub,'nsecs'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
250 'name', cell2mat(utils.math.randelement(find(p_menu_sub,'name'), 1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
251 'yunits', unit(cell2mat(utils.math.randelement(find(p_menu_sub, 'yunits'), 1))) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
252 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
253 switch find(pl_obj, 'waveform')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
254 case 'sine wave'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
255 n_freqs = utils.math.randelement(3,1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
256 pl_obj.combine(pl_obj, plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
257 'A', utils.math.randelement(find(p_menu_sub,'A'), n_freqs), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
258 'f', utils.math.randelement(find(p_menu_sub,'f'), n_freqs), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
259 'phi', utils.math.randelement(find(p_menu_sub,'phi'), n_freqs), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
260 'toff', utils.math.randelement(find(p_menu_sub,'toff'), n_freqs) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
261 ));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
262 case 'noise'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
263 pl_obj.combine(pl_obj, plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
264 'type', cell2mat(utils.math.randelement(find(p_menu_sub, 'type'), 1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
265 'sigma', utils.math.randelement(find(p_menu_sub,'sigma'), 1) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
266 ));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
267 case 'chirp'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
268 pl_obj.combine(pl_obj, plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
269 'f0', utils.math.randelement(find(p_menu_sub,'f0'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
270 'f1', utils.math.randelement(find(p_menu_sub,'f1'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
271 't1', utils.math.randelement(find(p_menu_sub,'t1'), 1) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
272 ));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
273 case 'gaussian pulse'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
274 pl_obj.combine(pl_obj, plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
275 'f0', utils.math.randelement(find(p_menu_sub,'f0'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
276 'bw', utils.math.randelement(find(p_menu_sub,'bw'), 1) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
277 ));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
278 case 'square wave'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
279 pl_obj.combine(pl_obj, plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
280 'f', utils.math.randelement(find(p_menu_sub,'f'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
281 'duty', utils.math.randelement(find(p_menu_sub,'duty'), 1) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
282 ));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
283 case 'sawtooth'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
284 pl_obj.combine(pl_obj, plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
285 'f', utils.math.randelement(find(p_menu_sub,'f'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
286 'width', utils.math.randelement(find(p_menu_sub,'width'), 1) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
287 ));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
288 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
289
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
290 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
291
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
292 case 'fsdata'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
293 pl_obj = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
294 'fsfcn', cell2mat(utils.math.randelement(find(p_menu_sub, 'fsfcn'), 1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
295 'name', cell2mat(utils.math.randelement(find(p_menu_sub,'name'), 1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
296 'yunits', unit(cell2mat(utils.math.randelement(find(p_menu_sub, 'yunits'), 1))) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
297 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
298
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
299 switch cell2mat(utils.math.randelement(find(p_menu_sub, 'f_mode'), 1))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
300 case 'build'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
301 pl_obj.combine(pl_obj, plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
302 'f1', utils.math.randelement(find(p_menu_sub, 'f1'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
303 'f2', utils.math.randelement(find(p_menu_sub, 'f2'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
304 'nf', utils.math.randelement(find(p_menu_sub, 'nf'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
305 'scale', cell2mat(utils.math.randelement(find(p_menu_sub, 'scale'), 1)) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
306 ));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
307 case 'list'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
308 f = find(p_menu_sub, 'f');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
309 pl_obj.combine(pl_obj, plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
310 'f', logspace(f(1), f(2), 1e3) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
311 ));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
312 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
313
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
314 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
315
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
316 case 'cdata'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
317 vals = find(p_menu_sub,'vals');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
318 nvals = utils.math.randelement(N_MAX_VALS, 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
319 pl_obj = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
320 'vals', vals(1) + (vals(2) - vals(1))*rand(nvals, 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
321 'name', cell2mat(utils.math.randelement(find(p_menu_sub,'name'), 1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
322 'yunits', unit(cell2mat(utils.math.randelement(find(p_menu_sub, 'yunits'), 1))) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
323 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
324
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
325 case 'xydata'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
326 xvals = find(p_menu_sub,'xvals');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
327 yvals = find(p_menu_sub,'yvals');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
328 nvals = utils.math.randelement(N_MAX_VALS, 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
329 pl_obj = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
330 'xvals', xvals(1) + (xvals(2) - xvals(1))*rand(nvals, 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
331 'yvals', yvals(1) + (yvals(2) - yvals(1))*rand(nvals, 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
332 'name', cell2mat(utils.math.randelement(find(p_menu_sub,'name'), 1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
333 'xunits', unit(cell2mat(utils.math.randelement(find(p_menu_sub, 'xunits'), 1))), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
334 'yunits', unit(cell2mat(utils.math.randelement(find(p_menu_sub, 'yunits'), 1))) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
335 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
336
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
337 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
338
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
339 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
340 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
341 % The plist to build the object is the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
342 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
343 ' ',['Object from class ' upper(obj_type) ' built from input plist']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
344 pl_obj = ao_params;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
345 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
346
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
347 % Builds the trial object, adding the test ID to the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
348 obj = ao(pl_obj.append('test_ID', test_ID));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
349
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
350 % Adds the trial object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
351 objs{kk} = obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
352
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
353 % Adds the plist for this object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
354 pl_objs{kk} = pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
355
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
356
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
357 case 'plist'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
358 plist_params = find(pls, 'PLIST_PARAMS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
359 if isempty(plist_params) || ~plist_params.nparams || find(pls, 'RAND_PLIST');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
360 % The plist to build the object is built by picking at random from
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
361 % a "menu" list, based on random 'key' and 'values' fields
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
362 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
363 ' ',['Object from class ' upper(obj_type) ' built from random parameters']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
364 pl_obj = plist();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
365 p_menu = provide_menu('plist');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
366 n_params = utils.math.randelement(p_menu.nparams, 1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
367 for jj = 1:n_params
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
368 pl_obj.append(['Key' num2str(jj)], p_menu.params(utils.math.randelement(n_params, 1)).val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
369 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
370 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
371 % The plist to build the object is the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
372 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
373 ' ',['Object from class ' upper(obj_type) ' built from input plist']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
374 pl_obj = plist_params;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
375 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
376
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
377 % Builds the trial object, adding the test ID to the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
378 obj = plist(pl_obj.append('test_ID', test_ID));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
379
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
380 % Adds the trial object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
381 objs{kk} = obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
382
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
383 % Adds the plist for this object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
384 pl_objs{kk} = pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
385
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
386 % Saves some memory
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
387 clear obj pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
388
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
389 case 'mfir'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
390 mfir_params = find(pls, 'MFIR_PARAMS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
391 if isempty(mfir_params) || ~mfir_params.nparams || find(pls, 'RAND_MFIR');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
392 % The plist to build the object is built by picking at random from
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
393 % values in a "menu" list, based on the parameters 'From Standard Type'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
394
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
395 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
396 ' ',['Object from class ' upper(obj_type) ' built from random parameters']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
397 p_menu = provide_menu('mfir');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
398
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
399 pl_obj = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
400 'type', cell2mat(utils.math.randelement(find(p_menu, 'type'), 1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
401 'order', utils.math.randelement(find(p_menu, 'order'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
402 'gain', utils.math.randelement(find(p_menu, 'gain'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
403 'fs', utils.math.randelement(find(p_menu, 'fs'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
404 'fc', [1.0 1.2].*utils.math.randelement(find(p_menu, 'fc'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
405 'iunits', unit(cell2mat(utils.math.randelement(find(p_menu, 'iunits'), 1))), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
406 'ounits', unit(cell2mat(utils.math.randelement(find(p_menu, 'ounits'), 1))) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
407 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
408 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
409 % The plist to build the object is the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
410 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
411 ' ',['Object from class ' upper(obj_type) ' built from input plist']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
412 pl_obj = mfir_params;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
413 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
414
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
415 % Builds the trial object, adding the test ID to the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
416 obj = mfir(pl_obj.append('test_ID', test_ID));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
417
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
418 % Adds the trial object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
419 objs{kk} = obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
420
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
421 % Adds the plist for this object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
422 pl_objs{kk} = pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
423
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
424 % Saves some memory
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
425 clear obj pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
426
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
427 case 'miir'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
428 miir_params = find(pls, 'MIIR_PARAMS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
429 if isempty(miir_params) || ~miir_params.nparams || find(pls, 'RAND_MIIR');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
430 % The plist to build the object is built by picking at random from
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
431 % values in a "menu" list, based on the parameters 'From Standard Type'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
432
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
433 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
434 ' ',['Object from class ' upper(obj_type) ' built from random parameters']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
435 p_menu = provide_menu('miir');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
436
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
437 pl_obj = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
438 'type', cell2mat(utils.math.randelement(find(p_menu, 'type'), 1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
439 'order', utils.math.randelement(find(p_menu, 'order'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
440 'gain', utils.math.randelement(find(p_menu, 'gain'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
441 'fs', utils.math.randelement(find(p_menu, 'fs'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
442 'fc', [1.0 1.2].*utils.math.randelement(find(p_menu, 'fc'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
443 'iunits', unit(cell2mat(utils.math.randelement(find(p_menu, 'iunits'), 1))), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
444 'ounits', unit(cell2mat(utils.math.randelement(find(p_menu, 'ounits'), 1))) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
445 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
446 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
447 % The plist to build the object is the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
448 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
449 ' ',['Object from class ' upper(obj_type) ' built from input plist']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
450 pl_obj = miir_params;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
451 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
452
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
453 % Builds the trial object, adding the test ID to the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
454 obj = miir(pl_obj.append('test_ID', test_ID));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
455
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
456 % Adds the trial object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
457 objs{kk} = obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
458
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
459 % Adds the plist for this object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
460 pl_objs{kk} = pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
461
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
462 % Saves some memory
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
463 clear obj pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
464
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
465 case 'pzmodel'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
466
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
467 pzmodel_params = find(pls, 'pzmodel_PARAMS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
468 if isempty(pzmodel_params) || ~pzmodel_params.nparams || find(pls, 'RAND_pzmodel');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
469 % The plist to build the object is built by picking at random from
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
470 % values in a "menu" list, from the 'From Poles/Zeros'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
471 % constructor
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
472
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
473 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
474 ' ',['Object from class ' upper(obj_type) ' built from random parameters']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
475 p_menu = provide_menu('pzmodel');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
476
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
477 v_poles = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
478 v_zeros = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
479
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
480 freq = find(p_menu, 'freq');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
481 Q = find(p_menu, 'Q');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
482 for jj = 1:utils.math.randelement(N_MAX_POLES, 1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
483 v_poles = [v_poles pz(utils.math.randelement(freq, 1), utils.math.randelement(Q, 1))];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
484 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
485 for jj = 1:utils.math.randelement(N_MAX_ZEROS, 1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
486 v_zeros = [v_zeros pz(utils.math.randelement(freq, 1), utils.math.randelement(Q, 1))];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
487 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
488
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
489 pl_obj = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
490 'gain', utils.math.randelement(find(p_menu, 'gain'), 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
491 'poles', v_poles, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
492 'zeros', v_zeros, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
493 'name', cell2mat(utils.math.randelement(find(p_menu, 'name'), 1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
494 'iunits', unit(cell2mat(utils.math.randelement(find(p_menu, 'iunits'), 1))), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
495 'ounits', unit(cell2mat(utils.math.randelement(find(p_menu, 'ounits'), 1))) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
496 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
497 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
498 % The plist to build the object is the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
499 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
500 ' ',['Object from class ' upper(obj_type) ' built from input plist']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
501 pl_obj = pzmodel_params;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
502 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
503
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
504 % Builds the trial object, adding the test ID to the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
505 obj = pzmodel(pl_obj.append('test_ID', test_ID));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
506
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
507 % Adds the trial object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
508 objs{kk} = obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
509
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
510 % Adds the plist for this object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
511 pl_objs{kk} = pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
512
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
513 % Saves some memory
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
514 clear obj pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
515
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
516 case 'timespan'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
517 timespan_params = find(pls, 'TIMESPAN_PARAMS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
518 if isempty(timespan_params) || ~timespan_params.nparams || find(pls, 'RAND_TIMESPAN');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
519 % The plist to build the object is built by picking at random from
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
520 % values in a "menu" list, based on the parameters needed to
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
521 % build it from definition
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
522
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
523 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
524 ' ',['Object from class ' upper(obj_type) ' built from random parameters']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
525 p_menu = provide_menu('timespan');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
526
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
527 t = time;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
528 pl_obj = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
529 'startT', t.utc_epoch_milli, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
530 'endT', t.utc_epoch_milli + randi(t.utc_epoch_milli + 1e12, 1), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
531 'timezone', cell2mat(utils.math.randelement(find(p_menu, 'timezone'), 1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
532 'timeformat', cell2mat(utils.math.randelement(find(p_menu, 'timeformat'), 1)) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
533 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
534 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
535 % The plist to build the object is the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
536 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
537 ' ',['Object from class ' upper(obj_type) ' built from input plist']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
538 pl_obj = timespan_params;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
539 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
540
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
541 % Builds the trial object, adding the test ID to the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
542 obj = timespan(pl_obj.append('test_ID', test_ID));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
543
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
544 % Adds the trial object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
545 objs{kk} = obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
546
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
547 % Adds the plist for this object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
548 pl_objs{kk} = pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
549
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
550 % Saves some memory
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
551 clear obj pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
552
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
553 case 'ssm'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
554 ssm_params = find(pls, 'SSM_PARAMS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
555 if isempty(ssm_params) || ~ssm_params.nparams || find(pls, 'RAND_SSM');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
556 % The plist to build the object is built by picking at random from
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
557 % values in a "menu" list, based on built-in models that can be
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
558 % constructed without the Control System Toolbox
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
559
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
560 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
561 ' ',['Object from class ' upper(obj_type) ' built from random parameters']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
562 p_menu = provide_menu('ssm');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
563
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
564 pl_obj = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
565 'built-in', cell2mat(utils.math.randelement(find(p_menu, 'model_list'), 1)) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
566 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
567 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
568 % The plist to build the object is the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
569 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
570 ' ',['Object from class ' upper(obj_type) ' built from input plist']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
571 pl_obj = ssm_params;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
572 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
573
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
574 % Builds the trial object, adding the test ID to the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
575 obj = ssm(pl_obj.append('test_ID', test_ID));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
576
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
577 % Adds the trial object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
578 objs{kk} = obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
579
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
580 % Adds the plist for this object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
581 pl_objs{kk} = pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
582
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
583 % Saves some memory
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
584 clear obj pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
585
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
586 case 'parfrac'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
587 parfrac_params = find(pls, 'PARFRAC_PARAMS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
588 if isempty(parfrac_params) || ~parfrac_params.nparams || find(pls, 'RAND_PARFRAC');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
589 % The plist to build the object is built by picking at random from
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
590 % values in a "menu" list, based on the parameters 'From Standard Type'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
591 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
592 ' ',['Object from class ' upper(obj_type) ' built from random parameters']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
593
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
594 p_menu = provide_menu('parfrac');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
595 num_poles = utils.math.randelement([3:10],1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
596 pl_obj = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
597 'res', utils.math.randelement(find(p_menu, 'res'), num_poles), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
598 'poles', utils.math.randelement(find(p_menu, 'poles'), num_poles), ... % this extracts num_poles pz objs from a vector of pz objs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
599 'dir', find(p_menu, 'dir'), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
600 'iunits', unit(cell2mat(utils.math.randelement(find(p_menu, 'iunits'), 1))), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
601 'ounits', unit(cell2mat(utils.math.randelement(find(p_menu, 'ounits'), 1))) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
602 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
603 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
604 % The plist to build the object is the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
605 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
606 ' ',['Object from class ' upper(obj_type) ' built from input plist']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
607 pl_obj = parfrac_params;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
608 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
609 obj = parfrac(pl_obj.append('test_ID', test_ID));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
610
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
611 % Adds the trial object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
612 objs{kk} = obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
613 % Adds the plist for this object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
614 pl_objs{kk} = pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
615 % Saves some memory
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
616 clear obj pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
617
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
618 case 'rational'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
619 rational_params = find(pls, 'RATIONAL_PARAMS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
620 if isempty(rational_params) || ~rational_params.nparams || find(pls, 'RAND_RATIONAL');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
621 % The plist to build the object is built by picking at random from
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
622 % values in a "menu" list, based on the parameters 'From Standard Type'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
623 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
624 ' ',['Object from class ' upper(obj_type) ' built from random parameters']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
625
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
626 p_menu = provide_menu('rational');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
627 pl_obj = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
628 'num', utils.math.randelement(find(p_menu, 'num'), utils.math.randelement(10,1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
629 'den', utils.math.randelement(find(p_menu, 'den'), utils.math.randelement(10,1)), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
630 'iunits', unit(cell2mat(utils.math.randelement(find(p_menu, 'iunits'), 1))), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
631 'ounits', unit(cell2mat(utils.math.randelement(find(p_menu, 'ounits'), 1))) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
632 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
633 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
634 % The plist to build the object is the input plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
635 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
636 ' ',['Object from class ' upper(obj_type) ' built from input plist']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
637 pl_obj = rational_params;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
638 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
639 obj = rational(pl_obj.append('test_ID', test_ID));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
640
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
641 % Adds the trial object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
642 objs{kk} = obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
643 % Adds the plist for this object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
644 pl_objs{kk} = pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
645 % Saves some memory
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
646 clear obj pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
647 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
648 utils.helper.msg(msg.MNAME, '%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
649 ' ',['Object from class ' upper(obj_type) ' not available already, using AO instead']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
650
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
651 % Go ahead with a simple tsdata AO
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
652 p_menu = provide_menu('unsupported');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
653 obj = prepare_simple_ao(p_menu.append('test_ID', test_ID));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
654
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
655 % Adds the trial object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
656 objs{kk} = obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
657
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
658 % Adds the plist for this object to the cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
659 pl_objs{kk} = pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
660
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
661 % Saves some memory
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
662 clear obj pl_obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
663 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
664 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
665
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
666 %% Saves on disk the data objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
667 if find(pls,'save_objs')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
668 obj_save_path = find(pls, 'dir');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
669 obj_filename = find(pls, 'obj_filename');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
670 obj_fileformat = find(pls, 'obj_fileformat');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
671
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
672 for kk = 1:length(objs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
673 obj = objs{kk};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
674 w = whos('obj');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
675 path_string = sprintf('%s%s%s_%s_%d_%04d.%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
676 obj_save_path, path_symbol, obj_filename ,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
677 w.class, test_ID, kk, obj_fileformat);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
678
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
679 save(obj, path_string);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
680 % obj_size = dir(path_string);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
681 % if strcmpi(obj_fileformat,'xml')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
682 % obj_size_xml(kk) = obj_size.bytes;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
683 % obj_size_bin(kk) = zeros(size(objs));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
684 % else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
685 % obj_size_xml(kk) = zeros(size(objs));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
686 % obj_size_bin(kk) = obj_size.bytes;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
687 % end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
688 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
689 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
690 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
691 % To be updated with a proper new function to measure the filesize %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
692 % when the objects are not saved %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
693 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
694 % obj_size_xml = zeros(size(objs));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
695 % obj_size_bin = zeros(size(objs));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
696 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
697
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
698 if find(pls, 'FILESIZE')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
699 clear objs_filesize
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
700 objs_filesize{1,1} = 'XML';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
701 objs_filesize{1,2} = 'BIN';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
702 % The function must return the size (in bytes) of the objects generated
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
703 for kk = 1:length(objs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
704 obj = objs{kk};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
705
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
706 % Retrieve the XML filesize
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
707 xml = com.mathworks.xml.XMLUtils.createDocument('obj');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
708 parent = xml.getDocumentElement;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
709 utils.helper.xmlwrite(obj, xml, parent, '');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
710 otxt = xmlwrite(xml);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
711 xml_size = whos('otxt');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
712 objs_filesize{kk+1,1} = xml_size.bytes;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
713
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
714 % Retrive the BIN filesize
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
715 obj = utils.prog.rstruct(obj);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
716 bin_size = whos('obj');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
717 objs_filesize{kk+1,2} = bin_size.bytes;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
718
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
719 clear obj xml parent otxt xml_size bin_size
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
720 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
721 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
722
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
723
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
724
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
725 %% Executes the submit/retrieve test
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
726 if find(pls, 'SUBMIT')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
727
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
728 start_time = now;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
729
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
730 utils.helper.msg(msg.MNAME, '\n%s\n%s%d%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
731 ' ', '*===== Test ', test_ID, ' =========', ' ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
732
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
733 % Submission and retrieval
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
734 results = submitretrieve(conn, objs, test_ID, find(pls, 'coll_retrieve'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
735
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
736 % Includes time for start and stop in serial form
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
737 stop_time = now;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
738 results.append('start_time', datestr(start_time,'HH:MM:SS.FFF'), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
739 'stop_time', datestr(stop_time,'HH:MM:SS.FFF'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
740
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
741 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
742 results = plist;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
743 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
744
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
745
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
746 %% Final report
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
747
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
748 % Includes the plists for the creation of the objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
749 results.append('pl_objs', pl_objs );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
750
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
751 % Includes the plist input by the user, combined with default
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
752 results.append('pl_used', pls );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
753
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
754 if find(pls, 'FILESIZE')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
755 % Includes the size of the objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
756 results.append('objs_filesize', objs_filesize);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
757 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
758
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
759
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
760 if find(pls, 'save_results')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
761 % Saves the test results
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
762 save(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
763 [find(pls, 'dir') path_symbol find(pls, 'results_filename') '_' num2str(test_ID) '.mat'], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
764 'results');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
765 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
766
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
767 varargout{1} = results;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
768
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
769
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
770 %% Closes connection if stand-alone run
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
771 if ~isempty(find(pls, 'conn'))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
772 % Close connection
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
773 close(conn);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
774 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
775 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
776
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
777 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
778 % Provides the "menu" lists where to pick from
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
779 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
780 function out_list = provide_menu(obj)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
781 switch lower(obj)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
782 case 'ao'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
783 t = time;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
784 out_list = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
785 'dtype', {'tsdata', 'fsdata', 'cdata', 'xydata'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
786 'tsdata', plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
787 'waveform', {...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
788 'sine-wave', 'chirp', 'noise', 'Gaussian pulse', 'Square wave', 'Sawtooth'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
789 'fs', [0.1:0.1:10], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
790 'nsecs', logspace(1,6,1000), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
791 't0', t, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
792 'A', linspace(-10,10,1001), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
793 'f', logspace(-1,-4,100), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
794 'phi', linspace(-2*pi,2*pi,21), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
795 'toff', linspace(0,1e4,101), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
796 'type', {'Normal', 'Uniform'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
797 'sigma', linspace(0,10,101), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
798 'f0', logspace(-2,1,100), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
799 'f1', logspace(1,3,100), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
800 't1', logspace(1,3,100), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
801 'bw', linspace(0,1,101), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
802 'duty', linspace(0,100,101), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
803 'width', linspace(0,1,101), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
804 'name', {'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
805 'yunits', unit.supportedUnits ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
806 ), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
807 'fsdata', plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
808 'fsfcn',{'f','1./f', '5./(f.^4) + 2./(f.^2) + 1 + f.^4', 'sinc(f)'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
809 'f_mode', {'build', 'list'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
810 'f1', logspace(-5,-3,100), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
811 'f2', logspace(-3,1,100), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
812 'nf', logspace(1,5,100), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
813 'scale',{'log','lin'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
814 'f', [-6 1], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
815 'name', {'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
816 'yunits', unit.supportedUnits ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
817 ), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
818 'cdata', plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
819 'vals', [-1e5 1e5], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
820 'name', {'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
821 'yunits', unit.supportedUnits), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
822 'xydata', plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
823 'xvals', [-1e5 1e5], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
824 'yvals', [-1e5 1e5], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
825 'name', {'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
826 'xunits', unit.supportedUnits, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
827 'yunits', unit.supportedUnits) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
828 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
829
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
830 case 'plist'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
831 out_list = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
832 'Parameter_01', 1, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
833 'Parameter_02', '2', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
834 'Parameter_03', pi, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
835 'Parameter_04', [1:10]', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
836 'Parameter_05', 'This is really not important', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
837 'Parameter_06', -1/sqrt(2), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
838 'Parameter_07', [1:10]', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
839 'Parameter_08', 0, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
840 'Parameter_09', 1./sqrt(2*pi).*exp(-10:0.1:10), ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
841 'Parameter_10', [] ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
842 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
843
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
844 case 'mfir'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
845 out_list = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
846 'type', {'highpass', 'lowpass', 'bandpass', 'bandreject'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
847 'order', [2:2:100], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
848 'gain', [1:1:1000], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
849 'fs', [0.1:0.1:10], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
850 'fc', [0.01:0.01:0.1], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
851 'iunits', unit.supportedUnits, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
852 'ounits', unit.supportedUnits ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
853 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
854
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
855 case 'miir'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
856 out_list = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
857 'type', {'highpass', 'lowpass', 'bandpass', 'bandreject'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
858 'order', [1:20], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
859 'gain', [1:1:1000], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
860 'fs', [0.1:0.1:10], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
861 'fc', [0.01:0.01:0.1], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
862 'ripple', [0.5:0.5:2], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
863 'iunits', unit.supportedUnits, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
864 'ounits', unit.supportedUnits ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
865 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
866
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
867 case 'pzmodel'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
868 freq = [0.01:0.01:1];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
869 Q = [NaN(1,21) logspace(0,3,21)];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
870
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
871 out_list = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
872 'gain', [1:1:1000], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
873 'freq', freq, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
874 'Q', Q, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
875 'name', {'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
876 'iunits', unit.supportedUnits, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
877 'ounits', unit.supportedUnits ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
878 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
879
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
880 case 'ssm'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
881 model_list = {
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
882 'IS_readout_xcpl', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
883 'Interferometer_readout', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
884 'Interferometer_readout_xcpl', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
885 'LPF_Dynamics', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
886 'MPS', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
887 'NSF_IS_readout', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
888 'NSF_Interferometer_readout', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
889 'NSF_MPS', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
890 'NSF_ST_readout', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
891 'NSF_TM', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
892 'NSF_TMActuation', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
893 'NSF_TM_SC', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
894 'NSF_infrared', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
895 'NSF_solar', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
896 'ST_readout', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
897 'TMActuation_xcpl', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
898 'delay', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
899 'delay_IS_readout', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
900 'delay_Ifo_readout', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
901 'delay_ST_readout' ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
902 };
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
903
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
904 out_list = plist('model_list', model_list);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
905
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
906 case 'timespan'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
907 t = time;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
908 out_list = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
909 'timezone', t.getTimezones, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
910 'timeformat', {'yyyy-mm-dd HH:MM:SS.FFF', 'HH:MM:SS', 'yyyy-mm-dd HH:MM:SS'} ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
911 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
912
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
913 case 'parfrac'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
914 out_list = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
915 'res', randn(1,100).^3,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
916 'poles', -randn(1,100).^2,... % all <0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
917 'dir', utils.math.randelement([0:3],1),...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
918 'iunits', unit.supportedUnits, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
919 'ounits', unit.supportedUnits ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
920 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
921
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
922 case 'rational'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
923 out_list = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
924 'num', randn(1,100).*utils.math.randelement([-10:10],100),...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
925 'den', randn(1,100).*utils.math.randelement([-10:10],100),...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
926 'iunits', unit.supportedUnits, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
927 'ounits', unit.supportedUnits ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
928 ); %#ok<*NBRAK>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
929
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
930 case 'unsupported'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
931 % In case of class not supported yet by the repository, the function
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
932 % will provide a plist to create a fixed AO instead.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
933 out_list = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
934 'nsecs', 1000, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
935 'fs', 10, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
936 'noise_type', 'Normal', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
937 'f_m', 0.01, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
938 'phi', 0 ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
939 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
940
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
941 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
942 error('Unknown class name ''[%s]'' provided', obj)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
943 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
944
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
945 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
946
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
947 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
948 % Provides simple AOs with tsdata
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
949 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
950
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
951 function ao_out = prepare_simple_ao(pls)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
952 % Makes the trial object(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
953 nsecs = find(pls, 'NSECS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
954 fs = find(pls, 'FS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
955 f_m = find(pls, 'F_M');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
956 phi = find(pls, 'PHI');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
957 noise_type = find(pls, 'NOISE_TYPE');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
958 test_ID = find(pls, 'TEST_ID');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
959
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
960 pl_w = plist('fs', fs, 'nsecs', nsecs, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
961 'waveform', 'sine wave','f', f_m, 'phi', phi, 'test_ID', test_ID);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
962 pl_n = plist('fs', fs, 'nsecs', nsecs, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
963 'waveform', 'noise', 'type', noise_type, 'test_ID', test_ID);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
964
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
965 ao_out = ao(pl_w) + ao(pl_n);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
966 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
967
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
968
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
969 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
970 % Executes the submit/receive actions
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
971 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
972 function sr_report = submitretrieve(conn, sub_obj, test_ID, coll_retr)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
973 import utils.const.*;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
974
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
975 %% Get the current time
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
976 t1 = char(time());
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
977
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
978 %% Put togehter the information struct
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
979 sinfo.conn = conn;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
980 sinfo.username = conn.username;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
981 sinfo.experiment_title = ['Repository Test ' t1(1:10)];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
982 sinfo.experiment_description = sprintf('Submit/retrieve test # %d', test_ID);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
983 sinfo.analysis_description = 'Testing constructors, submit, retrieve';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
984 sinfo.quantity = 'none';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
985 sinfo.keywords = 'none';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
986 sinfo.reference_ids = '';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
987 sinfo.additional_comments = 'Trial data for submission and retrieval';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
988 sinfo.additional_authors = 'M Hewitson';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
989
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
990
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
991 %% Submit the object(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
992 tic;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
993 [OBJids, cid] = submit(sub_obj{:}, sinfo);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
994 st = toc;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
995
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
996 %% Retrieve the object(s) from xml field
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
997 if coll_retr
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
998 % Retrieve the object(s) by collection ID
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
999 utils.helper.msg(msg.MNAME, '\n%s%d\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1000 'Retrieve xml object with collection ID ', cid, ' ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1001 tic;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1002 ret_obj_xml = ltpda_uo.retrieve(conn, 'Collection', cid);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1003 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1004 % retrieve the object(s) by obj IDs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1005 utils.helper.msg(msg.MNAME, '\n%s%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1006 'Retrieve xml object with obj ID ', num2str(OBJids), ' ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1007 tic;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1008 ret_obj_xml = ltpda_uo.retrieve(conn, OBJids);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1009 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1010
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1011 % Single retrieval will give an object, not a cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1012 if ~isa(ret_obj_xml, 'cell')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1013 ret_obj_xml = {ret_obj_xml};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1014 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1015 rt_xml = toc;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1016
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1017 %% Retrieve the object(s) from binary field
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1018 if coll_retr
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1019 % Retrieve the object(s) by collection ID
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1020 utils.helper.msg(msg.MNAME, '\n%s%d\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1021 'Retrieve binary object with collection ID ', cid, ' ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1022 tic;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1023 ret_obj_bin = ltpda_uo.retrieve(conn, 'binary', 'Collection', cid);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1024 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1025 % retrieve the object(s) by obj IDs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1026 utils.helper.msg(msg.MNAME, '\n%s%s\n%s', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1027 'Retrieve binary object with obj ID ', num2str(OBJids), ' ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1028 tic;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1029 ret_obj_bin = ltpda_uo.retrieve(conn, 'binary', OBJids);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1030 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1031
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1032 % Single retrieval will give an object, not a cell array
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1033 if ~isa(ret_obj_bin, 'cell')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1034 ret_obj_bin = {ret_obj_bin};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1035 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1036 rt_bin = toc;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1037
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1038 %% Check consistency of retrieved/submitted object(s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1039 status = zeros(2,length(sub_obj));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1040
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1041 for kk = 1:length(sub_obj)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1042 status(1,kk) = status(1,kk) + ne(sub_obj{kk}, ret_obj_xml{kk}, 'invars', 'hist'); % TODO: remove the hist checking
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1043 status(2,kk) = status(2,kk) + ne(sub_obj{kk}, ret_obj_bin{kk}, 'invars', 'hist'); % TODO: remove the hist checking
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1044 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1045
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1046 % Edit the time field
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1047 t = t1(1:19); % Skip milliseconds
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1048 t(strfind(t,':')) = '_'; % These are correct fieldnames
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1049
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1050 sr_report = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1051 'ret_time_xml', rt_xml, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1052 'ret_time_bin', rt_bin, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1053 'sub_time', st, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1054 't', t, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1055 'test_ID', test_ID, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1056 'status', status, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1057 'OBJids', OBJids, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1058 'cid', cid, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1059 'sinfo', rmfield(sinfo, 'conn') ... % Remove the non-serializable substructs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1060 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1061
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1062 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1063
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1064 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1065 % Get Info Object
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1066 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1067 function ii = getInfo(varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1068 if nargin == 1 && strcmpi(varargin{1}, 'None')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1069 sets = {};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1070 pl = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1071 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1072 sets = {'Default'};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1073 pl = getDefaultPlist;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1074 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1075 % Build info object
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1076 ii = minfo(mfilename, 'ao', '', utils.const.categories.helper, '$Id: repo_test_func.m,v 1.6 2009/03/25 17:39:01 nicola Exp $', sets, pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1077 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1078
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1079 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1080 % Get Default Plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1081 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1082 function plo = getDefaultPlist()
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1083
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1084 disp('* creating default plist...');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1085 plo = plist(...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1086 'RAND_N_OBJ', false, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1087 'N_OBJ', 1, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1088 'RAND_OBJ_TYPE', false, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1089 'OBJ_TYPE', 'ao', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1090 'RAND_AO', true, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1091 'AO_PARAMS', plist, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1092 'RAND_PLIST', true, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1093 'PLIST_PARAMS', plist, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1094 'RAND_MFIR', true, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1095 'MFIR_PARAMS', plist, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1096 'RAND_MIIR', true, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1097 'MIIR_PARAMS', plist, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1098 'RAND_PZMODEL', true, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1099 'PZMODEL_PARAMS', plist, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1100 'RAND_TIMESPAN', true, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1101 'TIMESPAN_PARAMS', plist, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1102 'RAND_SSM', true, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1103 'SSM_PARAMS', plist, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1104 'RAND_PARFRAC', true, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1105 'PARFRAC_PARAMS', plist, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1106 'RAND_RATIONAL', true , ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1107 'RATIONAL_PARAMS', plist, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1108 'HOSTNAME', '130.75.117.67', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1109 'DBASE', 'ltpda_test', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1110 'COLL_RETRIEVE', false, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1111 'SAVE_OBJS', true, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1112 'OBJ_FILENAME', 'submit_trial_obj', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1113 'OBJ_FILEFORMAT', 'xml', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1114 'DIR', '/Users/MH/exper_data/test/obj_creation' , ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1115 'SUBMIT', false, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1116 'CONN', [], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1117 'SAVE_RESULTS', true, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1118 'FILESIZE', false, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1119 'RESULTS_FILENAME','repo_test' ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1120 );
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1121 disp('* done.');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1122 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1123
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1124 % END
|