Changeset 7423
- Timestamp:
- Jun 7, 2006, 6:10:08 PM (20 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r7422 r7423 17 17 static bool addstacMode(pxConfig *config); 18 18 static bool stacMode(pxConfig *config); 19 static psArray *validDetInputClassIds(pxConfig *config, const char *det_id);20 static psArray *searchInputImfiles(pxConfig *config, const char *det_id);21 19 static bool stacframeMode(pxConfig *config); 22 20 static bool addnormalizedMode(pxConfig *config); … … 30 28 static bool masterframeMode(pxConfig *config); 31 29 static bool masterMode(pxConfig *config); 32 30 static bool rerunMode(pxConfig *config); 31 32 static psArray *validDetInputClassIds(pxConfig *config, const char *det_id); 33 static psArray *searchInputImfiles(pxConfig *config, const char *det_id); 33 34 static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id, psS32 iteration); 34 35 static psArray *searchRawImfiles(pxConfig *config, psMetadata *where); … … 65 66 MODECASE(DETTOOL_MODE_MASTERFRAME, masterframeMode); 66 67 MODECASE(DETTOOL_MODE_MASTER, masterMode); 68 MODECASE(DETTOOL_MODE_RERUN, rerunMode); 67 69 default: 68 70 psAbort(argv[0], "invalid option (this should not happen)"); … … 1772 1774 return true; 1773 1775 } 1776 1777 1778 static bool rerunMode(pxConfig *config) 1779 { 1780 PS_ASSERT_PTR_NON_NULL(config, false); 1781 1782 // det_id is required 1783 bool status = false; 1784 psString det_id = psMetadataLookupStr(&status, config->args, "-det_id"); 1785 if (!status) { 1786 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_id"); 1787 return false; 1788 } 1789 if (!det_id) { 1790 psError(PS_ERR_UNKNOWN, true, "-det_id is required"); 1791 return false; 1792 } 1793 1794 return true; 1795 } -
trunk/ippTools/src/dettool.h
r7422 r7423 24 24 DETTOOL_MODE_DECLAREMASTERFRAME, 25 25 DETTOOL_MODE_MASTERFRAME, 26 DETTOOL_MODE_MASTER 26 DETTOOL_MODE_MASTER, 27 DETTOOL_MODE_RERUN 27 28 } dettoolMode; 28 29 -
trunk/ippTools/src/dettoolConfig.c
r7422 r7423 243 243 psMetadataAddS32(masterArgs, PS_LIST_TAIL, "-iteration", 0, 244 244 "search for detrend master for detrend ID", 0); 245 246 // -rerun 247 psMetadata *rerunArgs = psMetadataAlloc(); 248 psMetadataAddStr(rerunArgs, PS_LIST_TAIL, "-det_id", 0, 249 "search for detrend master for detrend ID (required)", NULL); 250 psMetadataAddStr(rerunArgs, PS_LIST_TAIL, "-exp_id", PS_META_DUPLICATE_OK, 251 "include this exposure (multiple OK, required)", NULL); 245 252 246 253 #define PXTOOL_MODE(option, modeval, argset) \ … … 283 290 PXTOOL_MODE("-masterframe", DETTOOL_MODE_MASTERFRAME, masterframeArgs); 284 291 PXTOOL_MODE("-master", DETTOOL_MODE_MASTER, masterArgs); 292 PXTOOL_MODE("-rerun", DETTOOL_MODE_RERUN, rerunArgs); 285 293 286 294 bool argErr = false; … … 296 304 printf("\nPan-STARRS Detrend Tool\n"); 297 305 printf("Usage: %s <mode> [<options>]\n\n", argv[0]); 298 printf(" <mode> : [-define|-raw|-addprocessed|-processed|-addstacked|-stacked|-stackedframe|-addnormalized|-normalized|-normalizedframe|-addresid|-resid|-addresidexp|-residexp|-declaremasterframe|-masterframe|-master ]\n\n");306 printf(" <mode> : [-define|-raw|-addprocessed|-processed|-addstacked|-stacked|-stackedframe|-addnormalized|-normalized|-normalizedframe|-addresid|-resid|-addresidexp|-residexp|-declaremasterframe|-masterframe|-master|-rerun]\n\n"); 299 307 fprintf (stdout, "-define "); 300 308 psArgumentHelp(defineArgs); … … 354 362 psArgumentHelp(masterArgs); 355 363 psFree(masterArgs); 364 fprintf (stdout, "-rerun "); 365 psArgumentHelp(rerunArgs); 366 psFree(rerunArgs); 356 367 357 368 exit(EXIT_FAILURE); … … 375 386 psFree(masterframeArgs); 376 387 psFree(masterArgs); 388 psFree(rerunArgs); 377 389 378 390 // setup search criterion … … 395 407 396 408 addWhereStr(det_id); 409 if ((n = psMetadataLookupS32(&status, config->args, "-iteration"))) { 410 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "iteration", 0, "==", n)) { 411 psError(PS_ERR_UNKNOWN, false, "failed to add item iteration"); 412 exit(EXIT_FAILURE); 413 } 414 } 397 415 addWhereStr(det_type); 398 416 addWhereStr(exp_id);
Note:
See TracChangeset
for help on using the changeset viewer.
