IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 6, 2013, 4:50:14 PM (13 years ago)
Author:
eugene
Message:

get mextract and mmatch to work with a subset metadata file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mextract.c

    r35249 r35250  
    147147    // 3) add the input subset filename to the dvo_client command
    148148
     149    // allocate the temp array and copy all but (RA) (DEC)
     150    int targc = 0;
     151    char **targv = NULL;
     152    ALLOCATE (targv, char *, argc);
     153    for (i = 0; i < argc; i++) {
     154      targv[targc] = strcreate (argv[i]);
     155      targc ++;
     156    }
     157
    149158    if (loadImages) {
    150159      Image *image;
     
    154163      char *filename = abspath("image.metadata.fits", DVO_MAX_PATH);
    155164      ImageMetadataSave (filename, image, Nimage);
    156       argc += 2;
    157       argv[argc-2] = strcreate ("-image-metadata");
    158       argv[argc-1] = strcreate (filename);
    159     }
    160 
    161     int status = HostTableParallelOps (argc, argv, RESULT_FILE, TRUE, 0, VERBOSE);
     165
     166      REALLOCATE (targv, char *, targc + 2);
     167      targv[targc+0] = strcreate ("-image-metadata");
     168      targv[targc+1] = strcreate (filename);
     169      targc += 2;
     170    }
     171
     172    // call the remote client
     173    int status = HostTableParallelOps (targc, targv, RESULT_FILE, TRUE, 0, VERBOSE);
    162174
    163175    dbFreeFields (fields, Nfields);
     
    167179    dvo_catalog_free (&catalog);
    168180
    169     if (loadImages) {
    170       free (argv[argc-1]);
    171       free (argv[argc-2]);
    172     }
     181    // free up targv
     182    for (i = 0; i < targc; i++) {
     183      free (targv[i]);
     184    }
     185    free (targv);
    173186
    174187    return status;
Note: See TracChangeset for help on using the changeset viewer.