Changeset 36161
- Timestamp:
- Sep 30, 2013, 5:41:48 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130904/psphot/src
- Files:
-
- 6 edited
-
psphotArguments.c (modified) (1 diff)
-
psphotFullForce.c (modified) (1 diff)
-
psphotFullForceArguments.c (modified) (2 diffs)
-
psphotFullForceReadout.c (modified) (2 diffs)
-
psphotGalaxyShape.c (modified) (2 diffs)
-
psphotMergeSources.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130904/psphot/src/psphotArguments.c
r36153 r36161 217 217 pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf", "-psflist"); 218 218 pmConfigFileSetsMD (config->arguments, &argc, argv, "SRC", "-src", "-srclist"); 219 pmConfigFileSetsMD (config->arguments, &argc, argv, "FORCE", "-force", "-forcelist");219 // XXX allow this format? pmConfigFileSetsMD (config->arguments, &argc, argv, "FORCE", "-force", "-forcelist"); 220 220 pmConfigFileSetsMD (config->arguments, &argc, argv, "EXPNUM", "-expnum", "-expnumlist"); 221 221 -
branches/eam_branches/ipp-20130904/psphot/src/psphotFullForce.c
r36146 r36161 20 20 21 21 // call psphot for each readout 22 if (!psphotImageLoop (config, PSPHOT_F ORCED)) {22 if (!psphotImageLoop (config, PSPHOT_FULL_FORCE)) { 23 23 psErrorStackPrint(stderr, "Error in the psphot image loop\n"); 24 24 exit (psphotGetExitStatus()); -
branches/eam_branches/ipp-20130904/psphot/src/psphotFullForceArguments.c
r36146 r36161 7 7 8 8 int N; 9 bool status, status1, status2 ;9 bool status, status1, status2, status3; 10 10 11 11 // load config data from default locations … … 73 73 pmConfigFileSetsMD (config->arguments, &argc, argv, "VARIANCE", "-variance", "-variancelist"); 74 74 75 // XXX make psf model optional? 76 status = pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf", "-psflist"); 77 if (!status) { 78 psError(PSPHOT_ERR_ARGUMENTS, true, "No psf model is supplied (use -psf)"); 79 usage(argv[0], config->arguments, config, PS_EXIT_CONFIG_ERROR); 80 } 81 82 status1 = pmConfigFileSetsMD (config->arguments, &argc, argv, "SRC", "-src", "-srclist"); 75 pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf", "-psflist"); 76 77 status1 = pmConfigFileSetsMD (config->arguments, &argc, argv, "SRC", "-src", "-srclist"); 83 78 status2 = pmConfigFileSetsMD (config->arguments, &argc, argv, "SRCTEXT", "-srctext", "-srctextlist"); 79 status3 = pmConfigFileSetsMD (config->arguments, &argc, argv, "FORCE", "-force", "-forcelist"); 84 80 85 if (!status1 && !status2) { 86 psError(PSPHOT_ERR_ARGUMENTS, true, "No source list is supplied (use one of -src, -srctext, -srclist, or -srctextlist)"); 81 if (!(status1 || status2 || status3)) { 82 // XXX require -force version? 83 psError(PSPHOT_ERR_ARGUMENTS, true, "No source list is supplied (use one of -force, -forcelist, -src, -srctext, -srclist, or -srctextlist)"); 87 84 usage(argv[0], config->arguments, config, PS_EXIT_CONFIG_ERROR); 88 85 } -
branches/eam_branches/ipp-20130904/psphot/src/psphotFullForceReadout.c
r36148 r36161 56 56 psphotMergeSources (config, view, filerule); 57 57 58 // construct sources and measure moments and other basic stats (saved on detections->newSources) 59 // all sources use the auto-scaled window appropriate to a PSF, except for the saturated 60 // stars : these use a larger window (3x the basic window) 61 if (!psphotSourceStats (config, view, filerule, true)) { // pass 1 62 psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources"); 63 return psphotReadoutCleanup (config, view, filerule); 64 } 65 58 66 // generate a psf model for any readouts which need one 59 67 // psphotFullForcePSF (config, view, filerule); … … 61 69 // sources; we should mark with a flag bit the ones we actually want to use as PSF 62 70 // stars (this means we need to supply this info in the load). 63 psphotChoosePSF (config, view, filerule, true);71 psphotChoosePSF (config, view, filerule, false); 64 72 65 73 // Construct an initial model for each object, set the radius to fitRadius, set circular -
branches/eam_branches/ipp-20130904/psphot/src/psphotGalaxyShape.c
r36156 r36161 11 11 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 12 12 psAssert (recipe, "missing recipe?"); 13 14 // perform full non-linear fits / extended source analysis? 15 // XXX for this to be true for psphotFullForce?? 16 if (!psMetadataLookupBool (&status, recipe, "GALAXY_SHAPES")) { 17 psLogMsg ("psphot", PS_LOG_INFO, "skipping galaxy shape measurements\n"); 18 return true; 19 } 13 20 14 21 int num = psphotFileruleCount(config, filerule); … … 78 85 assert (status); 79 86 80 // source fitting parameters for extended source fits81 int fitIter = psMetadataLookupS32(&status, recipe, "EXT_FIT_ITER"); // Max number of fit iterations82 assert (status && fitIter > 0);83 84 float fitMinTol = psMetadataLookupF32 (&status, recipe, "EXT_FIT_MIN_TOL"); // Fit tolerance85 if (!status || !isfinite(fitMinTol) || fitMinTol <= 0) {86 fitMinTol = psMetadataLookupF32 (&status, recipe, "PSF_FIT_TOL"); // Fit tolerance87 if (!status || !isfinite(fitMinTol) || fitMinTol <= 0) {88 psAbort("PSF_FIT_MIN_TOL (and PSF_FIT_TOL) not defined or positive");89 }90 }91 92 float fitMaxTol = psMetadataLookupF32 (&status, recipe, "EXT_FIT_MAX_TOL"); // Fit tolerance93 if (!status || !isfinite(fitMaxTol) || fitMaxTol <= 0) {94 fitMaxTol = 1.0;95 }96 97 bool chisqConvergence = psMetadataLookupBool (&status, recipe, "LMM_FIT_CHISQ_CONVERGENCE"); // Fit tolerance98 if (!status) {99 // default to the old method (chisqConvergence)100 chisqConvergence = true;101 }102 103 int gainFactorMode = psMetadataLookupS32 (&status, recipe, "LMM_FIT_GAIN_FACTOR_MODE"); // Fit tolerance104 if (!status) {105 // default to the old method (chisqConvergence)106 gainFactorMode = 0;107 }108 109 // perform full extended source non-linear fits?110 bool isInteractive = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_FITS_INTERACTIVE");111 if (!status) isInteractive = false;112 113 87 // Define source fitting parameters for extended source fits 88 // we are not doing LMM fitting, so most options are irrelevant 114 89 pmSourceFitOptions *fitOptions = pmSourceFitOptionsAlloc(); 115 90 fitOptions->mode = PM_SOURCE_FIT_EXT_AND_SKY; 116 fitOptions->saveCovariance = true; // XXX make this a user option?117 91 fitOptions->covarFactor = psImageCovarianceFactorForAperture(readout->covariance, 10.0); // Covariance matrix 118 fitOptions->nIter = fitIter;119 fitOptions->minTol = fitMinTol;120 fitOptions->maxTol = fitMaxTol;121 122 fitOptions->gainFactorMode = gainFactorMode;123 fitOptions->chisqConvergence = chisqConvergence;124 fitOptions->isInteractive = isInteractive;125 92 126 93 // source analysis is done in S/N order (brightest first) -
branches/eam_branches/ipp-20130904/psphot/src/psphotMergeSources.c
r36156 r36161 188 188 psFree (detections); 189 189 190 if (! extCMF && !extSourcesTXT) {190 if (!(extCMF || extCFF || extSourcesTXT)) { 191 191 psLogMsg ("psphot", 3, "no external sources for this readout"); 192 192 return true; … … 194 194 195 195 int nCMF = extCMF ? extCMF->allSources->n : 0; 196 int nTXT = extSourcesTXT ? extSourcesTXT->n : 0; 197 198 psLogMsg ("psphot", 3, "%d external sources (%d cmf, %d text) merged to yield %ld total sources", 199 nCMF + nTXT, nCMF, nTXT, sources->n); 196 int nCFF = extCFF ? extCFF->allSources->n : 0; 197 int nTXT = extSourcesTXT ? extSourcesTXT->n : 0; 198 199 psLogMsg ("psphot", 3, "%d external sources (%d cmf, %d cff, %d text) merged to yield %ld total sources", 200 nCMF + nCFF + nTXT, nCMF, nCFF, nTXT, sources->n); 200 201 return true; 201 202 }
Note:
See TracChangeset
for help on using the changeset viewer.
