Changeset 23989 for trunk/psModules/src/objects
- Timestamp:
- Apr 28, 2009, 11:21:56 AM (17 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 6 edited
-
models/pmModel_SGAUSS.c (modified) (1 diff)
-
pmGrowthCurveGenerate.c (modified) (2 diffs)
-
pmPSFtry.c (modified) (5 diffs)
-
pmSource.c (modified) (3 diffs)
-
pmSourceFitModel.c (modified) (1 diff)
-
pmSourceMatch.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/models/pmModel_SGAUSS.c
r15834 r23989 325 325 326 326 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN); 327 psVectorStats (stats, contour, NULL, NULL, 0); 327 if (!psVectorStats (stats, contour, NULL, NULL, 0)) { 328 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 329 return false; 330 } 328 331 value = stats->sampleMedian; 329 332 -
trunk/psModules/src/objects/pmGrowthCurveGenerate.c
r21183 r23989 89 89 psVectorAppend (values, growth->fitMag); 90 90 } 91 psVectorStats (stats, values, NULL, NULL, 0); 91 if (!psVectorStats (stats, values, NULL, NULL, 0)) { 92 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 93 return false; 94 } 92 95 psf->growth->fitMag = stats->sampleMedian; 93 96 … … 104 107 psVectorAppend (values, growth->apMag->data.F32[i]); 105 108 } 106 psVectorStats (stats, values, NULL, NULL, 0); 109 if (!psVectorStats (stats, values, NULL, NULL, 0)) { 110 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 111 return false; 112 } 107 113 psf->growth->apMag->data.F32[i] = stats->sampleMedian; 108 114 } -
trunk/psModules/src/objects/pmPSFtry.c
r21183 r23989 211 211 212 212 if (Next == 0) { 213 psError(PS_ERR_UNKNOWN, true, "No sources with good extended fits from which to determine PSF.");213 psError(PS_ERR_UNKNOWN, false, "No sources with good extended fits from which to determine PSF."); 214 214 psFree(psfTry); 215 215 return NULL; … … 282 282 283 283 if (Npsf == 0) { 284 psError(PS_ERR_UNKNOWN, true, "No sources with good PSF fits after model is built.");284 psError(PS_ERR_UNKNOWN, false, "No sources with good PSF fits after model is built."); 285 285 psFree(psfTry); 286 286 return NULL; … … 643 643 } 644 644 if (entryMin == -1) { 645 psError (PS_ERR_UNKNOWN, true, "failed to find image map for shape params");645 psError (PS_ERR_UNKNOWN, false, "failed to find image map for shape params"); 646 646 return false; 647 647 } … … 958 958 float dEsquare = 0.0; 959 959 psStatsInit (stats); 960 psVectorStats (stats, e0res, NULL, mask, maskValue); 960 if (!psVectorStats (stats, e0res, NULL, mask, maskValue)) { 961 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 962 return false; 963 } 961 964 dEsquare += PS_SQR(psStatsGetValue(stats, stdevOpt)); 962 965 963 966 psStatsInit (stats); 964 psVectorStats (stats, e1res, NULL, mask, maskValue); 967 if (!psVectorStats (stats, e1res, NULL, mask, maskValue)) { 968 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 969 return false; 970 } 965 971 dEsquare += PS_SQR(psStatsGetValue(stats, stdevOpt)); 966 972 967 973 psStatsInit (stats); 968 psVectorStats (stats, e2res, NULL, mask, maskValue); 974 if (!psVectorStats (stats, e2res, NULL, mask, maskValue)) { 975 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 976 return false; 977 } 969 978 dEsquare += PS_SQR(psStatsGetValue(stats, stdevOpt)); 970 979 … … 1018 1027 float dEsquare = 0.0; 1019 1028 psStatsInit (statsS); 1020 psVectorStats (statsS, dE0subset, NULL, mkSubset, 0xff); 1029 if (!psVectorStats (statsS, dE0subset, NULL, mkSubset, 0xff)) { 1030 } 1021 1031 dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt)); 1022 1032 1023 1033 psStatsInit (statsS); 1024 psVectorStats (statsS, dE1subset, NULL, mkSubset, 0xff); 1025 dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt)); 1034 if (!psVectorStats (statsS, dE1subset, NULL, mkSubset, 0xff)) { 1035 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 1036 return false; 1037 } 1038 dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt)); 1026 1039 1027 1040 psStatsInit (statsS); 1028 psVectorStats (statsS, dE2subset, NULL, mkSubset, 0xff); 1041 if (!psVectorStats (statsS, dE2subset, NULL, mkSubset, 0xff)) { 1042 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 1043 return false; 1044 } 1029 1045 dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt)); 1030 1046 -
trunk/psModules/src/objects/pmSource.c
r23187 r23989 479 479 stats = psStatsAlloc (PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV); 480 480 481 psVectorStats (stats, tmpSx, NULL, NULL, 0); 481 if (!psVectorStats (stats, tmpSx, NULL, NULL, 0)) { 482 psError(PS_ERR_UNKNOWN, false, "failed to measure Sx stats"); 483 return (emptyClump); 484 } 482 485 psfClump.X = stats->clippedMean; 483 486 psfClump.dX = stats->clippedStdev; 484 487 485 psVectorStats (stats, tmpSy, NULL, NULL, 0); 488 if (!psVectorStats (stats, tmpSy, NULL, NULL, 0)) { 489 psError(PS_ERR_UNKNOWN, false, "failed to measure Sy stats"); 490 return (emptyClump); 491 } 486 492 psfClump.Y = stats->clippedMean; 487 493 psfClump.dY = stats->clippedStdev; … … 636 642 637 643 if (!psVectorStats (stats, starsn_moments, NULL, NULL, 0)) { 638 // Don't care about this error 639 psErrorClear(); 644 psError(PS_ERR_UNKNOWN, false, "failed to measure SN / moments stats"); 645 psFree (stats); 646 psFree (starsn_peaks); 647 return false; 640 648 } 641 649 psLogMsg ("pmObjects", 3, "SN range (moments): %f - %f\n", stats->min, stats->max); … … 648 656 stats = psStatsAlloc (PS_STAT_MIN | PS_STAT_MAX); 649 657 if (!psVectorStats (stats, starsn_peaks, NULL, NULL, 0)) { 650 // Don't care about this error 651 psErrorClear(); 658 psError(PS_ERR_UNKNOWN, false, "failed to measure SN / moments stats"); 659 psFree (stats); 660 psFree (starsn_peaks); 661 return false; 652 662 } 653 663 psLogMsg ("psModules.objects", 3, "SN range (peaks) : %f - %f (%ld)\n", -
trunk/psModules/src/objects/pmSourceFitModel.c
r23187 r23989 172 172 fitStatus = psMinimizeLMChi2(myMin, covar, params, constraint, x, y, yErr, model->modelFunc); 173 173 for (int i = 0; i < dparams->n; i++) { 174 if (psTraceGetLevel("psModules.objects") >= 4) {175 fprintf (stderr, "%f ", params->data.F32[i]);176 }177 174 if ((constraint->paramMask != NULL) && constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) 178 175 continue; 179 176 dparams->data.F32[i] = sqrt(covar->data.F32[i][i]); 177 if (psTraceGetLevel("psModules.objects") >= 4) { 178 fprintf (stderr, "%f +/- %f\n", params->data.F32[i], dparams->data.F32[i]); 179 } 180 180 } 181 181 psTrace ("psModules.objects", 4, "niter: %d, chisq: %f", myMin->iter, myMin->value); -
trunk/psModules/src/objects/pmSourceMatch.c
r23241 r23989 473 473 return -1; 474 474 } 475 // XXX handle this case better: 476 if (isnan(stats->clippedMean)) { 477 psError(PS_ERR_UNKNOWN, false, "Unable to perform statistics on transparencies."); 478 psFree(stats); 479 return -1; 480 } 475 481 476 482 float thresh = stats->clippedMean + photoLevel * stats->clippedStdev; // Threshold for clouds
Note:
See TracChangeset
for help on using the changeset viewer.
