Changeset 23989 for trunk/psModules/src/detrend/pmOverscan.c
- Timestamp:
- Apr 28, 2009, 11:21:56 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/detrend/pmOverscan.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmOverscan.c
r23826 r23989 74 74 mask->data.PS_TYPE_VECTOR_MASK_DATA[i] = 0; 75 75 ordinate->data.F32[i] = 2.0*(float)i/(float)pixels->n - 1.0; // Scale to [-1,1] 76 psVectorStats(myStats, values, NULL, NULL, 0); 76 if (!psVectorStats(myStats, values, NULL, NULL, 0)) { 77 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 78 return false; 79 } 77 80 reduced->data.F32[i] = psStatsGetValue(myStats, statistic); 78 81 } else if (overscanOpts->fitType == PM_FIT_NONE) { … … 275 278 psFree(iter); 276 279 277 (void)psVectorStats(stats, pixels, NULL, NULL, 0); 280 if (!psVectorStats(stats, pixels, NULL, NULL, 0)) { 281 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 282 return false; 283 } 278 284 psFree(pixels); 279 285 double reduced = psStatsGetValue(stats, statistic); // Result of statistics … … 349 355 psString comment = NULL; // Comment to add 350 356 psStats *vectorStats = psStatsAlloc (PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV); 351 psVectorStats (vectorStats, reduced, NULL, NULL, 0); 357 if (!psVectorStats (vectorStats, reduced, NULL, NULL, 0)) { 358 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 359 return false; 360 } 352 361 psStringAppend(&comment, "Mean Overscan value: %f", vectorStats->sampleMean); 353 362 psMetadataAddStr(hdu->header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, comment, ""); … … 412 421 psString comment = NULL; // Comment to add 413 422 psStats *vectorStats = psStatsAlloc (PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV); 414 psVectorStats (vectorStats, reduced, NULL, NULL, 0); 423 if (!psVectorStats (vectorStats, reduced, NULL, NULL, 0)) { 424 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 425 return false; 426 } 415 427 psStringAppend(&comment, "Mean Overscan value: %f", vectorStats->sampleMean); 416 428 psMetadataAddStr(hdu->header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, comment, "");
Note:
See TracChangeset
for help on using the changeset viewer.
