Changeset 8370
- Timestamp:
- Aug 15, 2006, 4:44:45 PM (20 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
dettool.c (modified) (1 diff)
-
dettoolConfig.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r8365 r8370 1879 1879 static bool normstatMode(pxConfig *config) 1880 1880 { 1881 PS_ASSERT_PTR_NON_NULL(config, NULL); 1881 PS_ASSERT_PTR_NON_NULL(config, false); 1882 1883 // select detNormalizedStatImfile.* 1884 // by: 1885 // where det_id, iteration, class_id is not in detNormalizedImfile 1886 1887 psString query = psStringCopy( 1888 "SELECT" 1889 " detNormalizedStatImfile.*" 1890 " FROM detNormalizedStatImfile" 1891 " LEFT JOIN detNormalizedImfile" 1892 " USING(det_id, iteration, class_id)" 1893 " WHERE" 1894 " detNormalizedImfile.det_id IS NULL" 1895 " AND detNormalizedImfile.iteration IS NULL" 1896 " AnD detNormalizedImfile.class_id IS NULL" 1897 ); 1898 1899 // XXX does it make sens to accept any search params? 1900 #if 0 1901 if (config->where) { 1902 psString whereClaus = psDBGenerateWhereConditionSQL(config->where); 1903 psStringAppend(&query, " AND %s", whereClaus); 1904 psFree(whereClaus); 1905 } 1906 #endif 1907 1908 if (!p_psDBRunQuery(config->dbh, query)) { 1909 psError(PS_ERR_UNKNOWN, false, "database error"); 1910 psFree(query); 1911 return false; 1912 } 1913 psFree(query); 1914 1915 psArray *output = p_psDBFetchResult(config->dbh); 1916 if (!output) { 1917 // XXX check psError here 1918 psError(PS_ERR_UNKNOWN, false, "no pending rawDetrendExp rows found"); 1919 return false; 1920 } 1921 1922 bool simple = false; 1923 { 1924 bool status = false; 1925 simple = psMetadataLookupBool(&status, config->args, "-simple"); 1926 if (!status) { 1927 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 1928 psFree(output); 1929 return false; 1930 } 1931 } 1932 1933 // negative simple so the default is true 1934 if (!ippdbPrintMetadatas(stdout, output, "rawDetrendImfile", !simple)) { 1935 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 1936 psFree(output); 1937 return false; 1938 } 1939 1940 psFree(output); 1882 1941 1883 1942 return true; -
trunk/ippTools/src/dettoolConfig.c
r8355 r8370 189 189 psMetadataAddF32(addnormstatArgs, PS_LIST_TAIL, "-norm", 0, 190 190 "define normal value (required)", NAN); 191 192 // -normstat 193 psMetadata *normstatArgs = psMetadataAlloc(); 194 psMetadataAddBool(normstatArgs, PS_LIST_TAIL, "-simple", 0, 195 "use the simple output format", false); 191 196 192 197 // -stacked … … 377 382 PXTOOL_MODE("-tonormalize", DETTOOL_MODE_TONORMALIZE, tonormalizeArgs); 378 383 PXTOOL_MODE("-addnormstat", DETTOOL_MODE_ADDNORMSTAT, addnormstatArgs); 384 PXTOOL_MODE("-normstat", DETTOOL_MODE_NORMSTAT, normstatArgs); 379 385 PXTOOL_MODE("-stacked", DETTOOL_MODE_STACKED, stacArgs); 380 386 PXTOOL_MODE("-stackedframe", DETTOOL_MODE_STACKEDFRAME, stacframeArgs); … … 403 409 printf("\nPan-STARRS Detrend Tool\n"); 404 410 printf("Usage: %s <mode> [<options>]\n\n", argv[0]); 405 printf(" <mode> : [-pending|-definebyexp|-definebyquery|-runs|-selectrun|-select|-raw|-addprocessed|-tostack|-processed|-addstacked|-tonormalize|-addnormstat|- stacked|-stackedframe|-addnormalized|-normalized|-normalizedframe|-addresidimfile|-residimfile|-addresidexp|-residexp|-declaremasterframe|-masterframe|-master|-rerun]\n\n");411 printf(" <mode> : [-pending|-definebyexp|-definebyquery|-runs|-selectrun|-select|-raw|-addprocessed|-tostack|-processed|-addstacked|-tonormalize|-addnormstat|-normstat|-stacked|-stackedframe|-addnormalized|-normalized|-normalizedframe|-addresidimfile|-residimfile|-addresidexp|-residexp|-declaremasterframe|-masterframe|-master|-rerun]\n\n"); 406 412 fprintf (stdout, "-pending "); 407 413 psArgumentHelp(pendingArgs); … … 459 465 psFree(addnormstatArgs); 460 466 467 fprintf (stdout, "-normstat "); 468 psArgumentHelp(normstatArgs); 469 psFree(normstatArgs); 470 461 471 fprintf (stdout, "-stacked "); 462 472 psArgumentHelp(stacArgs); … … 528 538 psFree(tonormalizeArgs); 529 539 psFree(addnormstatArgs); 540 psFree(normstatArgs); 530 541 psFree(stacArgs); 531 542 psFree(stacframeArgs);
Note:
See TracChangeset
for help on using the changeset viewer.
