IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7002


Ignore:
Timestamp:
Apr 28, 2006, 5:02:32 PM (20 years ago)
Author:
Paul Price
Message:

Bad file names are set to NULL.

Location:
trunk/ppMerge/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeCheckInputs.c

    r7000 r7002  
    1515    for (int i = 0; i < filenames->n; i++) {
    1616        psString name = filenames->data[i]; // The name of the file
     17        if (!name || strlen(name) == 0) {
     18            continue;
     19        }
    1720        psFits *inFile = psFitsOpen(filenames->data[i], "r"); // The FITS file to read
    1821        if (!inFile) {
  • trunk/ppMerge/src/ppMergeConfig.c

    r6998 r7002  
    4040    psMetadataAddS32(config->arguments, PS_LIST_TAIL, "-onoff", 0, "Number of on/off pairs", 0);
    4141
    42     // We require an input file set
    43     bool status = pmConfigFileSetsMD(config->arguments, argc, argv, "INPUT", "-files", "-list");
    44     if (!status) {
    45         usage(argv[0]);
    46     }
    47 
    48     // Parse other arguments
     42    // Parse the arguments
    4943    if (! psArgumentParse(config->arguments, argc, argv) || *argc != 2) {
    5044        usage(argv[0]);
    5145    }
    5246
    53     // Add the input and output images (which remain on the command-line) to the arguments list
     47    // Add the output image to the arguments list
    5448    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[1]);
    5549
    56     // The input images are required.  The first one defines the camera.
    57     status = false;
    58     pmFPAfileFromArgs(&status, config, "PPMERGE.INPUT", "INPUT");
    59     if (!status) {
    60         usage(argv[0]);
     50    // Everything remaining must be input files
     51    if (*argc - 2 <= 1) {
     52        psError(PS_ERR_IO, true, "No files to combine.\n");
     53        exit(EXIT_FAILURE);
    6154    }
    62 
     55    psArray *files = psArrayAlloc(*argc - 2);
     56    for (int i = 2; i < *argc; i++) {
     57        files->data[i] = psStringCopy(argv[i]);
     58    }
     59    psMetadataAddPtr(config->arguments, PS_LIST_TAIL, "INPUT", PS_DATA_ARRAY,
     60                     "Array of inputs images", files);
    6361
    6462#if 0
Note: See TracChangeset for help on using the changeset viewer.