Changeset 18168
- Timestamp:
- Jun 17, 2008, 12:29:17 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
ppStack/src/ppStackLoop.c (modified) (4 diffs)
-
ppStats/src/ppStats.h (modified) (5 diffs)
-
ppStats/src/ppStatsCell.c (modified) (4 diffs)
-
ppStats/src/ppStatsChip.c (modified) (4 diffs)
-
ppStats/src/ppStatsLoop.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackLoop.c
r18102 r18168 431 431 432 432 if (!pmReadoutReadChunk(readout, imageFits->data[i], 0, numScans, overlap, 433 config ->database) ||433 config) || 434 434 !pmReadoutReadChunkMask(readout, maskFits->data[i], 0, numScans, overlap, 435 config ->database) ||435 config) || 436 436 !pmReadoutReadChunkWeight(readout, weightFits->data[i], 0, numScans, overlap, 437 config ->database)) {437 config)) { 438 438 psError(PS_ERR_IO, false, "Unable to read chunk %d for file %d", numChunk, i); 439 439 psFree(readouts); … … 474 474 continue; 475 475 } 476 more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans, config ->database);477 more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans, config ->database);478 more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans, config ->database);476 more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans, config); 477 more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans, config); 478 more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans, config); 479 479 } 480 480 } … … 554 554 assert(readout); 555 555 556 if (!pmReadoutReadChunk(readout, imageFits->data[i], 0, numScans, 0, config ->database) ||557 !pmReadoutReadChunkMask(readout, maskFits->data[i], 0, numScans, 0, config ->database) ||556 if (!pmReadoutReadChunk(readout, imageFits->data[i], 0, numScans, 0, config) || 557 !pmReadoutReadChunkMask(readout, maskFits->data[i], 0, numScans, 0, config) || 558 558 !pmReadoutReadChunkWeight(readout, weightFits->data[i], 0, numScans, 0, 559 config ->database)) {559 config)) { 560 560 psError(PS_ERR_IO, false, "Unable to read chunk %d for file %d", numChunk, i); 561 561 psFree(readouts); … … 597 597 continue; 598 598 } 599 more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans, config ->database);600 more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans, config ->database);601 more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans, config ->database);599 more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans, config); 600 more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans, config); 601 more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans, config); 602 602 } 603 603 } -
trunk/ppStats/src/ppStats.h
r14020 r18168 14 14 bool doStats; // Do pixel statistics? 15 15 bool fileLevel; // Output file level? 16 pmFPAview *fileView; // View to analyse16 pmFPAview *fileView; // View to analyse 17 17 18 18 psList *headers; // Headers to read … … 30 30 ppStatsData *ppStatsDataAlloc(void); 31 31 32 /// Perform the ppStats steps on the given FPA (optionally for specified view) 32 /// Perform the ppStats steps on the given FPA (optionally for specified view) 33 33 psMetadata *ppStatsFPA(psMetadata *out, 34 pmFPA *fpa, // FPA for which to get statistics35 pmFPAview *view, // View for analysis36 psMaskType maskVal, // Value to mask37 pmConfig *config // Configuration34 pmFPA *fpa, // FPA for which to get statistics 35 pmFPAview *view, // View for analysis 36 psMaskType maskVal, // Value to mask 37 pmConfig *config // Configuration 38 38 ); 39 39 40 40 psExit ppStatsChip(psMetadata *fpaResults, // Metadata holding the fpa results 41 pmChip *chip, // Chip for which to get statistics42 psFits *fits, // FITS file handle43 pmFPAview *view, // View for analysis44 ppStatsData *data,// The data45 constpmConfig *config // Configuration41 pmChip *chip, // Chip for which to get statistics 42 psFits *fits, // FITS file handle 43 pmFPAview *view, // View for analysis 44 ppStatsData *data,// The data 45 pmConfig *config // Configuration 46 46 ); 47 47 48 48 psExit ppStatsCell(psMetadata *chipResults, // Metadata holding the chip results 49 pmCell *cell, // Cell for which to get statistics50 psFits *fits, // FITS file handle51 pmFPAview *view, // View for analysis52 ppStatsData *data,// The data53 const pmConfig *config// Configuration49 pmCell *cell, // Cell for which to get statistics 50 psFits *fits, // FITS file handle 51 pmFPAview *view, // View for analysis 52 ppStatsData *data,// The data 53 pmConfig *config // Configuration 54 54 ); 55 55 … … 64 64 // measure only the pixel-related statistics (stats, summary) 65 65 psMetadata *ppStatsPixels(psMetadata *out, 66 pmFPA *fpa, // FPA for which to get statistics67 pmFPAview *view, // View for analysis68 psMaskType maskVal, // Value to mask69 pmConfig *config // Configuration66 pmFPA *fpa, // FPA for which to get statistics 67 pmFPAview *view, // View for analysis 68 psMaskType maskVal, // Value to mask 69 pmConfig *config // Configuration 70 70 ); 71 71 72 72 // measure only the non-pixel-related statistics (headers, concepts) 73 73 psMetadata *ppStatsMetadata(psMetadata *out, 74 pmFPA *fpa, // FPA for which to get statistics75 pmFPAview *view, // View for analysis76 psMaskType maskVal, // Value to mask77 pmConfig *config // Configuration74 pmFPA *fpa, // FPA for which to get statistics 75 pmFPAview *view, // View for analysis 76 psMaskType maskVal, // Value to mask 77 pmConfig *config // Configuration 78 78 ); 79 79 … … 81 81 psMetadata *ppStatsLoop(psExit *result, 82 82 ppStatsData *data, // The data 83 constpmConfig *config // Configuration83 pmConfig *config // Configuration 84 84 ); 85 85 … … 101 101 102 102 void p_ppStatsGetMetadata(psMetadata *target, // Target for metadata 103 psMetadata *source, // Source for metadata104 psList *list // List containing keywords103 psMetadata *source, // Source for metadata 104 psList *list // List containing keywords 105 105 ); 106 106 107 107 void p_ppStatsGetAnalysis(psMetadata *target, // Output Target for metadata 108 psList *headers, // List containing desired keywords109 psMetadata *source, // Input Source for metadata110 psList *list // List containing analysis blocks108 psList *headers, // List containing desired keywords 109 psMetadata *source, // Input Source for metadata 110 psList *list // List containing analysis blocks 111 111 ); 112 112 113 113 bool p_ppStatsDoThis(psList *toDoList, // List of things to do 114 const char *this // The name of "this"114 const char *this // The name of "this" 115 115 ); 116 116 117 117 void p_ppStatsAddToHierarchy(psMetadata *source, // Source to add 118 psMetadata *target, // Target to which to add119 const char *name, // Name of source120 const char *comment // Comment for source118 psMetadata *target, // Target to which to add 119 const char *name, // Name of source 120 const char *comment // Comment for source 121 121 ); 122 122 123 123 psExit ppStatsReadout(psMetadata *cellResults, // Metadata holding the chip results 124 pmReadout *readout,// Cell for which to get statistics125 int nReadout,// readout number126 ppStatsData *data,// The data127 const pmConfig *config // Configuration124 pmReadout *readout, // Cell for which to get statistics 125 int nReadout, // readout number 126 ppStatsData *data, // The data 127 const pmConfig *config // Configuration 128 128 ); 129 129 -
trunk/ppStats/src/ppStatsCell.c
r18137 r18168 6 6 pmFPAview *view, // View for analysis 7 7 ppStatsData *data, // The data 8 constpmConfig *config // Configuration8 pmConfig *config // Configuration 9 9 ) 10 10 { … … 49 49 // extract from existing headers 50 50 if (cell->hdu) { 51 if (fits && !pmCellReadHeader(cell, fits, config ->database)) {51 if (fits && !pmCellReadHeader(cell, fits, config)) { 52 52 psError (PS_ERR_IO, false, "trouble reading cell header\n"); 53 53 psFree(cellResults); … … 65 65 // Extract Concept values 66 66 if (psListLength(data->concepts) > 0) { 67 if (fits && cell->hdu && !pmCellReadHeader(cell, fits, config ->database)) {67 if (fits && cell->hdu && !pmCellReadHeader(cell, fits, config)) { 68 68 psError (PS_ERR_IO, false, "trouble reading cell header\n"); 69 69 psFree(cellResults); 70 70 return PS_EXIT_DATA_ERROR; 71 71 } 72 pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_ALL, false, config ->database);72 pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_ALL, false, config); 73 73 p_ppStatsGetMetadata(cellResults, cell->concepts, data->concepts); 74 74 } … … 77 77 if (data->doStats || psListLength(data->summary)) { 78 78 // Read the image pixel data 79 if (fits && !pmCellRead(cell, fits, config ->database)) {79 if (fits && !pmCellRead(cell, fits, config)) { 80 80 psError (PS_ERR_IO, false, "trouble reading cell data\n"); 81 81 psFree(cellResults); -
trunk/ppStats/src/ppStatsChip.c
r18137 r18168 2 2 3 3 psExit ppStatsChip(psMetadata *fpaResults, // Metadata holding the fpa results 4 pmChip *chip, // Chip for which to get statistics5 psFits *fits, // FITS file handle6 pmFPAview *view, // View for analysis7 ppStatsData *data,// The data8 constpmConfig *config // Configuration4 pmChip *chip, // Chip for which to get statistics 5 psFits *fits, // FITS file handle 6 pmFPAview *view, // View for analysis 7 ppStatsData *data,// The data 8 pmConfig *config // Configuration 9 9 ) 10 10 { … … 22 22 } 23 23 if (!chip->file_exists && !chip->data_exists) { 24 return PS_EXIT_SUCCESS;24 return PS_EXIT_SUCCESS; 25 25 } 26 26 … … 36 36 // Extract Header values 37 37 if (psListLength(data->headers)) { 38 // extract from existing headers39 if (chip->hdu) {40 if (fits && !pmChipReadHeader(chip, fits, config->database)) {41 psError (PS_ERR_IO, false, "trouble reading chip header\n");42 psFree(chipResults);43 return PS_EXIT_DATA_ERROR;44 }45 pmHDU *hdu = chip->hdu; // HDU for headers46 p_ppStatsGetMetadata(chipResults, hdu->header, data->headers);47 }48 // extract from data->analysis output MD entries49 if (psListLength(data->analysis)) {50 p_ppStatsGetAnalysis (chipResults, data->headers, chip->analysis, data->analysis);51 }38 // extract from existing headers 39 if (chip->hdu) { 40 if (fits && !pmChipReadHeader(chip, fits, config)) { 41 psError (PS_ERR_IO, false, "trouble reading chip header\n"); 42 psFree(chipResults); 43 return PS_EXIT_DATA_ERROR; 44 } 45 pmHDU *hdu = chip->hdu; // HDU for headers 46 p_ppStatsGetMetadata(chipResults, hdu->header, data->headers); 47 } 48 // extract from data->analysis output MD entries 49 if (psListLength(data->analysis)) { 50 p_ppStatsGetAnalysis (chipResults, data->headers, chip->analysis, data->analysis); 51 } 52 52 } 53 53 54 54 // Extract Concept values 55 55 if (psListLength(data->concepts) > 0) { 56 if (fits && chip->hdu && !pmChipReadHeader(chip, fits, config ->database)) {56 if (fits && chip->hdu && !pmChipReadHeader(chip, fits, config)) { 57 57 psError (PS_ERR_IO, false, "trouble reading chip header\n"); 58 58 psFree(chipResults); 59 59 return PS_EXIT_DATA_ERROR; 60 60 } 61 pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_ALL, false, false, config ->database);61 pmConceptsReadChip(chip, PM_CONCEPT_SOURCE_ALL, false, false, config); 62 62 p_ppStatsGetMetadata(chipResults, chip->concepts, data->concepts); 63 63 } … … 73 73 // Iterate over cells (if view->cell is set, skip all others) 74 74 for (int i = 0; i < cells->n; i++) { 75 if ((view->cell >= 0) && (i != view->cell)) continue; 75 if ((view->cell >= 0) && (i != view->cell)) continue; 76 76 pmCell *cell = cells->data[i]; // Cell of interest 77 77 psExit result = ppStatsCell(chipResults, cell, fits, view, data, config); -
trunk/ppStats/src/ppStatsLoop.c
r18167 r18168 3 3 psMetadata *ppStatsLoop(psExit *result, 4 4 ppStatsData *data, // The data 5 constpmConfig *config // Configuration5 pmConfig *config // Configuration 6 6 ) 7 7 {
Note:
See TracChangeset
for help on using the changeset viewer.
