IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 23, 2008, 1:09:42 PM (18 years ago)
Author:
Paul Price
Message:

Print defined runs as a single METADATA, not as a lot of discrete
METADATAs (different format than pantasks is used to).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/difftool.c

    r18673 r18679  
    652652
    653653// Generate a single populated run
    654 static bool populatedrun(const char *workdir, // Working directory
     654static bool populatedrun(psArray *list, // List of runs, to print
     655                         const char *workdir, // Working directory
    655656                         const char *skycell_id, // Skycell identifier
    656657                         const char *tess_id, // Tessellation identifier
     
    759760    }
    760761
    761     if (!diffRunPrintObject(stdout, run, !simple)) {
    762             psError(PS_ERR_UNKNOWN, false, "failed to print object");
    763             psFree(run);
    764             return false;
     762    if (list) {
     763        psArrayAdd(list, list->n, run);
    765764    }
    766765
     
    782781    PXOPT_LOOKUP_S64(input_warp_id, config->args, "-input_warp_id", false, false);
    783782    PXOPT_LOOKUP_S64(input_stack_id, config->args, "-input_stack_id", false, false);
     783    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    784784
    785785    if (template_stack_id && template_warp_id) {
     
    803803    }
    804804
    805     return populatedrun(workdir, skycell_id, tess_id,
    806                         input_warp_id ? input_warp_id : PS_MAX_S64,
    807                         input_stack_id ? input_stack_id : PS_MAX_S64,
    808                         template_warp_id ? template_warp_id : PS_MAX_S64,
    809                         template_stack_id ? template_stack_id : PS_MAX_S64,
    810                         config);
     805    psArray *list = psArrayAllocEmpty(16); // List of runs, to print
     806
     807    if (!populatedrun(list, workdir, skycell_id, tess_id,
     808                      input_warp_id ? input_warp_id : PS_MAX_S64,
     809                      input_stack_id ? input_stack_id : PS_MAX_S64,
     810                      template_warp_id ? template_warp_id : PS_MAX_S64,
     811                      template_stack_id ? template_stack_id : PS_MAX_S64,
     812                      config)) {
     813        psError(PS_ERR_UNKNOWN, false, "failed to create populated diffRun");
     814        psFree(list);
     815        return false;
     816    }
     817
     818    if (!diffRunPrintObjects(stdout, list, !simple)) {
     819            psError(PS_ERR_UNKNOWN, false, "failed to print object");
     820            psFree(list);
     821            return false;
     822    }
     823    psFree(list);
    811824
    812825    return true;
     
    880893    }
    881894
     895    psArray *list = psArrayAllocEmpty(16); // List of runs, to print
    882896    long numGood = 0;                   // Number of good rows added
    883897    for (long i = 0; i < output->n; i++) {
     
    907921        }
    908922
    909         if (!populatedrun(workdir, skycell_id, tess_id, warp_id, PS_MAX_S64, PS_MAX_S64, stack_id, config)) {
     923        if (!populatedrun(list, workdir, skycell_id, tess_id, warp_id, PS_MAX_S64, PS_MAX_S64,
     924                          stack_id, config)) {
    910925            psWarning("Unable to add run for %s,%s,%" PRId64 ",%" PRId64, skycell_id, tess_id,
    911926                      warp_id, stack_id);
     
    916931        numGood++;
    917932    }
    918 
    919     psLogMsg("difftool", PS_LOG_INFO, "%ld runs added.", numGood);
    920 
    921933    psFree(output);
    922934
    923     return true;
    924 }
     935    if (!diffRunPrintObjects(stdout, list, !simple)) {
     936        psError(PS_ERR_UNKNOWN, false, "failed to print object");
     937        psFree(list);
     938        return false;
     939    }
     940    psFree(list);
     941
     942    return true;
     943}
Note: See TracChangeset for help on using the changeset viewer.