Changeset 7421
- Timestamp:
- Jun 7, 2006, 4:19:26 PM (20 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
dettool.c (modified) (14 diffs)
-
dettoolConfig.c (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r7387 r7421 31 31 static bool masterMode(pxConfig *config); 32 32 33 static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id );33 static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id, psS32 iteration); 34 34 static psArray *searchRawImfiles(pxConfig *config, psMetadata *where); 35 35 … … 83 83 84 84 // what type of detRun is this? 85 // det_type & iteration are required 85 86 psString det_type = psMetadataLookupStr(&status, config->args, "-det_type"); 86 // this flag is required 87 if (!status) { 88 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_type"); 89 return false; 90 } 87 91 if (!det_type) { 88 92 psError(PS_ERR_UNKNOWN, true, "-det_type is required"); 93 return false; 94 } 95 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration"); 96 if (!status) { 97 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration"); 98 return false; 99 } 100 if (!iteration) { 101 psError(PS_ERR_UNKNOWN, true, "-iteration is required"); 89 102 return false; 90 103 } … … 187 200 detInputExpRow *inputExp = rawDetrenTodetInputExpRow( 188 201 rawExps->data[i], 189 det_id 202 det_id, 203 iteration 190 204 ); 191 205 psArrayAdd(inputExps, 0, inputExp); … … 286 300 } 287 301 288 static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id )302 static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id, psS32 iteration) 289 303 { 290 304 PS_ASSERT_PTR_NON_NULL(rawExp, NULL); … … 292 306 return detInputExpRowAlloc( 293 307 det_id, 308 iteration, 294 309 rawExp->exp_id, 295 310 rawExp->camera, … … 765 780 return false; 766 781 } 782 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration"); 783 if (!status) { 784 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration"); 785 return false; 786 } 787 if (!iteration) { 788 psError(PS_ERR_UNKNOWN, true, "-iteration is required"); 789 return false; 790 } 767 791 psString class_id = psMetadataLookupStr(&status, config->args, "-class_id"); 768 792 if (!status) { … … 835 859 // create a new detStackedImfile object 836 860 detStackedImfileRow *stackedImfile = detStackedImfileRowAlloc( 837 (psS32)atol(det_id), class_id, uri, stats, recipe861 (psS32)atol(det_id), iteration, class_id, uri, stats, recipe 838 862 ); 839 863 … … 1091 1115 return false; 1092 1116 } 1117 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration"); 1118 if (!status) { 1119 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration"); 1120 return false; 1121 } 1122 if (!iteration) { 1123 psError(PS_ERR_UNKNOWN, true, "-iteration is required"); 1124 return false; 1125 } 1093 1126 psString class_id = psMetadataLookupStr(&status, config->args, "-class_id"); 1094 1127 if (!status) { … … 1169 1202 // create a new detNormalizedImfile object 1170 1203 detNormalizedImfileRow *masterImfile = detNormalizedImfileRowAlloc( 1171 (psS32)atol(det_id), class_id, uri, stats, recipe1204 (psS32)atol(det_id), iteration, class_id, uri, stats, recipe 1172 1205 ); 1173 1206 … … 1353 1386 return false; 1354 1387 } 1388 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration"); 1389 if (!status) { 1390 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration"); 1391 return false; 1392 } 1393 if (!iteration) { 1394 psError(PS_ERR_UNKNOWN, true, "-iteration is required"); 1395 return false; 1396 } 1355 1397 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 1356 1398 if (!status) { … … 1440 1482 detResidImfileAnalysisRow *residImfile = detResidImfileAnalysisRowAlloc( 1441 1483 (psS32)atol(det_id), 1484 iteration, 1442 1485 exp_id, 1443 1486 class_id, … … 1507 1550 return false; 1508 1551 } 1552 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration"); 1553 if (!status) { 1554 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration"); 1555 return false; 1556 } 1557 if (!iteration) { 1558 psError(PS_ERR_UNKNOWN, true, "-iteration is required"); 1559 return false; 1560 } 1509 1561 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id"); 1510 1562 if (!status) { … … 1572 1624 detResidExpAnalysisRow *residExp = detResidExpAnalysisRowAlloc( 1573 1625 (psS32)atol(det_id), 1626 iteration, 1574 1627 exp_id, 1575 1628 stats, … … 1710 1763 { 1711 1764 PS_ASSERT_PTR_NON_NULL(config, false); 1712 return true; 1713 } 1765 1766 // join detMasterFrame & detNormalizedImfile tables 1767 // no options are required... use the default where statement 1768 psArray *normalizedImfiles = detNormalizedImfileSelectRowObjects( 1769 config->dbh, config->where, 0); 1770 if (!normalizedImfiles) { 1771 psError(PS_ERR_UNKNOWN, false, "no detNormalizedImfile rows found"); 1772 return false; 1773 } 1774 1775 if (psArrayLength(normalizedImfiles)) { 1776 // print imfile list 1777 psMetadata *output = psMetadataAlloc(); 1778 for (long i = 0; i < psArrayLength(normalizedImfiles); i++) { 1779 psMetadata *md = detMasterFrameMetadataFromObject( 1780 normalizedImfiles->data[i]); 1781 psMetadataAddMetadata( 1782 output, PS_LIST_TAIL, "detNormalizedImfile", 1783 PS_META_DUPLICATE_OK, NULL, md 1784 ); 1785 } 1786 1787 psString str = psMetadataConfigFormat(output); 1788 psFree(output); 1789 fprintf(stdout, "%s\n", str); 1790 psFree(str); 1791 } 1792 1793 psFree(normalizedImfiles); 1794 1795 return true; 1796 } -
trunk/ippTools/src/dettoolConfig.c
r7387 r7421 37 37 psMetadataAddStr(inputArgs, PS_LIST_TAIL, "-det_id", 0, 38 38 "search for detrend ID", NULL); 39 psMetadataAddS32(inputArgs, PS_LIST_TAIL, "-iteration", 0, 40 "define iteration number", 0); 39 41 psMetadataAddStr(inputArgs, PS_LIST_TAIL, "-exp_id", 0, 40 42 "search for exp ID", NULL); … … 44 46 psMetadataAddStr(rawArgs, PS_LIST_TAIL, "-det_id", 0, 45 47 "search for detrend ID", NULL); 46 psMetadataAddStr(rawArgs, PS_LIST_TAIL, "-iter", 0,47 "search for iteration number", NULL);48 48 psMetadataAddStr(rawArgs, PS_LIST_TAIL, "-exp_id", 0, 49 49 "search for exp ID", NULL); … … 55 55 psMetadataAddStr(addprocArgs, PS_LIST_TAIL, "-det_id", 0, 56 56 "define detrend ID (required)", NULL); 57 psMetadataAddStr(addprocArgs, PS_LIST_TAIL, "-iter", 0,58 "define iteration number", NULL);59 57 psMetadataAddStr(addprocArgs, PS_LIST_TAIL, "-exp_id", 0, 60 58 "define exp ID (required)", NULL); … … 72 70 psMetadataAddStr(procArgs, PS_LIST_TAIL, "-det_id", 0, 73 71 "search for detrend ID", NULL); 74 psMetadataAddStr(procArgs, PS_LIST_TAIL, "-iter", 0,75 "search for iteration number", NULL);76 72 psMetadataAddStr(procArgs, PS_LIST_TAIL, "-exp_id", 0, 77 73 "search for exp ID", NULL); … … 89 85 psMetadataAddStr(addstacArgs, PS_LIST_TAIL, "-det_id", 0, 90 86 "define detrend ID (required)", NULL); 91 psMetadataAddS tr(addstacArgs, PS_LIST_TAIL, "-iter", 0,92 "define iteration number", NULL);87 psMetadataAddS32(addstacArgs, PS_LIST_TAIL, "-iteration", 0, 88 "define iteration number", 0); 93 89 psMetadataAddStr(addstacArgs, PS_LIST_TAIL, "-class_id", 0, 94 90 "define class ID (required)", NULL); … … 104 100 psMetadataAddStr(stacArgs, PS_LIST_TAIL, "-det_id", 0, 105 101 "search for detrend ID", NULL); 106 psMetadataAddS tr(stacArgs, PS_LIST_TAIL, "-iter", 0,107 "search for iteration number", NULL);102 psMetadataAddS32(stacArgs, PS_LIST_TAIL, "-iteration", 0, 103 "search for iteration number", 0); 108 104 psMetadataAddStr(stacArgs, PS_LIST_TAIL, "-class_id", 0, 109 105 "search for class ID", NULL); … … 117 113 psMetadataAddStr(stacframeArgs, PS_LIST_TAIL, "-det_id", 0, 118 114 "search for detrend ID (required)", NULL); 119 psMetadataAddS tr(stacframeArgs, PS_LIST_TAIL, "-iter", 0,120 "search for iteration number", NULL);115 psMetadataAddS32(stacframeArgs, PS_LIST_TAIL, "-iteration", 0, 116 "search for iteration number", 0); 121 117 psMetadataAddStr(stacframeArgs, PS_LIST_TAIL, "-class_id", 0, 122 118 "search for class ID", NULL); … … 130 126 psMetadataAddStr(addnormalizedArgs, PS_LIST_TAIL, "-det_id", 0, 131 127 "define detrend ID (required)", NULL); 132 psMetadataAddS tr(addnormalizedArgs, PS_LIST_TAIL, "-iter", 0,133 "define iteration number", NULL);128 psMetadataAddS32(addnormalizedArgs, PS_LIST_TAIL, "-iteration", 0, 129 "define iteration number", 0); 134 130 psMetadataAddStr(addnormalizedArgs, PS_LIST_TAIL, "-class_id", 0, 135 131 "define class ID (required)", NULL); … … 145 141 psMetadataAddStr(normalizedArgs, PS_LIST_TAIL, "-det_id", 0, 146 142 "search for detrend ID (required)", NULL); 147 psMetadataAddS tr(normalizedArgs, PS_LIST_TAIL, "-iter", 0,148 "search for iteration number", NULL);143 psMetadataAddS32(normalizedArgs, PS_LIST_TAIL, "-iteration", 0, 144 "search for iteration number", 0); 149 145 psMetadataAddStr(normalizedArgs, PS_LIST_TAIL, "-class_id", 0, 150 146 "search for class ID", NULL); … … 158 154 psMetadataAddStr(normalizedframeArgs, PS_LIST_TAIL, "-det_id", 0, 159 155 "search for detrend ID (required)", NULL); 160 psMetadataAddS tr(normalizedframeArgs, PS_LIST_TAIL, "-iter", 0,161 "search for iteration number", NULL);156 psMetadataAddS32(normalizedframeArgs, PS_LIST_TAIL, "-iteration", 0, 157 "search for iteration number", 0); 162 158 psMetadataAddStr(normalizedframeArgs, PS_LIST_TAIL, "-class_id", 0, 163 159 "search for class ID", NULL); … … 171 167 psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-det_id", 0, 172 168 "define detrend ID (required)", NULL); 173 psMetadataAddS tr(addresidArgs, PS_LIST_TAIL, "-iter", 0,174 "define iteration number", NULL);169 psMetadataAddS32(addresidArgs, PS_LIST_TAIL, "-iteration", 0, 170 "define iteration number", 0); 175 171 psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-exp_id", 0, 176 172 "define detrend ID (required)", NULL); … … 186 182 psMetadataAddStr(residArgs, PS_LIST_TAIL, "-det_id", 0, 187 183 "search for detrend ID (required)", NULL); 188 psMetadataAddS tr(residArgs, PS_LIST_TAIL, "-iter", 0,189 "search for iteration number", NULL);184 psMetadataAddS32(residArgs, PS_LIST_TAIL, "-iteration", 0, 185 "search for iteration number", 0); 190 186 psMetadataAddStr(residArgs, PS_LIST_TAIL, "-exp_id", 0, 191 187 "define detrend ID (required)", NULL); … … 201 197 psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-det_id", 0, 202 198 "define detrend ID (required)", NULL); 203 psMetadataAddS tr(addresidexpArgs, PS_LIST_TAIL, "-iter", 0,204 "define iteration number", NULL);199 psMetadataAddS32(addresidexpArgs, PS_LIST_TAIL, "-iteration", 0, 200 "define iteration number", 0); 205 201 psMetadataAddStr(addresidexpArgs, PS_LIST_TAIL, "-exp_id", 0, 206 202 "define detrend ID (required)", NULL); … … 216 212 psMetadataAddStr(residexpArgs, PS_LIST_TAIL, "-det_id", 0, 217 213 "search for detrend ID (required)", NULL); 218 psMetadataAddS tr(residexpArgs, PS_LIST_TAIL, "-iter", 0,219 "search for iteration number", NULL);214 psMetadataAddS32(residexpArgs, PS_LIST_TAIL, "-iteration", 0, 215 "search for iteration number", 0); 220 216 psMetadataAddStr(residexpArgs, PS_LIST_TAIL, "-class_id", 0, 221 217 "search for class ID", NULL); … … 231 227 psMetadataAddStr(addmasterframeArgs, PS_LIST_TAIL, "-det_id", 0, 232 228 "define detrend ID (required)", NULL); 233 psMetadataAddS tr(addmasterframeArgs, PS_LIST_TAIL, "-iteration", 0,234 "define iteration number", NULL);229 psMetadataAddS32(addmasterframeArgs, PS_LIST_TAIL, "-iteration", 0, 230 "define iteration number", 0); 235 231 psMetadataAddStr(addmasterframeArgs, PS_LIST_TAIL, "-comment", 0, 236 232 "define master frame comment", NULL); … … 245 241 psMetadataAddStr(masterArgs, PS_LIST_TAIL, "-det_id", 0, 246 242 "search for detrend master for detrend ID", NULL); 243 psMetadataAddS32(masterArgs, PS_LIST_TAIL, "-iteration", 0, 244 "search for detrend master for detrend ID", 0); 247 245 248 246 #define PXTOOL_MODE(option, modeval, argset) \
Note:
See TracChangeset
for help on using the changeset viewer.
