Changeset 31437
- Timestamp:
- May 4, 2011, 4:37:26 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110404/psphot/src
- Files:
-
- 8 edited
-
psphotApResid.c (modified) (2 diffs)
-
psphotExtendedSourceFits.c (modified) (1 diff)
-
psphotMakeGrowthCurve.c (modified) (1 diff)
-
psphotOutput.c (modified) (1 diff)
-
psphotPetrosianStats.c (modified) (3 diffs)
-
psphotRadiusChecks.c (modified) (2 diffs)
-
psphotRoughClass.c (modified) (1 diff)
-
psphotSourceFits.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110404/psphot/src/psphotApResid.c
r31362 r31437 1 1 # include "psphotInternal.h" 2 //# define DEBUG2 # define DEBUG 3 3 4 4 # define SKIPSTAR(MSG) { psTrace ("psphot", 3, "invalid : %s", MSG); continue; } … … 328 328 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_META_REPLACE, "ap residual scatter", psf->dApResid); 329 329 psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_META_REPLACE, "number of apresid stars", psf->nApResid); 330 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APLOSS", PS_META_REPLACE, "aperture loss (mag)", psf->growth ? psf->growth->apLoss : NAN); 330 331 // curve-of-growth offset 332 if (psf->growth) { 333 float gaussSigma = psMetadataLookupF32(&status, readout->analysis, "MOMENTS_GAUSS_SIGMA"); 334 if (!status) { 335 gaussSigma = psMetadataLookupF32(&status, recipe, "MOMENTS_GAUSS_SIGMA"); 336 } 337 float apScale = psMetadataLookupF32(&status, recipe, "PSF_APERTURE_SCALE"); 338 float PSF_APERTURE = (int)(apScale*gaussSigma); 339 340 float offset = pmGrowthCurveCorrect (psf->growth, PSF_APERTURE); 341 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APLOSS", PS_META_REPLACE, "aperture loss (mag)", psf->growth->apLoss); 342 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APREFOFF", PS_META_REPLACE, "offset to ref aperture", offset); 343 } else { 344 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APLOSS", PS_META_REPLACE, "aperture loss (mag)", NAN); 345 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APREFOFF", PS_META_REPLACE, "offset to ref aperture", NAN); 346 } 331 347 332 348 psLogMsg ("psphot.apresid", PS_LOG_DETAIL, "aperture residual: %f +/- %f\n", psf->ApResid, psf->dApResid); -
branches/eam_branches/ipp-20110404/psphot/src/psphotExtendedSourceFits.c
r31362 r31437 379 379 assert (status); 380 380 381 // fprintf (stderr, "xfit: %f, %f : %f\n", source->peak->xf, source->peak->yf, source->peak->SN);382 383 381 // limit selection to some SN limit 384 assert (source->peak); // how can a source not have a peak?382 // assert (source->peak); // how can a source not have a peak? 385 383 if (sqrt(source->peak->detValue) < SNlim) { 386 384 Nfaint ++; -
branches/eam_branches/ipp-20110404/psphot/src/psphotMakeGrowthCurve.c
r31384 r31437 34 34 psf->growth = pmGrowthCurveAlloc (PSF_FIT_PAD, 100.0, REF_RADIUS); 35 35 36 # if (0) 37 bool IGNORE_GROWTH = psMetadataLookupBool (&status, recipe, "IGNORE_GROWTH"); 38 if (!pmGrowthCurveGenerate (readout, psf, IGNORE_GROWTH, maskVal, markVal)) { 39 psError(PSPHOT_ERR_APERTURE, false, "Fitting aperture corrections"); 40 psFree(psf->growth); psf->growth = NULL; 41 return false; 36 bool GROWTH_FROM_SOURCES = psMetadataLookupBool (&status, recipe, "GROWTH_FROM_SOURCES"); 37 if (!status) GROWTH_FROM_SOURCES = false; 38 39 if (GROWTH_FROM_SOURCES) { 40 bool INTERPOLATE_AP = psMetadataLookupBool (&status, recipe, "INTERPOLATE_AP"); 41 if (!pmGrowthCurveGenerateFromSources (readout, psf, sources, INTERPOLATE_AP, maskVal, markVal)) { 42 psError(PSPHOT_ERR_APERTURE, false, "Fitting aperture corrections"); 43 psFree(psf->growth); psf->growth = NULL; 44 return false; 45 } 46 47 } else { 48 bool IGNORE_GROWTH = psMetadataLookupBool (&status, recipe, "IGNORE_GROWTH"); 49 if (!pmGrowthCurveGenerate (readout, psf, IGNORE_GROWTH, maskVal, markVal)) { 50 psError(PSPHOT_ERR_APERTURE, false, "Fitting aperture corrections"); 51 psFree(psf->growth); psf->growth = NULL; 52 return false; 53 } 42 54 } 43 # else44 bool INTERPOLATE_AP = psMetadataLookupBool (&status, recipe, "INTERPOLATE_AP");45 if (!pmGrowthCurveGenerateFromSources (readout, psf, sources, INTERPOLATE_AP, maskVal, markVal)) {46 psError(PSPHOT_ERR_APERTURE, false, "Fitting aperture corrections");47 psFree(psf->growth); psf->growth = NULL;48 return false;49 }50 # endif51 55 52 56 psLogMsg ("psphot", PS_LOG_MINUTIA, "built growth curve: %f sec\n", psTimerMark ("psphot.growth")); -
branches/eam_branches/ipp-20110404/psphot/src/psphotOutput.c
r31362 r31437 251 251 psMetadataItemSupplement (&status, header, analysis, "NPSFSTAR"); 252 252 psMetadataItemSupplement (&status, header, analysis, "APLOSS"); 253 psMetadataItemSupplement (&status, header, analysis, "APREFOFF"); 253 254 254 255 psMetadataItemSupplement (&status, header, analysis, "FWHM_MAJ"); -
branches/eam_branches/ipp-20110404/psphot/src/psphotPetrosianStats.c
r31154 r31437 163 163 if (refRadius->data.F32[i] > apRadius) { 164 164 if (i == 0) { 165 psWarning ("does this case make any sense? (refRadius[0] > apRadius)");165 psWarning ("does this case make any sense? (refRadius[0] %f > apRadius %f)", refRadius->data.F32[i], apRadius); 166 166 continue; 167 167 } else { … … 188 188 if (!found50 && (fluxSum->data.F32[i] > flux50)) { 189 189 if (i == 0) { 190 psWarning ("does this case make any sense? (fluxSum[0] > flux50)");190 psWarning ("does this case make any sense? (fluxSum[0] %f > flux50 %f)", fluxSum->data.F32[i], flux50); 191 191 continue; 192 192 } else { … … 198 198 if (!found90 && (fluxSum->data.F32[i] > flux90)) { 199 199 if (i == 0) { 200 psWarning ("does this case make any sense? (fluxSum[0] > flux90)");200 psWarning ("does this case make any sense? (fluxSum[0] %f > flux90 %f)", fluxSum->data.F32[i], flux90); 201 201 continue; 202 202 } else { -
branches/eam_branches/ipp-20110404/psphot/src/psphotRadiusChecks.c
r29936 r31437 184 184 bool psphotSetRadiusModel (pmModel *model, pmReadout *readout, pmSource *source, psImageMaskType markVal, bool deep) { 185 185 186 psF32 *PAR = model->params->data.F32; 187 188 pmMoments *moments = source->moments; 189 if (moments == NULL) return false; 186 pmPeak *peak = source->peak; 190 187 191 188 // set the fit radius based on the object flux limit and the model … … 199 196 200 197 // redefine the pixels if needed 201 pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius);202 203 // set the mask to flag the excluded pixels 204 psImageKeepCircle (source->maskObj, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius, "OR", markVal);205 return true; 206 } 198 pmSourceRedefinePixels (source, readout, peak->xf, peak->yf, model->fitRadius); 199 200 // set the mask to flag the excluded pixels 201 psImageKeepCircle (source->maskObj, peak->xf, peak->yf, model->fitRadius, "OR", markVal); 202 return true; 203 } -
branches/eam_branches/ipp-20110404/psphot/src/psphotRoughClass.c
r31154 r31437 207 207 return false; 208 208 } 209 psLogMsg ("psphot", 3, "psf clump X, Y: %f, %f : DX, DY: %f, %f : nStars %d of %d\n", psfClump.X, psfClump.Y, psfClump.dX, psfClump.dY, psfClump.nStars, psfClump.nTotal); 209 if (!havePSF) { 210 psLogMsg ("psphot", 3, "psf clump X, Y: %f, %f : DX, DY: %f, %f : nStars %d of %d\n", psfClump.X, psfClump.Y, psfClump.dX, psfClump.dY, psfClump.nStars, psfClump.nTotal); 211 } else { 212 psLogMsg ("psphot", 3, "psf clump X, Y: %f, %f : DX, DY: %f, %f : loaded from metadata\n", psfClump.X, psfClump.Y, psfClump.dX, psfClump.dY); 213 } 210 214 211 215 // get basic parameters, or set defaults -
branches/eam_branches/ipp-20110404/psphot/src/psphotSourceFits.c
r31362 r31437 493 493 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 5); 494 494 pmSourceFitModel (source, model, &options, maskVal); 495 // fprintf (stderr, "chisq: %f, nIter: %d, radius: %f, npix: %d\n \n", model->chisqNorm, model->nIter, model->fitRadius, model->nPix);495 // fprintf (stderr, "chisq: %f, nIter: %d, radius: %f, npix: %d\n", model->chisqNorm, model->nIter, model->fitRadius, model->nPix); 496 496 497 497 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0); … … 558 558 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 5); 559 559 pmSourceFitPCM (pcm, source, &options, maskVal, markVal, psfSize); 560 // fprintf (stderr, "chisq: %f, nIter: %d, radius: %f, npix: %d\n \n", model->chisqNorm, model->nIter, model->fitRadius, model->nPix);560 // fprintf (stderr, "chisq: %f, nIter: %d, radius: %f, npix: %d\n", model->chisqNorm, model->nIter, model->fitRadius, model->nPix); 561 561 562 562 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0);
Note:
See TracChangeset
for help on using the changeset viewer.
