IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 11, 2007, 4:28:22 PM (19 years ago)
Author:
Paul Price
Message:

Don't complain if there's no data (hdu or readouts).

File:
1 edited

Legend:

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

    r14003 r14149  
    22
    33psExit ppStatsCell(psMetadata *chipResults, // Metadata holding the chip results
    4                    pmCell *cell,        // Cell for which to get statistics
    5                    psFits *fits,        // FITS file handle
    6                    pmFPAview *view,  // View for analysis
    7                    ppStatsData *data,   // The data
    8                    const pmConfig *config // Configuration
     4                   pmCell *cell,        // Cell for which to get statistics
     5                   psFits *fits,        // FITS file handle
     6                   pmFPAview *view,  // View for analysis
     7                   ppStatsData *data,   // The data
     8                   const pmConfig *config // Configuration
    99    )
    1010{
     
    2121    }
    2222
     23#if 0
    2324    // select the header unit for this cell
    2425    // XXX why is this needed for Cell but not Chip?
     
    3334        }
    3435    }
     36#endif
    3537
    3638    // Extract Header and Concept values from the Cell and Readout->analysis level
     
    4547    // Extract Header values
    4648    if (psListLength(data->headers)) {
    47         // extract from existing headers
    48         if (cell->hdu) {
    49             if (fits && !pmCellReadHeader(cell, fits)) {
    50                 psError (PS_ERR_IO, false, "trouble reading cell header\n");
    51                 psFree(cellResults);
    52                 return PS_EXIT_DATA_ERROR;
    53             }
    54             pmHDU *hdu = cell->hdu;     // HDU for headers
    55             p_ppStatsGetMetadata(cellResults, hdu->header, data->headers);
    56         }
    57         // extract from data->analysis output MD entries
    58         if (psListLength(data->analysis)) {
    59             p_ppStatsGetAnalysis (cellResults, data->headers, cell->analysis, data->analysis);
    60         }
     49        // extract from existing headers
     50        if (cell->hdu) {
     51            if (fits && !pmCellReadHeader(cell, fits)) {
     52                psError (PS_ERR_IO, false, "trouble reading cell header\n");
     53                psFree(cellResults);
     54                return PS_EXIT_DATA_ERROR;
     55            }
     56            pmHDU *hdu = cell->hdu;     // HDU for headers
     57            p_ppStatsGetMetadata(cellResults, hdu->header, data->headers);
     58        }
     59        // extract from data->analysis output MD entries
     60        if (psListLength(data->analysis)) {
     61            p_ppStatsGetAnalysis (cellResults, data->headers, cell->analysis, data->analysis);
     62        }
    6163    }
    6264
     
    7476    // If we want to measure pixel statistics, we must read (or have) the pixel data
    7577    if (data->doStats || psListLength(data->summary)) {
    76         // Read the image pixel data
    77         if (fits && !pmCellRead(cell, fits, config->database)) {
    78             psError (PS_ERR_IO, false, "trouble reading cell data\n");
    79             psFree(cellResults);
    80             return PS_EXIT_DATA_ERROR;
    81         }
     78        // Read the image pixel data
     79        if (fits && !pmCellRead(cell, fits, config->database)) {
     80            psError (PS_ERR_IO, false, "trouble reading cell data\n");
     81            psFree(cellResults);
     82            return PS_EXIT_DATA_ERROR;
     83        }
    8284    }
    8385
    8486    // check if we can legitimately iterate to the readout level
    8587    psArray *readouts = cell->readouts; // Array of component readouts
    86     if (readouts->n == 0) {
    87         psLogMsg(__func__, PS_LOG_WARN, "No readouts present in cell %s --- skipping\n", cellName);
    88     }
    8988    if (view->readout >= readouts->n) {
    90         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Desired readout view (%d) doesn't match "
    91                 "number of readouts (%ld)\n", view->readout, readouts->n);
    92         return PS_EXIT_CONFIG_ERROR;
     89        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Desired readout view (%d) doesn't match "
     90                "number of readouts (%ld)\n", view->readout, readouts->n);
     91        return PS_EXIT_CONFIG_ERROR;
    9392    }
    9493    if ((view->readout == -1) && (readouts->n > 1)) {
    95         psLogMsg(__func__, PS_LOG_WARN, "Multiple readouts (%ld) present in cell %s\n", readouts->n, cellName);
     94        psWarning("Multiple readouts (%ld) present in cell %s\n", readouts->n, cellName);
    9695    }
    9796
    9897    // Iterate over readouts
    9998    for (int i = 0; i < readouts->n; i++) {
    100         if ((view->readout >= 0) && (i != view->readout)) continue;
     99        if ((view->readout >= 0) && (i != view->readout)) continue;
    101100        pmReadout *readout = readouts->data[i];  // Cell of interest
    102101        psExit result = ppStatsReadout(cellResults, readout, i, data, config);
Note: See TracChangeset for help on using the changeset viewer.