Changeset 21183 for trunk/ppStats
- Timestamp:
- Jan 26, 2009, 8:40:07 PM (17 years ago)
- Location:
- trunk/ppStats/src
- Files:
-
- 5 edited
-
ppStats.h (modified) (4 diffs)
-
ppStatsFPA.c (modified) (1 diff)
-
ppStatsMetadata.c (modified) (1 diff)
-
ppStatsPixels.c (modified) (1 diff)
-
ppStatsReadout.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStats/src/ppStats.h
r19626 r21183 24 24 bool doFirstReadout3D; // for 3D data, use the first readout? 25 25 float sample; // Fraction of cell to sample for statistics 26 ps MaskType maskVal;// Mask value for images26 psImageMaskType maskVal; // Mask value for images 27 27 psList *chips; // Chips to look at 28 28 psList *cells; // Cells to look at … … 45 45 pmFPA *fpa, // FPA for which to get statistics 46 46 pmFPAview *view, // View for analysis 47 ps MaskType maskVal, // Value to mask47 psImageMaskType maskVal, // Value to mask 48 48 pmConfig *config // Configuration 49 49 ); … … 77 77 pmFPA *fpa, // FPA for which to get statistics 78 78 pmFPAview *view, // View for analysis 79 ps MaskType maskVal, // Value to mask79 psImageMaskType maskVal, // Value to mask 80 80 pmConfig *config // Configuration 81 81 ); … … 85 85 pmFPA *fpa, // FPA for which to get statistics 86 86 pmFPAview *view, // View for analysis 87 ps MaskType maskVal, // Value to mask87 psImageMaskType maskVal, // Value to mask 88 88 pmConfig *config // Configuration 89 89 ); -
trunk/ppStats/src/ppStatsFPA.c
r18558 r21183 4 4 pmFPA *fpa, // FPA for which to get statistics 5 5 pmFPAview *view, // View for analysis 6 ps MaskType maskVal, // Value to mask6 psImageMaskType maskVal, // Value to mask 7 7 pmConfig *config // Configuration 8 8 ) -
trunk/ppStats/src/ppStatsMetadata.c
r18558 r21183 5 5 pmFPA *fpa, // FPA for which to get statistics 6 6 pmFPAview *view, // View for analysis 7 ps MaskType maskVal, // Value to mask7 psImageMaskType maskVal, // Value to mask 8 8 pmConfig *config // Configuration 9 9 ) -
trunk/ppStats/src/ppStatsPixels.c
r18558 r21183 5 5 pmFPA *fpa, // FPA for which to get statistics 6 6 pmFPAview *view, // View for analysis 7 ps MaskType maskVal, // Value to mask7 psImageMaskType maskVal, // Value to mask 8 8 pmConfig *config // Configuration 9 9 ) -
trunk/ppStats/src/ppStatsReadout.c
r19355 r21183 63 63 int sampleSpace = 1.0 / data->sample; // Space between samples 64 64 psVector *sampleValues = psVectorAlloc(numSamples, PS_TYPE_F32); // Vector of samples 65 psVector *sampleMask = psVectorAlloc(numSamples, PS_TYPE_MASK); // Corresponding mask 66 if (!mask) { 67 psVectorInit(sampleMask, 0); 68 } 65 psVector *sampleMask = psVectorAlloc(numSamples, PS_TYPE_VECTOR_MASK); // Corresponding mask 66 psVectorInit(sampleMask, 0); 67 69 68 for (int i = 0; i < numSamples; i++) { 70 69 int j = i * sampleSpace; … … 72 71 int x = j % image->numCols; 73 72 sampleValues->data.F32[i] = image->data.F32[y][x]; 74 if ((!mask || !(mask->data.PS_TYPE_MASK_DATA[y][x] & data->maskVal)) && 75 !isfinite(sampleValues->data.F32[i])) { 76 if (!warnNonFinite) { 77 psWarning("Unmasked non-finite value detected at %d,%d; suppressing further warnings", 78 x, y); 79 warnNonFinite = true; 80 } 81 sampleMask->data.PS_TYPE_MASK_DATA[i] = data->maskVal; 82 } else if (mask) { 83 sampleMask->data.PS_TYPE_MASK_DATA[i] = mask->data.PS_TYPE_MASK_DATA[y][x]; 84 } 85 } 86 if (!psVectorStats(data->stats, sampleValues, NULL, sampleMask, data->maskVal)) { 73 74 // ignore the sampleMask if there is no input mask 75 if (!mask) continue; 76 77 // if this pixel is masked, set the sample mask 78 if (mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & data->maskVal) { 79 sampleMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1; 80 continue; 81 } 82 83 // mask any unmasked NAN/INF values 84 if (!isfinite(sampleValues->data.F32[i])) { 85 // warn for the first unmasked NAN/INF value 86 if (!warnNonFinite) { 87 psWarning("Unmasked non-finite value detected at %d,%d; suppressing further warnings", x, y); 88 warnNonFinite = true; 89 } 90 sampleMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 1; 91 } 92 } 93 if (!psVectorStats(data->stats, sampleValues, NULL, sampleMask, 1)) { 87 94 psWarning("Unable to perform statistics on readout %s.\n", readoutName); 88 95 psErrorClear(); … … 179 186 for (int j = 0; j < readout->mask->numRows; j++) { 180 187 for (int i = 0; i < readout->mask->numCols; i++) { 181 if (readout->mask->data.PS_TYPE_ MASK_DATA[j][i] & data->maskVal) {188 if (readout->mask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] & data->maskVal) { 182 189 numBad++; 183 190 }
Note:
See TracChangeset
for help on using the changeset viewer.
