Changeset 8460
- Timestamp:
- Aug 21, 2006, 4:19:19 PM (20 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r8459 r8460 35 35 static bool addresidexpMode(pxConfig *config); 36 36 static bool residexpMode(pxConfig *config); 37 static bool residdetrunMode(pxConfig *config); 37 38 static bool declaremasterframeMode(pxConfig *config); 38 39 static bool masterframeMode(pxConfig *config); … … 91 92 MODECASE(DETTOOL_MODE_ADDRESIDEXP, addresidexpMode); 92 93 MODECASE(DETTOOL_MODE_RESIDEXP, residexpMode); 94 MODECASE(DETTOOL_MODE_RESIDDETRUN, residdetrunMode); 93 95 MODECASE(DETTOOL_MODE_DECLAREMASTERFRAME, declaremasterframeMode); 94 96 MODECASE(DETTOOL_MODE_MASTERFRAME, masterframeMode); … … 3178 3180 } 3179 3181 3180 #if 03181 PS_ASSERT_PTR_NON_NULL(config, false);3182 3183 // det_id, exp_id, & recipe are required3184 3185 bool status = false;3186 psString det_id = psMetadataLookupStr(&status, config->args, "-det_id");3187 if (!status) {3188 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_id");3189 return false;3190 }3191 if (!det_id) {3192 psError(PS_ERR_UNKNOWN, true, "-det_id is required");3193 return false;3194 }3195 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");3196 if (!status) {3197 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");3198 return false;3199 }3200 if (!exp_id) {3201 psError(PS_ERR_UNKNOWN, true, "-exp_id is required");3202 return false;3203 }3204 psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");3205 if (!status) {3206 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");3207 return false;3208 }3209 if (!exp_id) {3210 psError(PS_ERR_UNKNOWN, true, "-exp_id is required");3211 return false;3212 }3213 psString recipe = psMetadataLookupStr(&status, config->args, "-recip");3214 if (!status) {3215 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -recip");3216 return false;3217 }3218 if (!recipe) {3219 psError(PS_ERR_UNKNOWN, true, "-recip is required");3220 return false;3221 }3222 3223 // iteration has a default value3224 psS32 iteration = psMetadataLookupS32(&status, config->args, "-iteration");3225 if (!status) {3226 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -iteration");3227 return false;3228 }3229 // accept is optional3230 bool accept = psMetadataLookupBool(&status, config->args, "-accept");3231 if (!status) {3232 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -recip");3233 return false;3234 }3235 3236 // check det_id, exp_id against detInputExp3237 3238 // we have to generate our own where clause as we want to exclude -stats3239 // from the search3240 psMetadata *where = psMetadataAlloc();3241 if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",3242 (psS32)atoi(det_id))) {3243 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id");3244 psFree(where);3245 return false;3246 }3247 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) {3248 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");3249 psFree(where);3250 return false;3251 }3252 3253 psArray *inputExp = detInputExpSelectRowObjects(config->dbh, where, 0);3254 psFree(where);3255 if (!inputExp) {3256 psError(PS_ERR_UNKNOWN, true,3257 "det_id %s, exp_id %s does not corespond to an input exp", det_id, exp_id);3258 return false;3259 }3260 3261 // if we've made it this far then we must have found a match3262 psFree(inputExp);3263 3264 // create a new detResidExpg row and insert it3265 detResidExpRow *residExp = detResidExpRowAlloc(3266 (psS32)atol(det_id),3267 iteration,3268 exp_id,3269 class_id,3270 recipe,3271 accept3272 );3273 3274 if (!detResidExpInsertObject(config->dbh, residExp)) {3275 psError(PS_ERR_UNKNOWN, false, "database error");3276 psFree(residExp);3277 return false;3278 }3279 3280 psFree(residExp);3281 3282 return true;3283 }3284 #endif3285 3286 3182 static bool residexpMode(pxConfig *config) 3287 3183 { … … 3316 3212 3317 3213 psFree(residExps); 3214 3215 return true; 3216 } 3217 3218 static bool residdetrunMode(pxConfig *config) 3219 { 3220 PS_ASSERT_PTR_NON_NULL(config, false); 3318 3221 3319 3222 return true; -
trunk/ippTools/src/dettool.h
r8379 r8460 31 31 DETTOOL_MODE_RESIDIMFILE, 32 32 DETTOOL_MODE_ADDRESIDEXP, 33 DETTOOL_MODE_RESIDDETRUN, 33 34 DETTOOL_MODE_RESIDEXP, 34 35 DETTOOL_MODE_DECLAREMASTERFRAME, -
trunk/ippTools/src/dettoolConfig.c
r8459 r8460 350 350 "search for acceptable residuals", false); 351 351 psMetadataAddBool(residexpArgs, PS_LIST_TAIL, "-simple", 0, 352 "use the simple output format", false); 353 354 // -residdetrun 355 psMetadata *residdetrunArgs = psMetadataAlloc(); 356 psMetadataAddBool(residdetrunArgs, PS_LIST_TAIL, "-simple", 0, 352 357 "use the simple output format", false); 353 358 … … 424 429 PXTOOL_MODE("-addresidexp", DETTOOL_MODE_ADDRESIDEXP, addresidexpArgs); 425 430 PXTOOL_MODE("-residexp", DETTOOL_MODE_RESIDEXP, residexpArgs); 431 PXTOOL_MODE("-residdetrun", DETTOOL_MODE_RESIDDETRUN, residdetrunArgs); 426 432 PXTOOL_MODE("-declaremasterframe",DETTOOL_MODE_DECLAREMASTERFRAME,declaremasterframeArgs); 427 433 PXTOOL_MODE("-masterframe", DETTOOL_MODE_MASTERFRAME, masterframeArgs); … … 441 447 printf("\nPan-STARRS Detrend Tool\n"); 442 448 printf("Usage: %s <mode> [<options>]\n\n", argv[0]); 443 printf(" <mode> : [-pending|-definebyexp|-definebyquery|-runs|-selectrun|-select|-raw|-addprocessed|-tostack|-processed|-addstacked|-tonormalize|-addnormstat|-normstat|-stacked|-stackedframe|-addnormalizedimfile|-toresid|-normalized|-toresidexp|-normalizedframe|-addresidimfile|-residimfile|-addresidexp|-residexp|- declaremasterframe|-masterframe|-master|-rerun]\n\n");449 printf(" <mode> : [-pending|-definebyexp|-definebyquery|-runs|-selectrun|-select|-raw|-addprocessed|-tostack|-processed|-addstacked|-tonormalize|-addnormstat|-normstat|-stacked|-stackedframe|-addnormalizedimfile|-toresid|-normalized|-toresidexp|-normalizedframe|-addresidimfile|-residimfile|-addresidexp|-residexp|-residdetrun|-declaremasterframe|-masterframe|-master|-rerun]\n\n"); 444 450 fprintf (stdout, "-pending "); 445 451 psArgumentHelp(pendingArgs); … … 544 550 psArgumentHelp(residexpArgs); 545 551 psFree(residexpArgs); 552 553 fprintf (stdout, "-residdetrun "); 554 psArgumentHelp(residdetrunArgs); 555 psFree(residdetrunArgs); 546 556 547 557 fprintf (stdout, "-declaremasterframe "); … … 590 600 psFree(addresidexpArgs); 591 601 psFree(residexpArgs); 602 psFree(residdetrunArgs); 592 603 psFree(declaremasterframeArgs); 593 604 psFree(masterframeArgs);
Note:
See TracChangeset
for help on using the changeset viewer.
