Changeset 14149 for trunk/ppStats/src/ppStatsCell.c
- Timestamp:
- Jul 11, 2007, 4:28:22 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppStats/src/ppStatsCell.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStats/src/ppStatsCell.c
r14003 r14149 2 2 3 3 psExit ppStatsCell(psMetadata *chipResults, // Metadata holding the chip results 4 pmCell *cell,// Cell for which to get statistics5 psFits *fits,// FITS file handle6 pmFPAview *view, // View for analysis7 ppStatsData *data,// The data8 const pmConfig *config // Configuration4 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 9 9 ) 10 10 { … … 21 21 } 22 22 23 #if 0 23 24 // select the header unit for this cell 24 25 // XXX why is this needed for Cell but not Chip? … … 33 34 } 34 35 } 36 #endif 35 37 36 38 // Extract Header and Concept values from the Cell and Readout->analysis level … … 45 47 // Extract Header values 46 48 if (psListLength(data->headers)) { 47 // extract from existing headers48 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 headers55 p_ppStatsGetMetadata(cellResults, hdu->header, data->headers);56 }57 // extract from data->analysis output MD entries58 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 } 61 63 } 62 64 … … 74 76 // If we want to measure pixel statistics, we must read (or have) the pixel data 75 77 if (data->doStats || psListLength(data->summary)) { 76 // Read the image pixel data77 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 } 82 84 } 83 85 84 86 // check if we can legitimately iterate to the readout level 85 87 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 }89 88 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; 93 92 } 94 93 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); 96 95 } 97 96 98 97 // Iterate over readouts 99 98 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; 101 100 pmReadout *readout = readouts->data[i]; // Cell of interest 102 101 psExit result = ppStatsReadout(cellResults, readout, i, data, config);
Note:
See TracChangeset
for help on using the changeset viewer.
