IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 5, 2013, 2:20:46 PM (13 years ago)
Author:
eugene
Message:

stats is basically working now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpCleanup.c

    r35421 r35512  
    1818
    1919    // Ensure everything is written out, at every level
    20     pswarpFileActivation(config, detectorFiles, true);
     20    pswarpFileActivation(config, detectorFiles, false);
     21    pswarpFileActivation(config, photFiles, false);
     22    pswarpFileActivation(config, independentFiles, false);
    2123    pswarpFileActivation(config, skycellFiles, true);
    22     pswarpFileActivation(config, photFiles, true);
    23     pswarpFileActivation(config, independentFiles, true);
    2424
    25     if (!pswarpIOChecksAfter(config)) {
     25    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, "PSWARP.OUTPUT");
     26    if (!output) {
     27        psError(PSWARP_ERR_CONFIG, false, "Can't find output data!\n");
     28        pmFPAfileFreeSetStrict(false);
     29        goto DONE;
     30    }
     31
     32    pmFPAview *view = pmFPAviewAlloc(0);
     33    if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
     34        psError(psErrorCodeLast(), false, "Unable to read files.");
     35        pmFPAfileFreeSetStrict(false);
     36        goto DONE;
     37    }
     38    pmChip *chip;
     39    while ((chip = pmFPAviewNextChip (view, output->fpa, 1)) != NULL) {
     40        psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
     41        if (!chip->process || !chip->file_exists) { continue; }
     42        if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
     43            psError(psErrorCodeLast(), false, "Unable to read files.");
     44            pmFPAfileFreeSetStrict(false);
     45            goto DONE;
     46        }
     47        pmCell *cell;
     48        while ((cell = pmFPAviewNextCell (view, output->fpa, 1)) != NULL) {
     49            psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
     50            if (!cell->process || !cell->file_exists) { continue; }
     51            if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE) ||
     52                !pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     53                psError(psErrorCodeLast(), false, "Unable to read files.");
     54                pmFPAfileFreeSetStrict(false);
     55                goto DONE;
     56            }
     57        }
     58        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     59            psError(psErrorCodeLast(), false, "Unable to write files.");
     60            pmFPAfileFreeSetStrict(false);
     61            goto DONE;
     62        }
     63    }
     64    if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
    2665        psError(psErrorCodeLast(), false, "Unable to write files.");
    27         exitValue = pswarpExitCode(exitValue);
    2866        pmFPAfileFreeSetStrict(false);
     67        goto DONE;
    2968    }
     69    psFree(view);
    3070
    3171    if (!pswarpStatsFileSave (config, statsFile)) {
     
    5696    psLibFinalize();
    5797
     98DONE:
    5899    exitValue = pswarpExitCode(exitValue);
    59100    exit (exitValue);
Note: See TracChangeset for help on using the changeset viewer.