Changeset 34258
- Timestamp:
- Jul 31, 2012, 3:58:10 PM (14 years ago)
- Location:
- trunk/psphot
- Files:
-
- 12 edited
- 2 copied
-
. (modified) (1 prop)
-
src (modified) (2 props)
-
src/Makefile.am (modified) (3 diffs)
-
src/psphot.h (modified) (2 diffs)
-
src/psphotBlendFit.c (modified) (1 diff)
-
src/psphotExtendedSourceFits.c (modified) (2 diffs)
-
src/psphotForced.c (modified) (1 diff)
-
src/psphotImageLoop.c (modified) (1 diff)
-
src/psphotMinimal.c (copied) (copied from branches/eam_branches/ipp-20120627/psphot/src/psphotMinimal.c )
-
src/psphotMinimalArguments.c (copied) (copied from branches/eam_branches/ipp-20120627/psphot/src/psphotMinimalArguments.c )
-
src/psphotReadoutMinimal.c (modified) (2 diffs)
-
src/psphotSourceFits.c (modified) (2 diffs)
-
src/psphotSourceSize.c (modified) (2 diffs)
-
src/psphotStackImageLoop.c (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20120627/psphot (added) merged: 34139,34146,34172,34179,34190,34240,34247,34255
- Property svn:mergeinfo changed
-
trunk/psphot/src
- Property svn:ignore
-
old new 23 23 psphotStack 24 24 psphotModelTest 25 psphotMinimal
-
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20120627/psphot/src (added) merged: 34139,34146,34172,34179,34190,34240,34247,34255
- Property svn:ignore
-
trunk/psphot/src/Makefile.am
r34086 r34258 25 25 libpsphot_la_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 26 26 27 bin_PROGRAMS = psphot psphotForced psphotM akePSF psphotStack psphotModelTest27 bin_PROGRAMS = psphot psphotForced psphotMinimal psphotMakePSF psphotStack psphotModelTest 28 28 # bin_PROGRAMS = psphotPetrosianStudy psphotTest psphotMomentsStudy 29 29 … … 35 35 psphotForced_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 36 36 psphotForced_LDADD = libpsphot.la 37 38 psphotMinimal_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) 39 psphotMinimal_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 40 psphotMinimal_LDADD = libpsphot.la 37 41 38 42 psphotMakePSF_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) … … 73 77 psphotForced.c \ 74 78 psphotForcedArguments.c \ 79 psphotParseCamera.c \ 80 psphotImageLoop.c \ 81 psphotMosaicChip.c \ 82 psphotCleanup.c 83 84 # forced photometry of specified positions given a specified psf 85 psphotMinimal_SOURCES = \ 86 psphotMinimal.c \ 87 psphotMinimalArguments.c \ 75 88 psphotParseCamera.c \ 76 89 psphotImageLoop.c \ -
trunk/psphot/src/psphot.h
r34226 r34258 20 20 PSPHOT_MAKE_PSF, 21 21 PSPHOT_MODEL_TEST, 22 PSPHOT_MINIMAL, 22 23 } psphotImageLoopMode; 23 24 … … 332 333 bool psphotForcedReadout(pmConfig *config, const pmFPAview *view, const char *filerule); 333 334 335 pmConfig *psphotMinimalArguments(int argc, char **argv); 336 bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view, const char *filerule); 337 334 338 pmConfig *psphotMakePSFArguments(int argc, char **argv); 335 339 bool psphotMakePSFReadout(pmConfig *config, const pmFPAview *view, const char *filerule); -
trunk/psphot/src/psphotBlendFit.c
r33089 r34258 61 61 if (!status) { 62 62 nThreads = 0; 63 } 64 65 // do not thread if we are trying to study the fitting process 66 if (psTraceGetLevel ("psphot.psphotFitEXT") >= 6) { 67 nThreads = 0; 63 68 } 64 69 -
trunk/psphot/src/psphotExtendedSourceFits.c
r34218 r34258 77 77 if (!status) { 78 78 nThreads = 0; 79 } 80 // do not thread if we are trying to study the fitting process 81 if (psTraceGetLevel ("psphot.psphotFitEXT") >= 6) { 82 nThreads = 0; 79 83 } 80 84 … … 468 472 psFree (source->modelEXT); 469 473 source->modelEXT = psMemIncrRefCounter (source->modelFits->data[minModel]); 474 source->type = PM_SOURCE_TYPE_EXTENDED; 475 source->mode |= PM_SOURCE_MODE_EXTMODEL; 476 source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT; 470 477 471 478 // adjust the window so the subtraction covers the faint wings -
trunk/psphot/src/psphotForced.c
r31154 r34258 1 1 # include "psphotStandAlone.h" 2 # define FORCED_PHOTOMETRY 13 2 4 3 int main (int argc, char **argv) { -
trunk/psphot/src/psphotImageLoop.c
r34086 r34258 118 118 } 119 119 break; 120 case PSPHOT_MINIMAL: 121 if (!psphotReadoutMinimal (config, view, "PSPHOT.INPUT")) { 122 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 123 psFree (view); 124 return false; 125 } 126 break; 120 127 case PSPHOT_FORCED: 121 128 if (!psphotForcedReadout (config, view, "PSPHOT.INPUT")) { -
trunk/psphot/src/psphotReadoutMinimal.c
r34215 r34258 25 25 // Generate the mask and weight images, including the user-defined analysis region of interest 26 26 psphotSetMaskAndVariance (config, view, filerule); 27 28 // only subtract background if needed? 29 // activate this for a clean test with psphotMinimal. (add to recipe!) 30 if (0) { 31 // generate a background model (median, smoothed image) 32 if (!psphotModelBackground (config, view, filerule)) { 33 return psphotReadoutCleanup (config, view, filerule); 34 } 35 if (!psphotSubtractBackground (config, view, filerule)) { 36 return psphotReadoutCleanup (config, view, filerule); 37 } 38 } 27 39 28 40 // load the psf model, if suppled. FWHM_X,FWHM_Y,etc are saved on readout->analysis … … 72 84 psphotFitSourcesLinear (config, view, filerule, false, false); 73 85 74 // XXX eventually, add the extended source fits here 75 # if (0) 86 // measure the radial profiles to the sky 87 psphotRadialProfileWings (config, view, filerule); 88 89 // re-measure the kron mags with models subtracted and more appropriate windows 90 psphotKronIterate(config, view, filerule); 91 76 92 // measure source size for the remaining sources 77 psphotSourceSize (config, view, filerule );93 psphotSourceSize (config, view, filerule, false); 78 94 79 psphotExtendedSourceAnalysis (config, view, filerule); 95 // NOTE: Petrosian and Isophotal mags are not relevant at this time 96 // psphotExtendedSourceAnalysis (config, view, filerule); 80 97 98 // in ppSub context, this is used to fit TRAILs (and maybe EXP for comets) 81 99 psphotExtendedSourceFits (config, view, filerule); 82 # endif83 100 84 101 // calculate source magnitudes -
trunk/psphot/src/psphotSourceFits.c
r34086 r34258 463 463 } 464 464 465 # if (PS_TRACE_ON) 466 if (psTraceGetLevel ("psphot") >= 6) { 467 468 // Moments-based shapes parameters 469 psEllipseMoments moments; 470 moments.x2 = source->moments->Mxx; 471 moments.xy = source->moments->Mxy; 472 moments.y2 = source->moments->Myy; 473 // force the axis ratio to be < 20.0 474 psEllipseAxes axes = psEllipseMomentsToAxes (moments, 20.0); 475 476 // PSF shape parameters 477 psEllipseShape psfShape; 478 psfShape.sx = source->modelPSF->params->data.F32[PM_PAR_SXX] / M_SQRT2; 479 psfShape.sxy = source->modelPSF->params->data.F32[PM_PAR_SXY]; 480 psfShape.sy = source->modelPSF->params->data.F32[PM_PAR_SYY] / M_SQRT2; 481 psEllipseAxes psfAxes = psEllipseShapeToAxes (psfShape, 20.0); 482 483 fprintf (stderr, "--- guess values ---\n"); 484 fprintf (stderr, "(x,y): %f, %f Mxx: %f, Myy: %f, Mxy: %f -> major: %f, minor: %f, theta: %f (%f deg)\n", source->peak->xf, source->peak->yf, source->moments->Mxx, source->moments->Myy, source->moments->Mxy, axes.major, axes.minor, axes.theta, axes.theta*PS_DEG_RAD); 485 fprintf (stderr, "psf: major: %f, minor: %f, theta: %f (%f deg)\n", psfAxes.major, psfAxes.minor, psfAxes.theta, psfAxes.theta*PS_DEG_RAD); 486 for (int i = 0; i < model->params->n; i++) { 487 fprintf (stderr, "par %d: %f\n", i, model->params->data.F32[i]); 488 } 489 } 490 if (psTraceGetLevel ("psphot") >= 7) { 491 psTraceSetLevel("psLib.math.psMinimizeLMChi2", 5); 492 } 493 # endif 494 465 495 // for sersic models, use a grid search to choose an index, then float the params there 466 496 if (modelType == pmModelClassGetType("PS_MODEL_SERSIC")) { … … 468 498 } 469 499 500 options.mode = PM_SOURCE_FIT_EXT; 470 501 if (modelType == pmModelClassGetType("PS_MODEL_SERSIC")) { 471 502 options.mode = PM_SOURCE_FIT_NO_INDEX; 472 } else {473 options.mode = PM_SOURCE_FIT_EXT; 474 } 475 476 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 5); 503 } 504 if (modelType == pmModelClassGetType("PS_MODEL_TRAIL")) { 505 options.mode = PM_SOURCE_FIT_TRAIL; 506 } 507 477 508 pmSourceFitModel (source, model, &options, maskVal); 478 // fprintf (stderr, "chisq: %f, nIter: %d, radius: %f, npix: %d\n", model->chisqNorm, model->nIter, model->fitRadius, model->nPix); 479 // psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0); 509 510 # if (PS_TRACE_ON) 511 if (psTraceGetLevel ("psphot") >= 5) { 512 if (psTraceGetLevel ("psphot") >= 6) { 513 fprintf (stderr, "chisq: %f, nIter: %d, radius: %f, npix: %d\n", model->chisqNorm, model->nIter, model->fitRadius, model->nPix); 514 } 515 fprintf (stderr, "--- fitted values ---\n"); 516 for (int i = 0; i < model->params->n; i++) { 517 fprintf (stderr, "par %d: %f\n", i, model->params->data.F32[i]); 518 } 519 psTraceSetLevel("psLib.math.psMinimizeLMChi2", 0); 520 } 521 # endif 480 522 481 523 return (model); -
trunk/psphot/src/psphotSourceSize.c
r34201 r34258 462 462 psImageMaskType maskVal = options->maskVal | options->markVal; 463 463 464 // in the ppSub context, do we get sensible values for ApResid? 465 float ApResidPSF = options->ApResid; 466 if (!isfinite(ApResidPSF)) { 467 ApResidPSF = 0.0; 468 } 469 float ApSysErrPSF = options->ApSysErr; 470 if (!isfinite(ApSysErrPSF)) { 471 ApSysErrPSF = 0.0; 472 } 473 464 474 for (psS32 i = 0 ; i < sources->n ; i++) { 465 475 … … 529 539 // set nSigmaMAG to include both systematic and poisson error terms. we include a hard 530 540 // floor on the Ap Sys Err (to be a bit generous). XXX put the floor in the recipe... 531 float nSigmaMAG = (dMag - options->ApResid) / hypot(source->psfMagErr, hypot(options->ApSysErr, 0.02));541 float nSigmaMAG = (dMag - ApResidPSF) / hypot(source->psfMagErr, hypot(ApSysErrPSF, 0.02)); 532 542 source->extNsigma = nSigmaMAG; 533 543 -
trunk/psphot/src/psphotStackImageLoop.c
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20120627/psphot/src/psphotStackImageLoop.c (added) merged: 34139,34247,34255
- Property svn:mergeinfo changed
Note:
See TracChangeset
for help on using the changeset viewer.
