IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8286


Ignore:
Timestamp:
Aug 10, 2006, 6:26:13 PM (20 years ago)
Author:
jhoblitt
Message:

stub out new & rename old *Mode() functions as part of the new control flow

Location:
trunk/ippTools/src
Files:
3 edited

Legend:

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

    r8279 r8286  
    1010
    1111static bool pendingMode(pxConfig *config);
    12 static bool defineMode(pxConfig *config);
     12static bool definebyexpMode(pxConfig *config);
     13static bool definebyqueryMode(pxConfig *config);
    1314static bool runsMode(pxConfig *config);
    14 static bool selectrunMode(pxConfig *config);
    15 static bool selectMode(pxConfig *config);
    1615static bool inputMode(pxConfig *config);
    1716static bool rawMode(pxConfig *config);
    18 static bool addprocMode(pxConfig *config);
    19 static bool procMode(pxConfig *config);
    20 static bool addstacMode(pxConfig *config);
    21 static bool stacMode(pxConfig *config);
    22 static bool stacframeMode(pxConfig *config);
     17//static bool selectrunMode(pxConfig *config);
     18//static bool selectMode(pxConfig *config);
     19static bool addprocessedMode(pxConfig *config);
     20static bool tostackMode(pxConfig *config);
     21static bool processedMode(pxConfig *config);
     22static bool addstackedMode(pxConfig *config);
     23static bool stackedMode(pxConfig *config);
     24static bool stacframeMode(pxConfig *config); // needed?
     25static bool tonormalizeMode(pxConfig *config);
     26static bool addnormstatMode(pxConfig *config);
     27static bool normstatMode(pxConfig *config);
    2328static bool addnormalizedMode(pxConfig *config);
    24 static bool normalizedMode(pxConfig *config);
    25 static bool normalizedframeMode(pxConfig *config);
    26 static bool addresidMode(pxConfig *config);
    27 static bool residMode(pxConfig *config);
     29static bool toresidMode(pxConfig *config);
     30static bool addresidimfileMode(pxConfig *config);
     31static bool normalizedMode(pxConfig *config); // needed?
     32static bool toresidexpMode(pxConfig *config);
     33static bool normalizedframeMode(pxConfig *config);// neede?
     34static bool residimfileMode(pxConfig *config);
    2835static bool addresidexpMode(pxConfig *config);
    2936static bool residexpMode(pxConfig *config);
     
    5360
    5461    switch (config->mode) {
    55         MODECASE(DETTOOL_MODE_PENDING, pendingMode);
    56         MODECASE(DETTOOL_MODE_DEFINE, defineMode);
    57         MODECASE(DETTOOL_MODE_RUNS, runsMode);
    58         MODECASE(DETTOOL_MODE_SELECTRUN, selectrunMode);
    59         MODECASE(DETTOOL_MODE_SELECT, selectMode);
    60         MODECASE(DETTOOL_MODE_INPUT, inputMode);
    61         MODECASE(DETTOOL_MODE_RAW, rawMode);
    62         MODECASE(DETTOOL_MODE_ADDPROCESSED, addprocMode);
    63         MODECASE(DETTOOL_MODE_PROCESSED, procMode);
    64         MODECASE(DETTOOL_MODE_ADDSTACKED, addstacMode);
    65         MODECASE(DETTOOL_MODE_STACKED, stacMode);
    66         MODECASE(DETTOOL_MODE_STACKEDFRAME, stacframeMode);
    67         MODECASE(DETTOOL_MODE_ADDNORMALIZED, addnormalizedMode);
    68         MODECASE(DETTOOL_MODE_NORMALIZED, normalizedMode);
    69         MODECASE(DETTOOL_MODE_NORMALIZEDFRAME, normalizedframeMode);
    70         MODECASE(DETTOOL_MODE_ADDRESID, addresidMode);
    71         MODECASE(DETTOOL_MODE_RESID, residMode);
    72         MODECASE(DETTOOL_MODE_ADDRESIDEXP, addresidexpMode);
    73         MODECASE(DETTOOL_MODE_RESIDEXP, residexpMode);
     62        MODECASE(DETTOOL_MODE_PENDING,          pendingMode);
     63        MODECASE(DETTOOL_MODE_DEFINEBYEXP,      definebyexpMode);
     64        MODECASE(DETTOOL_MODE_DEFINEBYQUERY,    definebyqueryMode);
     65        MODECASE(DETTOOL_MODE_RUNS,             runsMode);
     66        MODECASE(DETTOOL_MODE_INPUT,            inputMode);
     67        MODECASE(DETTOOL_MODE_RAW,              rawMode);
     68//        MODECASE(DETTOOL_MODE_SELECTRUN, selectrunMode);
     69//        MODECASE(DETTOOL_MODE_SELECT, selectMode);
     70        MODECASE(DETTOOL_MODE_ADDPROCESSED,     addprocessedMode);
     71        MODECASE(DETTOOL_MODE_TOSTACK,          tostackMode);
     72        MODECASE(DETTOOL_MODE_PROCESSED,        processedMode);
     73        MODECASE(DETTOOL_MODE_ADDSTACKED,       addstackedMode);
     74        MODECASE(DETTOOL_MODE_STACKED,          stackedMode);
     75        MODECASE(DETTOOL_MODE_STACKEDFRAME,     stacframeMode); // needed?
     76        MODECASE(DETTOOL_MODE_TONORMALIZE,      tonormalizeMode);
     77        MODECASE(DETTOOL_MODE_ADDNORMSTAT,      addnormstatMode);
     78        MODECASE(DETTOOL_MODE_NORMSTAT,         normstatMode);
     79        MODECASE(DETTOOL_MODE_ADDNORMALIZED,    addnormalizedMode);
     80        MODECASE(DETTOOL_MODE_NORMALIZED,       normalizedMode);
     81        MODECASE(DETTOOL_MODE_TORESID,          toresidMode);
     82        MODECASE(DETTOOL_MODE_ADDRESIDIMFILE,   addresidimfileMode);
     83        MODECASE(DETTOOL_MODE_TORESIDEXP,       toresidexpMode);
     84        MODECASE(DETTOOL_MODE_NORMALIZEDFRAME,  normalizedframeMode); // needed?
     85        MODECASE(DETTOOL_MODE_RESIDIMFILE,      residimfileMode);
     86        MODECASE(DETTOOL_MODE_ADDRESIDEXP,      addresidexpMode);
     87        MODECASE(DETTOOL_MODE_RESIDEXP,         residexpMode);
    7488        MODECASE(DETTOOL_MODE_DECLAREMASTERFRAME, declaremasterframeMode);
    75         MODECASE(DETTOOL_MODE_MASTERFRAME, masterframeMode);
    76         MODECASE(DETTOOL_MODE_MASTER, masterMode);
    77         MODECASE(DETTOOL_MODE_RERUN, rerunMode);
     89        MODECASE(DETTOOL_MODE_MASTERFRAME,      masterframeMode);
     90        MODECASE(DETTOOL_MODE_MASTER,           masterMode);
     91        MODECASE(DETTOOL_MODE_RERUN,            rerunMode);
    7892        default:
    7993            psAbort(argv[0], "invalid option (this should not happen)");
    8094    }
    81 
    82     psFree(config);
    83     pmConfigDone();
     95psFree(config); pmConfigDone();
    8496    psLibFinalize();
    8597
     
    136148}
    137149
    138 static bool defineMode(pxConfig *config)
     150static bool definebyexpMode(pxConfig *config)
    139151{
    140152    bool status     = false;
     
    262274    printf("%ld\n", det_id);
    263275
     276    return true;
     277}
     278
     279static bool definebyqueryMode(pxConfig *config)
     280{
    264281    return true;
    265282}
     
    347364}
    348365
     366#if 0
    349367static bool selectrunMode(pxConfig *config)
    350368{
     
    466484    return true;
    467485}
     486
     487#endif
     488
    468489static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id, psS32 iteration)
    469490{
     
    620641}
    621642
    622 static bool addprocMode(pxConfig *config)
     643static bool addprocessedMode(pxConfig *config)
    623644{
    624645    PS_ASSERT_PTR_NON_NULL(config, false);
     
    710731}
    711732
    712 static bool procMode(pxConfig *config)
     733static bool tostackMode(pxConfig *config)
     734{
     735    return true;
     736}
     737
     738static bool processedMode(pxConfig *config)
    713739{
    714740    PS_ASSERT_PTR_NON_NULL(config, false);
     
    967993}
    968994
    969 static bool addstacMode(pxConfig *config)
     995static bool addstackedMode(pxConfig *config)
    970996{
    971997    PS_ASSERT_PTR_NON_NULL(config, false);
     
    10661092}
    10671093
    1068 static bool stacMode(pxConfig *config)
     1094static bool stackedMode(pxConfig *config)
    10691095{
    10701096    PS_ASSERT_PTR_NON_NULL(config, false);
     
    12241250}
    12251251
     1252static bool tonormalizeMode(pxConfig *config)
     1253{
     1254    return true;
     1255}
     1256
     1257static bool addnormstatMode(pxConfig *config)
     1258{
     1259    return true;
     1260}
     1261
     1262static bool normstatMode(pxConfig *config)
     1263{
     1264    return true;
     1265}
     1266
    12261267static psArray *validDetInputClassIds(pxConfig *config, const char *det_id)
    12271268{
     
    14151456    psFree(masterImfile);
    14161457
     1458    return true;
     1459}
     1460
     1461static bool toresidMode(pxConfig *config)
     1462{
    14171463    return true;
    14181464}
     
    14971543}
    14981544
     1545static bool toresidexpMode(pxConfig *config)
     1546{
     1547    return true;
     1548}
     1549
    14991550static bool normalizedframeMode(pxConfig *config)
    15001551{
     
    15801631}
    15811632
    1582 static bool addresidMode(pxConfig *config)
     1633static bool addresidimfileMode(pxConfig *config)
    15831634{
    15841635    PS_ASSERT_PTR_NON_NULL(config, false);
     
    17201771}
    17211772
    1722 static bool residMode(pxConfig *config)
     1773static bool residimfileMode(pxConfig *config)
    17231774{
    17241775    PS_ASSERT_PTR_NON_NULL(config, false);
  • trunk/ippTools/src/dettool.h

    r8175 r8286  
    77    DETTOOL_MODE_NONE           = 0x0,
    88    DETTOOL_MODE_PENDING,
    9     DETTOOL_MODE_DEFINE,
     9    DETTOOL_MODE_DEFINEBYEXP,
     10    DETTOOL_MODE_DEFINEBYQUERY,
    1011    DETTOOL_MODE_RUNS,
    11     DETTOOL_MODE_SELECTRUN,
    12     DETTOOL_MODE_SELECT,
    1312    DETTOOL_MODE_INPUT,
    1413    DETTOOL_MODE_RAW,
     14//    DETTOOL_MODE_SELECTRUN,
     15//    DETTOOL_MODE_SELECT,
    1516    DETTOOL_MODE_ADDPROCESSED,
     17    DETTOOL_MODE_TOSTACK,
    1618    DETTOOL_MODE_PROCESSED,
    1719    DETTOOL_MODE_ADDSTACKED,
    1820    DETTOOL_MODE_STACKED,
    1921    DETTOOL_MODE_STACKEDFRAME,
     22    DETTOOL_MODE_TONORMALIZE,
     23    DETTOOL_MODE_ADDNORMSTAT,
     24    DETTOOL_MODE_NORMSTAT,
    2025    DETTOOL_MODE_ADDNORMALIZED,
    2126    DETTOOL_MODE_NORMALIZED,
     27    DETTOOL_MODE_TORESID,
     28    DETTOOL_MODE_ADDRESIDIMFILE,
     29    DETTOOL_MODE_TORESIDEXP,
    2230    DETTOOL_MODE_NORMALIZEDFRAME,
    23     DETTOOL_MODE_ADDRESID,
    24     DETTOOL_MODE_RESID,
     31    DETTOOL_MODE_RESIDIMFILE,
    2532    DETTOOL_MODE_ADDRESIDEXP,
    2633    DETTOOL_MODE_RESIDEXP,
  • trunk/ippTools/src/dettoolConfig.c

    r8218 r8286  
    3838            "use the simple output format", false);
    3939
    40     // -define
    41     psMetadata *defineArgs = psMetadataAlloc();
    42     psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-exp_id",  PS_META_DUPLICATE_OK,
    43         "include this exposure (multiple OK, required)", NULL);
    44     psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-det_type",  0,
    45         "define the type of detrend run (required)", NULL);
     40    // -definebyexp
     41    psMetadata *definebyexpArgs = psMetadataAlloc();
     42    psMetadataAddStr(definebyexpArgs, PS_LIST_TAIL, "-exp_id",
     43            PS_META_DUPLICATE_OK,
     44            "include this exposure (multiple OK, required)", NULL);
     45    psMetadataAddStr(definebyexpArgs, PS_LIST_TAIL, "-det_type",  0,
     46            "define the type of detrend run (required)", NULL);
    4647
    4748    // -runs
     
    5253            "use the simple output format", false);
    5354
     55#if 0
    5456    // XXX temporary
    5557    // -selectrun
     
    7173    psMetadataAddStr(selectArgs, PS_LIST_TAIL, "-classID",  0,
    7274        "defined class ID (required)", NULL);
     75#endif
    7376
    7477    // -input
     
    204207        "use the simple output format", false);
    205208
    206     // -addresid
    207     psMetadata *addresidArgs = psMetadataAlloc();
    208     psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-det_id",  0,
    209         "define detrend ID (required)", NULL);
    210     psMetadataAddS32(addresidArgs, PS_LIST_TAIL, "-iteration",  0,
     209    // -addresidimfile
     210    psMetadata *addresidimfileArgs = psMetadataAlloc();
     211    psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-det_id",  0,
     212        "define detrend ID (required)", NULL);
     213    psMetadataAddS32(addresidimfileArgs, PS_LIST_TAIL, "-iteration",  0,
    211214        "define iteration number", 0);
    212     psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-exp_id",  0,
    213         "define detrend ID (required)", NULL);
    214     psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-class_id",  0,
     215    psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
     216        "define detrend ID (required)", NULL);
     217    psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-class_id",  0,
    215218        "define class ID (required)", NULL);
    216     psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-recip",  0,
     219    psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-recip",  0,
    217220        "define recipe (required)", NULL);
    218     psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-uri",  0,
     221    psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-uri",  0,
    219222        "define resid file URI (required)", NULL);
    220     psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-b1_uri",  0,
     223    psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-b1_uri",  0,
    221224        "define banana 1", NULL);
    222     psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-b2_uri",  0,
     225    psMetadataAddStr(addresidimfileArgs, PS_LIST_TAIL, "-b2_uri",  0,
    223226        "define banana 2", NULL);
    224227
    225     // -resid
    226     psMetadata *residArgs = psMetadataAlloc();
    227     psMetadataAddStr(residArgs, PS_LIST_TAIL, "-det_id",  0,
     228    // -residimfile
     229    psMetadata *residimfileArgs = psMetadataAlloc();
     230    psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-det_id",  0,
    228231        "search for detrend ID (required)", NULL);
    229     psMetadataAddS32(residArgs, PS_LIST_TAIL, "-iteration",  0,
     232    psMetadataAddS32(residimfileArgs, PS_LIST_TAIL, "-iteration",  0,
    230233        "search for iteration number", 0);
    231     psMetadataAddStr(residArgs, PS_LIST_TAIL, "-exp_id",  0,
    232         "define detrend ID (required)", NULL);
    233     psMetadataAddStr(residArgs, PS_LIST_TAIL, "-class_id",  0,
    234         "search for class ID", NULL);
    235     psMetadataAddStr(residArgs, PS_LIST_TAIL, "-recip",  0,
     234    psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-exp_id",  0,
     235        "define detrend ID (required)", NULL);
     236    psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-class_id",  0,
     237        "search for class ID", NULL);
     238    psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-recip",  0,
    236239        "search for recipe", NULL);
    237     psMetadataAddBool(residArgs, PS_LIST_TAIL, "-simple",  0,
     240    psMetadataAddBool(residimfileArgs, PS_LIST_TAIL, "-simple",  0,
    238241        "use the simple output format", false);
    239242 
     
    313316    // find which mode we're running under
    314317    PXTOOL_MODE("-pending",         DETTOOL_MODE_PENDING,       pendingArgs);
    315     PXTOOL_MODE("-define",          DETTOOL_MODE_DEFINE,        defineArgs);
     318    PXTOOL_MODE("-definebyexp",     DETTOOL_MODE_DEFINEBYEXP,   definebyexpArgs);
    316319    PXTOOL_MODE("-raw",             DETTOOL_MODE_RAW,           rawArgs);
    317320    PXTOOL_MODE("-runs",            DETTOOL_MODE_RUNS,          runsArgs);
    318     PXTOOL_MODE("-selectrun",       DETTOOL_MODE_SELECTRUN,     selectrunArgs);
    319     PXTOOL_MODE("-select",          DETTOOL_MODE_SELECT,        selectArgs);
     321//    PXTOOL_MODE("-selectrun",       DETTOOL_MODE_SELECTRUN,     selectrunArgs);
     322//    PXTOOL_MODE("-select",          DETTOOL_MODE_SELECT,        selectArgs);
    320323    PXTOOL_MODE("-input",           DETTOOL_MODE_INPUT,         inputArgs);
    321324    PXTOOL_MODE("-addprocessed",    DETTOOL_MODE_ADDPROCESSED,  addprocArgs);
     
    327330    PXTOOL_MODE("-normalized",      DETTOOL_MODE_NORMALIZED,    normalizedArgs);
    328331    PXTOOL_MODE("-normalizedframe", DETTOOL_MODE_NORMALIZEDFRAME,normalizedframeArgs);
    329     PXTOOL_MODE("-addresid",        DETTOOL_MODE_ADDRESID,      addresidArgs);
    330     PXTOOL_MODE("-resid",           DETTOOL_MODE_RESID,         residArgs);
     332    PXTOOL_MODE("-addresidimfile",  DETTOOL_MODE_ADDRESIDIMFILE,  addresidimfileArgs);
     333    PXTOOL_MODE("-residimfile",     DETTOOL_MODE_RESIDIMFILE,    residimfileArgs);
    331334    PXTOOL_MODE("-addresidexp",     DETTOOL_MODE_ADDRESIDEXP,  addresidexpArgs);
    332335    PXTOOL_MODE("-residexp",        DETTOOL_MODE_RESIDEXP,     residexpArgs);
     
    348351        printf("\nPan-STARRS Detrend Tool\n");
    349352        printf("Usage: %s <mode> [<options>]\n\n", argv[0]);
    350         printf(" <mode> : [-pending|-define|-runs|-selectrun|-select|-raw|-addprocessed|-processed|-addstacked|-stacked|-stackedframe|-addnormalized|-normalized|-normalizedframe|-addresid|-resid|-addresidexp|-residexp|-declaremasterframe|-masterframe|-master|-rerun]\n\n");
     353        printf(" <mode> : [-pending|-definebyexp|-runs|-selectrun|-select|-raw|-addprocessed|-processed|-addstacked|-stacked|-stackedframe|-addnormalized|-normalized|-normalizedframe|-addresidimfile|-residimfile|-addresidexp|-residexp|-declaremasterframe|-masterframe|-master|-rerun]\n\n");
    351354        fprintf (stdout, "-pending ");
    352355        psArgumentHelp(pendingArgs);
    353356        psFree(pendingArgs);
    354         fprintf (stdout, "-define ");
    355         psArgumentHelp(defineArgs);
    356         psFree(defineArgs);
     357        fprintf (stdout, "-definebyexp ");
     358        psArgumentHelp(definebyexpArgs);
     359        psFree(definebyexpArgs);
    357360        fprintf (stdout, "-runs ");
    358361        psArgumentHelp(runsArgs);
    359362        psFree(runsArgs);
     363#if 0
    360364        fprintf (stdout, "-selectrun ");
    361365        psArgumentHelp(selectrunArgs);
     
    364368        psArgumentHelp(selectArgs);
    365369        psFree(selectArgs);
     370#endif
    366371        fprintf (stdout, "-input ");
    367372        psArgumentHelp(inputArgs);
     
    395400        psFree(normalizedframeArgs);
    396401        fprintf (stdout, "-addresid ");
    397         psArgumentHelp(addresidArgs);
    398         psFree(addresidArgs);
    399         fprintf (stdout, "-resid ");
    400         psArgumentHelp(residArgs);
    401         psFree(residArgs);
     402        psArgumentHelp(addresidimfileArgs);
     403        psFree(addresidimfileArgs);
     404        fprintf (stdout, "-residimfile ");
     405        psArgumentHelp(residimfileArgs);
     406        psFree(residimfileArgs);
    402407        fprintf (stdout, "-addresidexp ");
    403408        psArgumentHelp(addresidexpArgs);
     
    423428
    424429    psFree(pendingArgs);
    425     psFree(defineArgs);
     430    psFree(definebyexpArgs);
    426431    psFree(runsArgs);
    427     psFree(selectrunArgs);
    428     psFree(selectArgs);
     432//    psFree(selectrunArgs);
     433//    psFree(selectArgs);
    429434    psFree(inputArgs);
    430435    psFree(rawArgs);
     
    437442    psFree(normalizedArgs);
    438443    psFree(normalizedframeArgs);
    439     psFree(addresidArgs);
    440     psFree(residArgs);
     444    psFree(addresidimfileArgs);
     445    psFree(residimfileArgs);
    441446    psFree(addresidexpArgs);
    442447    psFree(residexpArgs);
Note: See TracChangeset for help on using the changeset viewer.