Changeset 23989 for trunk/psphot/src
- Timestamp:
- Apr 28, 2009, 11:21:56 AM (17 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 6 edited
-
psphotApResid.c (modified) (2 diffs)
-
psphotChoosePSF.c (modified) (2 diffs)
-
psphotDiagnosticPlots.c (modified) (3 diffs)
-
psphotImageQuality.c (modified) (1 diff)
-
psphotMakeResiduals.c (modified) (2 diffs)
-
psphotRoughClass.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotApResid.c
r21519 r23989 355 355 356 356 if (j > 2) { 357 bool status = true; 358 status &= psVectorStats (statsS, dASubset, NULL, mkSubset, 0xff); 359 status &= psVectorStats (statsM, dMSubset, NULL, mkSubset, 0xff); 360 if (!status) { psErrorClear (); } 357 if (!psVectorStats (statsS, dASubset, NULL, mkSubset, 0xff)) { 358 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 359 return false; 360 } 361 if (!psVectorStats (statsM, dMSubset, NULL, mkSubset, 0xff)) { 362 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 363 return false; 364 } 361 365 dSo->data.F32[i] = statsS->robustStdev; 362 366 dMo->data.F32[i] = statsM->sampleMean; 363 367 dRo->data.F32[i] = statsS->robustStdev / statsM->sampleMean; 364 // fprintf (stderr, "%d (%d) : sys: %f, phot: %f, rat: %f\n", i, j, dSo->data.F32[i], dMo->data.F32[i], dRo->data.F32[i]);365 368 } else { 366 369 dSo->data.F32[i] = NAN; … … 375 378 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN); 376 379 if (!psVectorStats (stats, dRo, NULL, NULL, 0)) { 377 // XXX better testing of raised error 378 psErrorClear();380 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 381 return false; 379 382 } 380 383 -
trunk/psphot/src/psphotChoosePSF.c
r21183 r23989 361 361 362 362 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV | PS_STAT_SAMPLE_QUARTILE); 363 psVectorStats (stats, fwhmMajor, NULL, NULL, 0); 363 if (!psVectorStats (stats, fwhmMajor, NULL, NULL, 0)) { 364 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for FWHM MAJOR"); 365 return false; 366 } 367 364 368 psMetadataAddF32 (recipe, PS_LIST_TAIL, "FWHM_MAJ", PS_META_REPLACE, "PSF FWHM Major axis (mean)", stats->sampleMean); 365 369 psMetadataAddF32 (recipe, PS_LIST_TAIL, "FW_MJ_SG", PS_META_REPLACE, "PSF FWHM Major axis (sigma)", stats->sampleStdev); … … 367 371 psMetadataAddF32 (recipe, PS_LIST_TAIL, "FW_MJ_UQ", PS_META_REPLACE, "PSF FWHM Major axis (upper quartile)", stats->sampleUQ); 368 372 369 psVectorStats (stats, fwhmMinor, NULL, NULL, 0); 373 if (!psVectorStats (stats, fwhmMinor, NULL, NULL, 0)) { 374 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for FWHM MINOR"); 375 return false; 376 } 370 377 psMetadataAddF32 (recipe, PS_LIST_TAIL, "FWHM_MIN", PS_META_REPLACE, "PSF FWHM Minor axis (mean)", stats->sampleMean); 371 378 psMetadataAddF32 (recipe, PS_LIST_TAIL, "FW_MN_SG", PS_META_REPLACE, "PSF FWHM Minor axis (sigma)", stats->sampleStdev); -
trunk/psphot/src/psphotDiagnosticPlots.c
r21108 r23989 40 40 41 41 psStats *stats = psStatsAlloc (PS_STAT_MAX | PS_STAT_MIN); 42 psVectorStats (stats, values, NULL, NULL, 0); 42 if (!psVectorStats (stats, values, NULL, NULL, 0)) { 43 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for histogram"); 44 return false; 45 } 43 46 44 47 psHistogram *histogram = psHistogramAlloc (stats->min, stats->max, 1000); … … 63 66 psStatsInit (stats); 64 67 stats->options = PS_STAT_MAX | PS_STAT_MIN; 65 psVectorStats (stats, histogram->nums, NULL, NULL, 0); 68 if (!psVectorStats (stats, histogram->nums, NULL, NULL, 0)) { 69 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for histogram"); 70 return false; 71 } 66 72 67 73 // scale the plot to hold the histogram … … 100 106 psStatsInit (stats); 101 107 stats->options = PS_STAT_MAX | PS_STAT_MIN; 102 psVectorStats (stats, histogram->nums, NULL, NULL, 0); 108 if (!psVectorStats (stats, histogram->nums, NULL, NULL, 0)) { 109 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for histogram"); 110 return false; 111 } 103 112 104 113 // scale the plot to hold the histogram -
trunk/psphot/src/psphotImageQuality.c
r20471 r23989 88 88 "Number of stars used for IQ measurements", M2->n); 89 89 90 // XXX make this a recipe option 90 91 #if (USE_SAMPLE) 91 92 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV | PS_STAT_SAMPLE_QUARTILE); -
trunk/psphot/src/psphotMakeResiduals.c
r21366 r23989 200 200 // measure the robust median to determine a baseline reference value 201 201 *fluxClip = *fluxClipDef; 202 psVectorStats (fluxClip, fluxes, NULL, fmasks, fmaskVal); 203 psErrorClear(); // clear (ignore) any outstanding errors 202 if (!psVectorStats (fluxClip, fluxes, NULL, fmasks, fmaskVal)) { 203 psError(PSPHOT_ERR_CONFIG, false, "Error calculating residual stats"); 204 return false; 205 } 206 if (isnan(fluxClip->robustMedian)) { 207 resid->Ro->data.F32[oy][ox] = 0.0; 208 resid->Rx->data.F32[oy][ox] = 0.0; 209 resid->Ry->data.F32[oy][ox] = 0.0; 210 resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox] = badMask; 211 continue; 212 } 204 213 205 214 // mark input pixels which are more than N sigma from the median … … 220 229 // measure the desired statistic on the unclipped pixels 221 230 *fluxStats = *fluxStatsDef; 222 psVectorStats (fluxStats, fluxes, NULL, fmasks, fmaskVal); 223 psErrorClear(); // clear (ignore) any outstanding errors 231 if (!psVectorStats (fluxStats, fluxes, NULL, fmasks, fmaskVal)) { 232 psError(PSPHOT_ERR_CONFIG, false, "Error calculating residual stats"); 233 return false; 234 } 224 235 225 236 resid->Ro->data.F32[oy][ox] = psStatsGetValue(fluxStats, statOption); 226 237 resid->Rx->data.F32[oy][ox] = resid->Ry->data.F32[oy][ox] = 0.0; 227 //resid->variance->data.F32[oy][ox] = fluxStats->sampleStdev; 238 239 if (isnan(resid->Ro->data.F32[oy][ox])) { 240 resid->Ro->data.F32[oy][ox] = 0.0; 241 resid->Rx->data.F32[oy][ox] = 0.0; 242 resid->Ry->data.F32[oy][ox] = 0.0; 243 resid->mask->data.PM_TYPE_RESID_MASK_DATA[oy][ox] = badMask; 244 continue; 245 } 228 246 229 247 if (fabs(resid->Ro->data.F32[oy][ox]) < pixelSN*fluxStats->sampleStdev/sqrt(nKeep)) { -
trunk/psphot/src/psphotRoughClass.c
r21183 r23989 91 91 return false; 92 92 } 93 if (!psfClump.X || !psfClump.Y ) {93 if (!psfClump.X || !psfClump.Y || isnan(psfClump.X) || isnan(psfClump.Y)) { 94 94 psLogMsg ("psphot", 4, "Failed to find a valid PSF clump for region %f,%f - %f,%f\n", region->x0, region->y0, region->x1, region->y1); 95 95 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
