IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2010, 3:55:49 PM (16 years ago)
Author:
eugene
Message:

update merges from trunk

Location:
branches/eam_branches/20100225
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225

  • branches/eam_branches/20100225/pswarp/src/pswarpArguments.c

    r25538 r27517  
    1414# include <glob.h>
    1515
     16
     17static void usage (void) {
     18    fprintf(stderr, "USAGE: pswarp [-file image(s)] [-list imagelist] [options] (output) (skycell)\n");
     19    fprintf(stderr, "  options:\n");
     20    fprintf(stderr, "    [-astrom astrom.cmp] : provide an alternative astrometry calibration\n");
     21    fprintf(stderr, "    [-mask mask.fits] : provide a corresponding mask image\n");
     22    fprintf(stderr, "    [-variance variance.fits] : provide a corresponding variance image\n");
     23    psErrorStackPrint(stderr, "\n");
     24    exit(PS_EXIT_CONFIG_ERROR);
     25}
     26
     27
    1628pmConfig *pswarpArguments (int argc, char **argv) {
    1729
     
    2032
    2133    if (argc == 1) {
    22         psError(PSWARP_ERR_ARGUMENTS, true, "No arguments supplied");
    23         return NULL;
     34        usage();
    2435    }
    2536
    2637    // load config data from default locations
    2738    pmConfig *config = pmConfigRead(&argc, argv, PSWARP_RECIPE);
    28     if (config == NULL) {
    29         psError(PSWARP_ERR_CONFIG, false, "Can't read site configuration");
     39    if (!config) {
     40        psError(psErrorCodeLast(), false, "Can't read configuration");
    3041        return NULL;
    3142    }
     
    3344    // save the following additional recipe values based on command-line options
    3445    // these options override the PSWARP recipe values loaded from recipe files
    35     pmConfigRecipeOptions (config, PSWARP_RECIPE);
     46    if (!pmConfigRecipeOptions(config, PSWARP_RECIPE)) {
     47        psError(psErrorCodeLast(), false, "Can't do something with recipes");
     48        psFree(config);
     49        return NULL;
     50    }
    3651
    3752    pmConfigFileSetsMD(config->arguments, &argc, argv, "ASTROM",   "-astrom", "-astromlist");
     
    7287        psThreadPoolInit (nThreads);
    7388    }
    74     pswarpSetThreads ();
     89    pswarpSetThreads();
    7590
    7691    if ((N = psArgumentGet(argc, argv, "-dumpconfig"))) {
     
    87102
    88103    if (argc != 3) {
    89         psError(PSWARP_ERR_ARGUMENTS, true, "Incorrect arguments supplied");
    90         return NULL;
     104        usage();
    91105    }
    92106
     
    160174    bool PSF = psMetadataLookupBool(&status, recipe, "PSF"); ///< Generate a PSF model?
    161175    if (!status) {
    162         PSF = true;
     176        PSF = true;
    163177        psWarning("PSF is not set in the %s recipe --- defaulting to TRUE.", PSWARP_RECIPE);
    164178    }
Note: See TracChangeset for help on using the changeset viewer.