IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 2, 2009, 2:51:37 PM (17 years ago)
Author:
Paul Price
Message:

Merging in branches/pap/ from r23685. Some conflicts, most notably in ippTools, but these resolved fairly simply. Only question mark is on regtool reversion, but I think I got it right. Everything builds fine.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ppSub

  • trunk/ppSub/src/ppSubLoop.c

    r23315 r23688  
    2828    pmConfigRecipesCull(config, "PPSUB,PPSTATS,PSPHOT,MASKS,JPEG");
    2929
     30    ppSubData *data = ppSubDataAlloc(); // Processing data
     31
    3032    bool mdok;                          // Status of MD lookup
    3133    const char *statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS"); // Filename for statistics
    32     psMetadata *stats = NULL;           // Container for statistics
    3334    FILE *statsFile = NULL;             // File stream for statistics
    3435    if (statsName && strlen(statsName) > 0) {
     
    3839            psError(PS_ERR_IO, true, "Unable to open statistics file %s for writing.\n", resolved);
    3940            psFree(resolved);
    40             return false;
    41         } else {
    42             stats = psMetadataAlloc();
     41            goto ERROR;
    4342        }
    4443        psFree(resolved);
     
    4847    if (!input) {
    4948        psError(PS_ERR_UNEXPECTED_NULL, false, "Can't find input data!\n");
    50         return false;
     49        goto ERROR;
    5150    }
    5251
     
    5453    if (!reference) {
    5554        psError(PS_ERR_UNEXPECTED_NULL, false, "Can't find reference data!\n");
    56         return false;
     55        goto ERROR;
    5756    }
    5857
     
    6059    if (!output) {
    6160        psError(PS_ERR_UNEXPECTED_NULL, false, "Can't find output data!\n");
    62         return false;
     61        goto ERROR;
    6362    }
    6463
     
    6766    // Iterate over the FPA hierarchy
    6867    if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    69         return false;
     68        goto ERROR;
    7069    }
    7170
     
    7776            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "FPA format discrepency between input and reference");
    7877            psFree(view);
    79             return false;
     78            goto ERROR;
    8079        }
    8180
     
    8584
    8685        if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    87             return false;
     86            goto ERROR;
    8887        }
    8988
     
    9695                        "FPA format discrepency between input and reference");
    9796                psFree(view);
    98                 return false;
     97                goto ERROR;
    9998            }
    10099            if (!inCell->file_exists) {
     
    102101            }
    103102            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    104                 return false;
     103                goto ERROR;
    105104            }
    106105
     
    108107            while ((inRO = pmFPAviewNextReadout(view, input->fpa, 1))) {
    109108                if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    110                     return false;
     109                    goto ERROR;
    111110                }
    112111                pmReadout *refRO = pmFPAviewThisReadout(view, reference->fpa);// Reference readout of interest
     
    116115                            "FPA format discrepency between input and reference");
    117116                    psFree(view);
    118                     return false;
     117                    goto ERROR;
    119118                }
    120119                if (!inRO->data_exists) {
     
    123122
    124123                // Perform the analysis
    125                 if (!ppSubReadout(config, stats, view)) {
     124                if (!ppSubReadout(config, data, view)) {
    126125                    psError(PS_ERR_UNKNOWN, false, "Unable to subtract images.\n");
    127                     return false;
     126                    goto ERROR;
    128127                }
    129128
    130129                if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    131                     return false;
     130                    goto ERROR;
    132131                }
    133132            }
    134133
    135134            // Perform statistics on the cell
    136             if (stats) {
     135            if (statsFile) {
    137136                pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, "PPSUB.OUTPUT"); // Output file
    138137                if (!output) {
    139138                    psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find file PPSUB.OUTPUT.\n");
    140                     return false;
     139                    goto ERROR;
    141140                }
    142141                psImageMaskType maskValue = pmConfigMaskGet("MASK.VALUE", config);
    143                 ppStatsFPA(stats, output->fpa, view, maskValue, config);
     142                ppStatsFPA(data->stats, output->fpa, view, maskValue, config);
    144143            }
    145144
    146145            if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
    147                 return false;
     146                goto ERROR;
    148147            }
    149148        }
    150149
    151150        if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
    152             return false;
     151            goto ERROR;
    153152        }
    154153    }
    155154
    156155    if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
    157         return false;
     156        goto ERROR;
    158157    }
    159158
     
    161160
    162161    // Write out summary statistics
    163     if (stats) {
    164         psMetadataAddF32(stats, PS_LIST_TAIL, "TIME_SUB", 0, "Time for subtraction completion",
     162    if (statsFile) {
     163        psMetadataAddF32(data->stats, PS_LIST_TAIL, "TIME_SUB", 0, "Time for subtraction completion",
    165164                         psTimerMark("ppSub"));
    166165
    167         const char *statsMDC = psMetadataConfigFormat(stats);
     166        const char *statsMDC = psMetadataConfigFormat(data->stats);
    168167        if (!statsMDC || strlen(statsMDC) == 0) {
    169168            psWarning("Unable to generate statistics MDC file.\n");
     
    173172        psFree((void *)statsMDC);
    174173        fclose(statsFile);
    175 
    176         psFree(stats);
    177174    }
    178175
    179176    psString dump_file = psMetadataLookupStr(&mdok, config->arguments, "-dumpconfig");
    180177    if (dump_file) {
    181 
    182178        pmFPAfile *input = psMetadataLookupPtr(NULL, config->files, "PPSUB.INPUT"); // Input file
    183179        pmConfigDump(config, input->fpa, dump_file);
    184180    }
    185181
     182    psFree(data);
    186183    return true;
     184
     185ERROR:
     186    psFree(data);
     187    return false;
    187188}
Note: See TracChangeset for help on using the changeset viewer.