IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8460


Ignore:
Timestamp:
Aug 21, 2006, 4:19:19 PM (20 years ago)
Author:
jhoblitt
Message:

stub out -residdetrun

Location:
trunk/ippTools/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/dettool.c

    r8459 r8460  
    3535static bool addresidexpMode(pxConfig *config);
    3636static bool residexpMode(pxConfig *config);
     37static bool residdetrunMode(pxConfig *config);
    3738static bool declaremasterframeMode(pxConfig *config);
    3839static bool masterframeMode(pxConfig *config);
     
    9192        MODECASE(DETTOOL_MODE_ADDRESIDEXP,      addresidexpMode);
    9293        MODECASE(DETTOOL_MODE_RESIDEXP,         residexpMode);
     94        MODECASE(DETTOOL_MODE_RESIDDETRUN,      residdetrunMode);
    9395        MODECASE(DETTOOL_MODE_DECLAREMASTERFRAME, declaremasterframeMode);
    9496        MODECASE(DETTOOL_MODE_MASTERFRAME,      masterframeMode);
     
    31783180}
    31793181
    3180 #if 0   
    3181     PS_ASSERT_PTR_NON_NULL(config, false);
    3182  
    3183     // det_id, exp_id,  & recipe are required
    3184 
    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 value
    3224     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 optional
    3230     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 detInputExp
    3237    
    3238     // we have to generate our own where clause as we want to exclude -stats
    3239     // from the search
    3240     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 match
    3262     psFree(inputExp);
    3263 
    3264     // create a new detResidExpg row and insert it
    3265     detResidExpRow *residExp = detResidExpRowAlloc(
    3266                 (psS32)atol(det_id),
    3267                 iteration,
    3268                 exp_id,
    3269                 class_id,
    3270                 recipe,
    3271                 accept
    3272             );
    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 #endif
    3285 
    32863182static bool residexpMode(pxConfig *config)
    32873183{
     
    33163212
    33173213    psFree(residExps);
     3214
     3215    return true;
     3216}
     3217
     3218static bool residdetrunMode(pxConfig *config)
     3219{
     3220    PS_ASSERT_PTR_NON_NULL(config, false);
    33183221
    33193222    return true;
  • trunk/ippTools/src/dettool.h

    r8379 r8460  
    3131    DETTOOL_MODE_RESIDIMFILE,
    3232    DETTOOL_MODE_ADDRESIDEXP,
     33    DETTOOL_MODE_RESIDDETRUN,
    3334    DETTOOL_MODE_RESIDEXP,
    3435    DETTOOL_MODE_DECLAREMASTERFRAME,
  • trunk/ippTools/src/dettoolConfig.c

    r8459 r8460  
    350350        "search for acceptable residuals", false);
    351351    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,
    352357        "use the simple output format", false);
    353358
     
    424429    PXTOOL_MODE("-addresidexp",     DETTOOL_MODE_ADDRESIDEXP,  addresidexpArgs);
    425430    PXTOOL_MODE("-residexp",        DETTOOL_MODE_RESIDEXP,     residexpArgs);
     431    PXTOOL_MODE("-residdetrun",     DETTOOL_MODE_RESIDDETRUN,  residdetrunArgs);
    426432    PXTOOL_MODE("-declaremasterframe",DETTOOL_MODE_DECLAREMASTERFRAME,declaremasterframeArgs);
    427433    PXTOOL_MODE("-masterframe",     DETTOOL_MODE_MASTERFRAME,  masterframeArgs);
     
    441447        printf("\nPan-STARRS Detrend Tool\n");
    442448        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");
    444450        fprintf (stdout, "-pending ");
    445451        psArgumentHelp(pendingArgs);
     
    544550        psArgumentHelp(residexpArgs);
    545551        psFree(residexpArgs);
     552
     553        fprintf (stdout, "-residdetrun ");
     554        psArgumentHelp(residdetrunArgs);
     555        psFree(residdetrunArgs);
    546556
    547557        fprintf (stdout, "-declaremasterframe ");
     
    590600    psFree(addresidexpArgs);
    591601    psFree(residexpArgs);
     602    psFree(residdetrunArgs);
    592603    psFree(declaremasterframeArgs);
    593604    psFree(masterframeArgs);
Note: See TracChangeset for help on using the changeset viewer.