IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 21, 2008, 1:41:35 PM (17 years ago)
Author:
bills
Message:

added usage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksremove.c

    r20816 r20817  
    187187}
    188188
     189static void usage()
     190{
     191    fprintf(stderr, "USAGE: streaksremove -stage raw|chip|warp|diff -image IMAGE.fits -tmproot directory -streaks streaks_file\n\n");
     192    fprintf(stderr, "Optional arguments:\n");
     193    fprintf(stderr, "\t-class_id class_id: class_id (required for raw and chip stages)\n");
     194    fprintf(stderr, "\t-recovery: directory to save excised pixel images\n");
     195    fprintf(stderr, "\t-mask MASK.fits mask file to de-streak\n");
     196    fprintf(stderr, "\t-weight WEIGHT.fits: weight file to de-streak\n");
     197    fprintf(stderr, "\t-replace: replace the input images with the output\n");
     198    fprintf(stderr, "\t-remove: remove the original image after processing (requires -replace)\n");
     199    fprintf(stderr, "\t-keepnonwarped: do not exise pixels that were not part of difference processing\n");
     200    fprintf(stderr, "\t-transparent val: instead of setting exicsed pixel to NAN add val\n");
     201
     202    exit(2);
     203
     204
     205}
    189206static pmConfig *parseArguments(int argc, char **argv)
    190207{
     
    205222    } else {
    206223        psError(PS_ERR_UNKNOWN, true, "-stage is required\n");
    207         return NULL;
     224        usage();
    208225    }
    209226
     
    215232    } else if ((stage == IPP_STAGE_RAW) || (stage == IPP_STAGE_CHIP)) {
    216233        psError(PS_ERR_UNKNOWN, true, "-class_id is required\n");
    217         return NULL;
     234        usage();
    218235    }
    219236
     
    225242    } else {
    226243        psError(PS_ERR_UNKNOWN, true, "-streaks is required\n");
    227         return NULL;
     244        usage();
    228245    }
    229246
     
    244261            if (!pmConfigFileSetsMD(config->arguments, &argc, argv, "INPUT", "-image", NULL)) { ;
    245262                psError(PS_ERR_UNKNOWN, false, "failed to process -image");
    246                 return NULL;
     263                usage();
    247264            }
    248265        }
    249266    } else {
    250267        psError(PS_ERR_UNKNOWN, true, "-image is required\n");
    251         return NULL;
     268        usage();
    252269    }
    253270
     
    269286        if (gotReplace) {
    270287            psError(PS_ERR_UNKNOWN, true, "cannot make transparent streaks if -replace");
    271             return NULL;
     288            usage();
    272289        }
    273290        psArgumentRemove(argnum, &argc, argv);
     
    284301        if (CHIP_LEVEL_INPUT(stage)) {
    285302            psError(PS_ERR_UNKNOWN, true, "-astrom is required for raw and chip stages\n");
    286             return NULL;
     303            usage();
    287304        }
    288305    }
     
    294311            psError(PS_ERR_UNKNOWN, true, "mask image must be %snebulous path with %s image path\n",
    295312                nebulousImage ? "" : "non ", nebulousImage ? "nebulous" : "regular");
    296             return NULL;
     313            usage();
    297314        }
    298315        psMetadataAddStr(config->arguments, PS_LIST_TAIL, "INPUT.MASK", 0,
     
    307324            psError(PS_ERR_UNKNOWN, true, "weight image must have %snebulous path with %s image path\n",
    308325                nebulousImage ? "" : "non ", nebulousImage ? "nebulous" : "regular");
    309             return NULL;
     326            usage();
    310327        }
    311328        psMetadataAddStr(config->arguments, PS_LIST_TAIL, "INPUT.WEIGHT", 0,
     
    320337            psError(PS_ERR_UNKNOWN, true, "tmproot must have %snebulous path with %s image path with -replace\n",
    321338                nebulousImage ? "" : "non ", nebulousImage ? "nebulous" : "regular");
    322             return NULL;
     339            usage();
    323340        }
    324341        psString dir = pathToDirectory(argv[argnum]);
     
    328345    } else {
    329346        psError(PS_ERR_UNKNOWN, true, "-tmproot is required\n");
    330         return NULL;
     347        usage();
    331348    }
    332349
     
    339356    } else if ((stage == IPP_STAGE_RAW) && gotReplace) {
    340357        psError(PS_ERR_UNKNOWN, true, "-recovery is required for -stage raw with -replace\n");
    341         return NULL;
     358        usage();
    342359    }
    343360
     
    345362        if (!gotReplace) {
    346363            psError(PS_ERR_UNKNOWN, true, "-replace is required with -remove\n");
    347             return NULL;
     364            usage();
    348365        }
    349366        psArgumentRemove(argnum, &argc, argv);
     
    359376        psError(PS_ERR_UNKNOWN, true, "unexpected arguments: %s", unexpectedArguments);
    360377        psFree(unexpectedArguments);
    361         return NULL;
     378        usage();
    362379    }
    363380
Note: See TracChangeset for help on using the changeset viewer.