Changeset 14971
- Timestamp:
- Sep 21, 2007, 11:44:43 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070921/psphot/src/psphotChoosePSF.c
r14966 r14971 11 11 sources = psArraySort (sources, pmSourceSortBySN); 12 12 13 // structure to store user options defining the psf 14 pmPSFOptions *options = pmPSFOptionsAlloc (); 15 16 // load user options from the recipe. no need to check existence -- they are 13 17 // array to store candidate PSF stars 14 18 int NSTARS = psMetadataLookupS32 (&status, recipe, "PSF_MAX_NSTARS"); 15 PS_ASSERT (status, NULL);19 assert (status); 16 20 17 21 float PSF_MIN_DS = psMetadataLookupF32 (&status, recipe, "PSF_MIN_DS"); 18 PS_ASSERT (status, NULL);22 assert (status); 19 23 20 24 // supply the measured sky variance for optional constant errors (non-poissonian) 21 25 float SKY_SIG = psMetadataLookupF32 (&status, recipe, "SKY_SIG"); 22 PS_ASSERT (status, NULL);26 assert (status); 23 27 24 28 // use poissonian errors or local-sky errors 25 bool POISSON_ERRORS = psMetadataLookupBool (&status, recipe, "POISSON_ERRORS");26 PS_ASSERT (status, NULL);29 options->poissonErrorsPhotom = psMetadataLookupBool (&status, recipe, "POISSON.ERRORS.PHOTOM"); 30 assert (status); 27 31 28 32 // use poissonian errors or local-sky errors 29 bool PSF_PARAM_WEIGHTS = psMetadataLookupBool (&status, recipe, "PSF_PARAM_WEIGHTS");30 PS_ASSERT (status, NULL);33 options->poissonErrorsParams = psMetadataLookupBool (&status, recipe, "POISSON.ERRORS.PARAMS"); 34 assert (status); 31 35 32 36 // how to model the PSF variations across the field 33 psMetadata *md = psMetadataLookupMetadata (&status, recipe, "PSF.TREND.MASK"); 34 PS_ASSERT (status, NULL); 37 char *psfTrendMode = psMetadataLookupStr (&status, recipe, "PSF.TREND.MODE"); 38 assert (status); 39 options->psfTrendMode = pmTrend2DModeFromString (psfTrendMode); 35 40 36 41 // get the fixed PSF fit radius 37 42 // XXX check that PSF_FIT_RADIUS < SKY_OUTER_RADIUS 38 float RADIUS= psMetadataLookupF32 (&status, recipe, "PSF_FIT_RADIUS");39 PS_ASSERT (status, NULL);43 options->radius = psMetadataLookupF32 (&status, recipe, "PSF_FIT_RADIUS"); 44 assert (status); 40 45 41 46 pmSourceFitModelInit (15, 0.01, PS_SQR(SKY_SIG), POISSON_ERRORS); … … 91 96 psMetadataItem *item = psListGetAndIncrement (iter); 92 97 char *modelName = item->data.V; 93 models->data[i] = pmPSFtryModel (stars, modelName, RADIUS, POISSON_ERRORS, psfTrendMask, PSF_PARAM_WEIGHTS, maskVal, mark); 98 // models->data[i] = pmPSFtryModel (stars, modelName, RADIUS, POISSON_ERRORS, psfTrendMask, PSF_PARAM_WEIGHTS, maskVal, mark); 99 models->data[i] = pmPSFtryModel (stars, modelName, options, maskVal, mark); 94 100 } 95 101
Note:
See TracChangeset
for help on using the changeset viewer.
