IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7931


Ignore:
Timestamp:
Jul 18, 2006, 10:27:37 AM (20 years ago)
Author:
Paul Price
Message:

Expanding when the headers and concepts are read.
Making sure results get added to the metadata.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStats/src/ppStatsLoop.c

    r7924 r7931  
    5959    // Iterate through the FPA
    6060    pmFPA *fpa = data->inFPA;           // The FPA of interest
    61     if (psListLength(data->headers) > 0 && fpa->hdu && pmFPAReadHeader(fpa, data->inFile)) {
     61    if (psListLength(data->headers) > 0 && fpa->hdu) {
     62        pmFPAReadHeader(fpa, data->inFile);
    6263        pmHDU *hdu = fpa->hdu;          // HDU for headers
    6364        getMetadata(fpaResults, hdu->header, headersIter);
    6465    }
    65     if (psListLength(data->concepts) > 0 &&
    66         pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_ALL, false, config->database)) {
     66    if (psListLength(data->concepts) > 0) {
     67        pmFPAReadHeader(fpa, data->inFile);
     68        pmConceptsReadFPA(fpa, PM_CONCEPT_SOURCE_ALL, false, config->database);
    6769        getMetadata(fpaResults, fpa->concepts, conceptsIter);
    6870    }
     
    8385        psMetadata *chipResults = psMetadataAlloc(); // Metadata to hold the chip-level results
    8486
    85         if (psListLength(data->headers) > 0 && chip->hdu && pmChipReadHeader(chip, data->inFile)) {
     87        if (psListLength(data->headers) > 0 && chip->hdu) {
     88            pmChipReadHeader(chip, data->inFile);
    8689            pmHDU *hdu = chip->hdu;     // HDU for headers
    8790            getMetadata(chipResults, hdu->header, headersIter);
    8891        }
    89         if (psListLength(data->concepts) > 0 &&
    90             pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_ALL, false, false, config->database)) {
     92        if (psListLength(data->concepts) > 0) {
     93            pmChipReadHeader(chip, data->inFile);
     94            pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_ALL, false, false, config->database);
    9195            getMetadata(chipResults, chip->concepts, conceptsIter);
    9296        }
     
    107111            psMetadata *cellResults = psMetadataAlloc(); // Metadata to hold the cell-level results
    108112
    109             if (psListLength(data->headers) > 0 && cell->hdu && pmCellReadHeader(cell, data->inFile)) {
     113            if (psListLength(data->headers) > 0 && cell->hdu) {
     114                pmCellReadHeader(cell, data->inFile);
    110115                pmHDU *hdu = cell->hdu;     // HDU for headers
    111116                getMetadata(cellResults, hdu->header, headersIter);
    112                 psMetadataAdd(chipResults, PS_LIST_TAIL, cellName, PS_DATA_METADATA,
    113                               "Results for cell", cellResults);
    114             }
    115             if (psListLength(data->concepts) > 0 &&
    116                 pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_ALL, false, config->database)) {
     117            }
     118            if (psListLength(data->concepts) > 0) {
     119                pmCellReadHeader(cell, data->inFile);
     120                pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_ALL, false, config->database);
    117121                getMetadata(cellResults, cell->concepts, conceptsIter);
    118122            }
     
    120124            if (!data->doStats) {
    121125                // Nothing further to do --- don't want to waste our time reading the data
     126                if (psListLength(cellResults->list) > 0) {
     127                    psMetadataAdd(chipResults, PS_LIST_TAIL, cellName, PS_DATA_METADATA,
     128                                  "Results for cell", cellResults);
     129                }
    122130                continue;
    123131            }
     
    213221            WRITE_STAT(PS_STAT_CLIPPED_STDEV,   "CLIPPED_STDEV", clippedStdev);
    214222
    215            // If we didn't add it before, add it now
    216             if (!psMetadataLookup(chipResults, cellName)) {
    217                 psMetadataAdd(chipResults, PS_LIST_TAIL, cellName, PS_DATA_METADATA,
    218                               "Results for cell", cellResults);
    219             }
     223            // Add the cell results to the chip
     224            psMetadataAdd(chipResults, PS_LIST_TAIL, cellName, PS_DATA_METADATA,
     225                          "Results for cell", cellResults);
    220226
    221227            psFree(cellResults);
Note: See TracChangeset for help on using the changeset viewer.