IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:08:50 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ppImage

  • branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageArguments.c

    r19943 r23352  
    1414    fprintf(stderr, "\t-chip CHIPNUM: Only process this chip number.\n");
    1515    fprintf(stderr, "\t-norm VALUE: Divide through by this value when done.\n");
     16    fprintf(stderr, "\t-normlist file.mdc: normalizations by class_id.\n");
    1617    fprintf(stderr, "\n");
    1718    fprintf(stderr, "Input options (single file / file list):\n");
     
    8081    if ((argnum = psArgumentGet(argc, argv, "-visual"))) {
    8182        psArgumentRemove(argnum, &argc, argv);
    82         psphotSetVisual (true);
     83        pmVisualSetVisual(true);
    8384    }
    8485
     
    8687    if ((argnum = psArgumentGet(argc, argv, "-threads"))) {
    8788        psArgumentRemove(argnum, &argc, argv);
    88         int nThreads = atoi(argv[argnum]);
     89        int nThreads = atoi(argv[argnum]);
    8990        psMetadataAddS32(config->arguments, PS_LIST_TAIL, "NTHREADS", 0, "number of warp threads", nThreads);
    9091        psArgumentRemove(argnum, &argc, argv);
    9192
    92         // create the thread pool with number of desired threads, supplying our thread launcher function
    93         // XXX need to determine the number of threads from the config data
    94         psThreadPoolInit (nThreads);
     93        // create the thread pool with number of desired threads, supplying our thread launcher function
     94        // XXX need to determine the number of threads from the config data
     95        psThreadPoolInit (nThreads);
    9596    }
    9697
     
    107108
    108109    // the input file is a required argument; if not found, we will exit
    109     bool status = pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT", "-file", "-list");
    110     if (!status) {
    111         usage ();
    112     }
     110    pmConfigFileSetsMD (config->arguments, &argc, argv, "INPUT", "-file", "-list");
    113111
    114112    // if these command-line options are supplied, load the file name lists into config->arguments
     
    128126    }
    129127
    130     // Optional normalisation factor
     128    // Optional normalization factor
    131129    if ((argnum = psArgumentGet(argc, argv, "-norm"))) {
    132130        psArgumentRemove(argnum, &argc, argv);
    133131        float norm = atof(argv[argnum]);
    134         psMetadataAddF32(config->arguments, PS_LIST_TAIL, "NORMALISATION", 0,
     132        psMetadataAddF32(config->arguments, PS_LIST_TAIL, "NORMALIZATION", 0,
    135133                         "Normalisation to apply", norm);
     134        psArgumentRemove(argnum, &argc, argv);
     135    }
     136
     137    // Optional per-class normalization table
     138    if ((argnum = psArgumentGet(argc, argv, "-normlist"))) {
     139        psArgumentRemove(argnum, &argc, argv);
     140
     141        unsigned int nFail = 0;
     142        psMetadata *normlist = psMetadataConfigRead (NULL, &nFail, argv[argnum], false);
     143        // XXX allow this file to be in nebulous?
     144
     145        psMetadataAddMetadata(config->arguments, PS_LIST_TAIL, "NORMALIZATION.TABLE", 0, "Normalization to apply", normlist);
     146        psFree (normlist);
    136147        psArgumentRemove(argnum, &argc, argv);
    137148    }
Note: See TracChangeset for help on using the changeset viewer.