Changeset 23989 for trunk/psModules/src/detrend/pmFringeStats.c
- Timestamp:
- Apr 28, 2009, 11:21:56 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/detrend/pmFringeStats.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmFringeStats.c
r23259 r23989 882 882 883 883 psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_QUARTILE); // Statistics 884 psVectorStats(stats, diffs, NULL, mask, 1); 884 if (!psVectorStats(stats, diffs, NULL, mask, 1)) { 885 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 886 return 0; 887 } 885 888 float middle = stats->sampleMedian; // The middle of the distribution 886 889 float thresh = rej * 0.74 * (stats->sampleUQ - stats->sampleLQ); // The rejection threshold … … 969 972 970 973 // Get rid of the extreme outliers by assuming most of the points are somewhat clustered 971 psVectorStats(median, science->f, NULL, NULL, 0); 974 if (!psVectorStats(median, science->f, NULL, NULL, 0)) { 975 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 976 return NULL; 977 } 972 978 scale->coeff->data.F32[0] = median->sampleMedian; 973 979 for (int i = 0; i < fringes->n; i++) { 974 980 pmFringeStats *fringe = fringes->data[i]; // The fringe of interest 975 psVectorStats(median, fringe->f, NULL, NULL, 0); 981 if (!psVectorStats(median, fringe->f, NULL, NULL, 0)) { 982 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 983 return NULL; 984 } 976 985 scale->coeff->data.F32[0] -= median->sampleMedian; 977 986 scale->coeff->data.F32[i] = 0.0;
Note:
See TracChangeset
for help on using the changeset viewer.
