Changeset 6427
- Timestamp:
- Feb 14, 2006, 6:33:17 AM (20 years ago)
- Location:
- trunk/psphot
- Files:
-
- 13 edited
-
doc/notes.txt (modified) (1 diff)
-
src/Makefile.am (modified) (2 diffs)
-
src/psphot.h (modified) (3 diffs)
-
src/psphotBasicDeblend.c (modified) (3 diffs)
-
src/psphotBlendFit.c (modified) (2 diffs)
-
src/psphotChoosePSF.c (modified) (2 diffs)
-
src/psphotEnsemblePSF.c (modified) (6 diffs)
-
src/psphotFindPeaks.c (modified) (3 diffs)
-
src/psphotImageMedian.c (modified) (3 diffs)
-
src/psphotRadiusChecks.c (modified) (4 diffs)
-
src/psphotReadout.c (modified) (3 diffs)
-
src/psphotSourceFits.c (modified) (3 diffs)
-
src/psphotSourceStats.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/doc/notes.txt
r5980 r6427 1 2 2006.02.12 3 4 Last week, I made a new tag (psphot_dev_08) after finishing the work 5 to clean memory leaks and to modify psphot to work with Paul's 6 ppImage infrastructure. 7 8 I have added a new background model function which generates a 9 median map based on Robert's suggestion of a) half-step windows and 10 b) linear interpolation. 11 12 Now, I am working to remove the constant sky level concepts and make 13 every relevant test use the signal/noise ratio as the trigger. This 14 has impacts on the peak detections, the threshold for blends, and 15 the threshold for choosing pixels in the fitting routines. 1 16 2 17 2005.12.23 -
trunk/psphot/src/Makefile.am
r6399 r6427 21 21 psphotChoosePSF.c \ 22 22 psphotEnsemblePSF.c \ 23 psphotFullFit.c \24 23 psphotBlendFit.c \ 25 psphotApplyPSF.c \26 psphotFitGalaxies.c \27 24 psphotReplaceUnfit.c \ 28 25 psphotApResid.c \ … … 65 62 tags: 66 63 etags `find . -name \*.[ch] -print` 64 65 66 # psphotFullFit.c 67 # psphotApplyPSF.c 68 # psphotFitGalaxies.c -
trunk/psphot/src/psphot.h
r6399 r6427 33 33 psStats *psphotImageStats (pmReadout *readout, psMetadata *config); 34 34 psPolynomial2D *psphotImageBackground (pmReadout *readout, psMetadata *config, psStats *sky); 35 psArray *psphotFindPeaks (pmReadout *readout, psMetadata *config , psStats *sky);35 psArray *psphotFindPeaks (pmReadout *readout, psMetadata *config); 36 36 psArray *psphotSourceStats (pmReadout *readout, psMetadata *config, psArray *allpeaks); 37 37 bool psphotRoughClass (psArray *sources, psMetadata *config); 38 bool psphotBasicDeblend (psArray *sources, psMetadata *config , psStats *sky);39 pmPSF *psphotChoosePSF (psMetadata *config, psArray *sources , psStats *sky);38 bool psphotBasicDeblend (psArray *sources, psMetadata *config); 39 pmPSF *psphotChoosePSF (psMetadata *config, psArray *sources); 40 40 void psphotOutput (pmReadout *readout, psMetadata *arguments); 41 psImage *psphotImageMedian (pmReadout *readout, psMetadata *config , psStats *sky);41 psImage *psphotImageMedian (pmReadout *readout, psMetadata *config); 42 42 43 43 // optional object analysis steps 44 bool psphotEnsemblePSF (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky); 45 bool psphotFullFit (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky); 46 bool psphotBlendFit (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky); 44 bool psphotEnsemblePSF (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf); 45 bool psphotBlendFit (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf); 47 46 bool psphotReplaceUnfit (psArray *sources); 48 bool psphotApplyPSF (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky);49 bool psphotFitExtended (pmReadout *readout, psMetadata *config, psArray *sources, psStats *skyStats);50 47 bool psphotApResid (pmReadout *readout, psArray *sources, psMetadata *config, pmPSF *psf); 48 49 // XXX deprecate these? 50 // bool psphotFullFit (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky); 51 // bool psphotApplyPSF (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf, psStats *sky); 52 // bool psphotFitExtended (pmReadout *readout, psMetadata *config, psArray *sources, psStats *skyStats); 51 53 52 54 // basic support functions … … 63 65 64 66 // functions to set the correct source pixels 65 bool psphotInitRadiusPSF (psMetadata *config, p sStats *sky, pmModelType type);67 bool psphotInitRadiusPSF (psMetadata *config, pmModelType type); 66 68 bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model); 67 bool psphotInitRadiusEXT (psMetadata *config, p sStats *sky, pmModelType type);69 bool psphotInitRadiusEXT (psMetadata *config, pmModelType type); 68 70 bool psphotCheckRadiusEXT (pmReadout *readout, pmSource *source, pmModel *model); 69 71 bool psphotDefinePixels (pmSource *mySource, const pmReadout *readout, psF32 x, psF32 y, psF32 Radius); … … 111 113 // functions to support the source fitting process 112 114 bool psphotInitLimitsPSF (psMetadata *config); 113 bool psphotInitLimitsEXT (psMetadata *config , psStats *sky);115 bool psphotInitLimitsEXT (psMetadata *config); 114 116 bool psphotFitBlend (pmReadout *readout, pmSource *source); 115 117 bool psphotFitBlob (pmReadout *readout, pmSource *source, psArray *sources); -
trunk/psphot/src/psphotBasicDeblend.c
r6379 r6427 2 2 3 3 // 2006.02.07 : no leaks 4 bool psphotBasicDeblend (psArray *sources, psMetadata *config , psStats *sky) {4 bool psphotBasicDeblend (psArray *sources, psMetadata *config) { 5 5 6 6 int N; … … 18 18 float NSIGMA = psMetadataLookupF32 (&status, config, "DEBLEND_SKY_NSIGMA"); 19 19 if (!status) NSIGMA = 5.0; 20 21 float minThreshold = NSIGMA*sky->sampleStdev;22 20 23 21 // we need sources spatially-sorted to find overlaps … … 83 81 // generate source contour (1/4 peak counts) 84 82 // set the threshold based on user inputs 85 threshold = FRACTION * (source->peak->counts - source->moments->Sky) + source->moments->Sky; 86 threshold = PS_MAX (threshold, minThreshold); 83 84 // threshold is fraction of the source peak flux 85 // image is background subtracted; source->moments->Sky should always be 0.0 86 threshold = FRACTION * source->moments->Peak; 87 // threshold is no less than NSIGMA above the local median sigma? 88 threshold = PS_MAX (threshold, NSIGMA*source->moments->dSky); 87 89 88 90 // generate a basic contour (set of x,y coordinates at-or-below flux level) -
trunk/psphot/src/psphotBlendFit.c
r6379 r6427 2 2 3 3 // XXX I don't like this name 4 bool psphotBlendFit (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf , psStats *sky) {4 bool psphotBlendFit (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf) { 5 5 6 6 psTimerStart ("psphot"); … … 10 10 11 11 psphotInitLimitsPSF (config); 12 psphotInitLimitsEXT (config , sky);13 psphotInitRadiusPSF (config, sky,psf->type);12 psphotInitLimitsEXT (config); 13 psphotInitRadiusPSF (config, psf->type); 14 14 15 15 for (int i = 0; i < sources->n; i++) { -
trunk/psphot/src/psphotChoosePSF.c
r6379 r6427 3 3 // 2006.02.07 : no leaks! 4 4 // try PSF models and select best option 5 pmPSF *psphotChoosePSF (psMetadata *config, psArray *sources , psStats *skystats) {5 pmPSF *psphotChoosePSF (psMetadata *config, psArray *sources) { 6 6 7 7 bool status; … … 52 52 psListIterator *iter = psListIteratorAlloc (list, PS_LIST_HEAD, FALSE); 53 53 for (int i = 0; i < models->n; i++) { 54 // XXX psListGetAndIncrement does not increment ref counter!?55 // XXX if it did, i should free 'item' below56 54 psMetadataItem *item = psListGetAndIncrement (iter); 57 55 modelName = item->data.V; 58 56 models->data[i] = pmPSFtryModel (stars, modelName, RADIUS); 59 // psFree (item);60 57 } 61 58 psFree (iter); -
trunk/psphot/src/psphotEnsemblePSF.c
r6379 r6427 3 3 // 2006.02.07 : no leaks! 4 4 // fit all reasonable sources with the linear PSF model 5 bool psphotEnsemblePSF (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf , psStats *sky) {5 bool psphotEnsemblePSF (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf) { 6 6 7 7 bool status; … … 15 15 sources = psArraySort (sources, psphotSortByY); 16 16 17 // radius for source moments if star is saturated 18 // XXX we already do this in psphotSourceStats, is it still needed? 17 19 float INNER_RADIUS = psMetadataLookupF32 (&status, config, "SKY_INNER_RADIUS"); 18 float PSF_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "PSF_FIT_NSIGMA");19 float PSF_FIT_PADDING = psMetadataLookupF32 (&status, config, "PSF_FIT_PADDING");20 20 21 // set the object surface-brightness limit for fitted pixels 22 float FLUX_LIMIT = PSF_FIT_NSIGMA * sky->sampleStdev; 23 psLogMsg ("psphot.ensemble", 4, "fitting pixels with at least %f object counts\n", FLUX_LIMIT); 21 // setup the PSF fit details 22 psphotInitRadiusPSF (config, psf->type); 24 23 25 24 // pre-calculate all model pixels … … 29 28 index->n = 0; 30 29 30 // option to limit analysis to a specific region 31 31 bool UseAnalysisRegion = false; 32 32 psRegion AnalysisRegion = {0, 0, 0, 0}; … … 98 98 y = model->params->data.F32[3]; 99 99 100 // get function which specifies the radius at which the model hits the given flux101 pmModelRadius modelRadius = pmModelRadius_GetFunction (psf->type);102 103 100 // set the fit radius based on the object flux limit and the model 104 model->radius = modelRadius (model->params, FLUX_LIMIT) + PSF_FIT_PADDING; 105 if (isnan(model->radius)) psAbort ("psphotEnsemblePSF", "error in radius"); 106 107 // if needed, ask for more object pixels 108 psphotRedefinePixels (inSource, readout, x, y, model->radius); 101 psphotCheckRadiusPSF (readout, inSource, model); 109 102 110 103 // make temporary copies of the image pixels and mask … … 116 109 psImage *mask = otSource->mask; 117 110 118 // set model to unit peak, zero sky (we assume sky is constant)111 // set model to unit peak, zero sky (we assume sky is subtracted) 119 112 model->params->data.F32[0] = 0.0; 120 113 model->params->data.F32[1] = 1.0; … … 165 158 psLogMsg ("psphot.emsemble", 4, "built matrix: %f (%d elements)\n", psTimerMark ("psphot"), sparse->Nelem); 166 159 167 // solve for normalization terms (need include local sky )160 // solve for normalization terms (need include local sky?) 168 161 psSparseResort (sparse); 169 162 psVector *norm = psSparseSolve (NULL, sparse, 3); -
trunk/psphot/src/psphotFindPeaks.c
r6379 r6427 2 2 3 3 // 2006.02.02 : no leaks 4 psArray *psphotFindPeaks (pmReadout *readout, psMetadata *config , psStats *sky) {4 psArray *psphotFindPeaks (pmReadout *readout, psMetadata *config) { 5 5 6 6 bool status = false; … … 9 9 float threshold; 10 10 11 // smooth the image 11 // smooth the image and weight map 12 13 psphotSaveImage (NULL, readout->image, "image.fits"); 12 14 13 15 psTimerStart ("psphot"); … … 16 18 NSIGMA = psMetadataLookupF32 (&status, config, "PEAKS_SMOOTH_NSIGMA"); 17 19 18 psImage *smooth = psImageCopy (NULL, readout->image, PS_TYPE_F32); 19 psphotSaveImage (NULL, smooth, "presmooth.fits"); 20 psImage *smooth_im = psImageCopy (NULL, readout->image, PS_TYPE_F32); 21 psImageSmooth (smooth_im, SIGMA, NSIGMA); 22 psLogMsg ("psphot", 4, "smooth image: %f sec\n", psTimerMark ("psphot")); 20 23 21 psImageSmooth (smooth, SIGMA, NSIGMA); 22 psLogMsg ("psphot", 4, "smooth: %f sec\n", psTimerMark ("psphot")); 24 psphotSaveImage (NULL, smooth_im, "smooth_im.fits"); 23 25 24 psphotSaveImage (NULL, smooth, "smooth.fits"); 26 psImage *smooth_wt = psImageCopy (NULL, readout->weight, PS_TYPE_F32); 27 psImageSmooth (smooth_wt, SIGMA, NSIGMA); 28 psLogMsg ("psphot", 4, "smooth weight: %f sec\n", psTimerMark ("psphot")); 29 30 psphotSaveImage (NULL, smooth_wt, "smooth_wt.fits"); 31 32 psTimerStart ("psphot"); 33 for (int j = 0; j < smooth_im->numRows; j++) { 34 for (int i = 0; i < smooth_im->numCols; i++) { 35 if (smooth_wt->data.F32[j][i] <= 0) continue; 36 smooth_im->data.F32[j][i] = PS_SQR(smooth_im->data.F32[j][i]) / smooth_wt->data.F32[j][i]; 37 } 38 } 39 psLogMsg ("psphot", 4, "built S/N map: %f sec\n", psTimerMark ("psphot")); 25 40 26 41 psTimerStart ("psphot"); 27 42 28 43 // set peak threshold 29 NSIGMA = psMetadataLookupF32 (&status, config, "PEAKS_NSIGMA_LIMIT"); 30 31 threshold = NSIGMA*sky->sampleStdev + sky->sampleMean; 32 // threshold = NSIGMA*sky->sampleStdev; 44 NSIGMA = psMetadataLookupF32 (&status, config, "PEAKS_NSIGMA_LIMIT"); 45 // threshold = NSIGMA*sky->sampleStdev + sky->sampleMean; 46 threshold = PS_SQR(NSIGMA); 33 47 psLogMsg ("psphot", 4, "threshold: %f DN\n", threshold); 34 48 35 49 // find the peaks in the smoothed image 36 psArray *peaks = pmFindImagePeaks (smooth , threshold);50 psArray *peaks = pmFindImagePeaks (smooth_im, threshold); 37 51 if (peaks == NULL) psAbort ("find peaks", "no peaks found"); 38 psFree (smooth); 52 psFree (smooth_im); 53 psFree (smooth_wt); 39 54 40 55 // optional dump of all peak data -
trunk/psphot/src/psphotImageMedian.c
r6399 r6427 11 11 // generate the median in NxN boxes, clipping heavily 12 12 // linear interpolation to generate full-scale model 13 psImage *psphotImageMedian (pmReadout *readout, psMetadata *config , psStats *sky)13 psImage *psphotImageMedian (pmReadout *readout, psMetadata *config) 14 14 { 15 15 bool status; … … 20 20 if (!status) MAX_SAMPLE_PIXELS = 1000; 21 21 22 // fit background to subset of image points within 3 sigma of sky23 22 psTimerStart ("psphot"); 24 23 … … 262 261 value = value / npts; 263 262 263 // XXX correct for selection bias?? 264 264 265 psFree (values); 265 266 return value; -
trunk/psphot/src/psphotRadiusChecks.c
r6056 r6427 1 1 # include "psphot.h" 2 2 3 static float PSF_ OUTER_RADIUS;3 static float PSF_FIT_NSIGMA; 4 4 static float PSF_FIT_PADDING; 5 static float PSF_FLUX_LIMIT;6 5 static pmModelRadius modelRadiusPSF; 7 6 8 bool psphotInitRadiusPSF (psMetadata *config, p sStats *sky, pmModelType type) {7 bool psphotInitRadiusPSF (psMetadata *config, pmModelType type) { 9 8 10 9 bool status; 11 10 12 float PSF_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "PSF_FIT_NSIGMA"); 13 PSF_OUTER_RADIUS = psMetadataLookupF32 (&status, config, "PSF_OUTER_RADIUS"); 14 PSF_FIT_PADDING = psMetadataLookupF32 (&status, config, "PSF_FIT_PADDING"); 15 PSF_FLUX_LIMIT = PSF_FIT_NSIGMA * sky->sampleStdev; 11 PSF_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "PSF_FIT_NSIGMA"); 12 PSF_FIT_PADDING = psMetadataLookupF32 (&status, config, "PSF_FIT_PADDING"); 16 13 17 14 // this function specifies the radius at this the model hits the given flux … … 22 19 bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model) { 23 20 21 pmMoments *moments = source->moments; 22 if (moments == NULL) return false; 23 24 24 // set the fit radius based on the object flux limit and the model 25 // XXX EAM : FLUX_LIMIT should be set based on local sky model (not global median) 26 model->radius = modelRadiusPSF (model->params, PSF_FLUX_LIMIT) + PSF_FIT_PADDING; 25 model->radius = modelRadiusPSF (model->params, PSF_FIT_NSIGMA*moments->dSky) + PSF_FIT_PADDING; 27 26 if (isnan(model->radius)) psAbort ("apply_psf_model", "error in radius"); 28 27 … … 35 34 } 36 35 37 static float EXT_ OUTER_RADIUS;36 static float EXT_FIT_NSIGMA; 38 37 static float EXT_FIT_PADDING; 39 static float EXT_FLUX_LIMIT;40 38 static pmModelRadius modelRadiusEXT; 41 39 42 bool psphotInitRadiusEXT (psMetadata *config, p sStats *sky, pmModelType type) {40 bool psphotInitRadiusEXT (psMetadata *config, pmModelType type) { 43 41 44 42 bool status; 45 43 46 float EXT_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "EXT_FIT_NSIGMA"); 47 EXT_OUTER_RADIUS = psMetadataLookupF32 (&status, config, "EXT_OUTER_RADIUS"); 48 EXT_FIT_PADDING = psMetadataLookupF32 (&status, config, "EXT_FIT_PADDING"); 49 EXT_FLUX_LIMIT = EXT_FIT_NSIGMA * sky->sampleStdev; 44 EXT_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "EXT_FIT_NSIGMA"); 45 EXT_FIT_PADDING = psMetadataLookupF32 (&status, config, "EXT_FIT_PADDING"); 50 46 51 47 // this function specifies the radius at this the model hits the given flux … … 56 52 bool psphotCheckRadiusEXT (pmReadout *readout, pmSource *source, pmModel *model) { 57 53 54 pmMoments *moments = source->moments; 55 if (moments == NULL) return false; 56 58 57 // set the fit radius based on the object flux limit and the model 59 model->radius = modelRadiusEXT (model->params, EXT_F LUX_LIMIT) + EXT_FIT_PADDING;58 model->radius = modelRadiusEXT (model->params, EXT_FIT_NSIGMA*moments->dSky) + EXT_FIT_PADDING; 60 59 if (isnan(model->radius)) psAbort (__func__, "error in radius"); 61 60 -
trunk/psphot/src/psphotReadout.c
r6399 r6427 4 4 bool psphotReadout (pmReadout *readout, psMetadata *config) { 5 5 6 psArray *sources = NULL;7 psArray *peaks = NULL;8 p mPSF *psf= NULL;9 p sStats *sky= NULL;6 psArray *sources = NULL; 7 psArray *peaks = NULL; 8 psImage *skymodel = NULL; 9 pmPSF *psf = NULL; 10 10 bool status; 11 psPolynomial2D *model = NULL;12 11 13 psphotImageMedian (readout, config, sky); 14 15 // measure image stats for initial guess 16 sky = psphotImageStats (readout, config); 17 18 // generate a background model (currently, 2D polynomial) 19 // XXX this should be available to be re-added to the original image 20 model = psphotImageBackground (readout, config, sky); 12 // generate a background model (median, smoothed image) 13 skymodel = psphotImageMedian (readout, config); 21 14 22 15 // find the peaks in the image 23 peaks = psphotFindPeaks (readout, config , sky);16 peaks = psphotFindPeaks (readout, config); 24 17 25 18 // construct sources and measure basic stats … … 30 23 31 24 // mark blended peaks PS_SOURCE_BLEND 32 psphotBasicDeblend (sources, config , sky);25 psphotBasicDeblend (sources, config); 33 26 34 27 // use bright stellar objects to measure PSF 35 psf = psphotChoosePSF (config, sources , sky);28 psf = psphotChoosePSF (config, sources); 36 29 37 // XXX change FITMODE to a string30 // select analysis method 38 31 char *FITMODE = psMetadataLookupStr (&status, config, "FITMODE"); 39 32 if (!strcasecmp(FITMODE, "ENSEMBLE")) { 40 psphotEnsemblePSF (readout, config, sources, psf, sky); 41 } 42 43 if (!strcasecmp(FITMODE, "FULL")) { 44 psphotEnsemblePSF (readout, config, sources, psf, sky); 45 psphotFullFit (readout, config, sources, psf, sky); 46 psphotReplaceUnfit (sources); 47 psphotApResid (readout, sources, config, psf); 33 psphotEnsemblePSF (readout, config, sources, psf); 48 34 } 49 35 50 36 if (!strcasecmp(FITMODE, "BLEND")) { 51 psphotEnsemblePSF (readout, config, sources, psf , sky);52 psphotBlendFit (readout, config, sources, psf , sky);37 psphotEnsemblePSF (readout, config, sources, psf); 38 psphotBlendFit (readout, config, sources, psf); 53 39 psphotReplaceUnfit (sources); 54 40 psphotApResid (readout, sources, config, psf); 55 }56 57 if (!strcasecmp(FITMODE, "BASIC")) {58 psphotApplyPSF (readout, config, sources, psf, sky);59 psphotFitExtended (readout, config, sources, sky);60 41 } 61 42 … … 65 46 psphotUpdateHeader (header, config); 66 47 48 // psphotSkyReplace (readout, skymodel); 49 67 50 // need to do something with the sources, psf, and sky 68 51 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "psphot sources", sources); 69 52 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN, "psphot psf", psf); 70 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.MEAN", PS_DATA_F32, "psphot sky mean", sky->sampleMean);71 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.SIGMA", PS_DATA_F32, "psphot sky stdev", sky->sampleStdev);53 // XXX : replace? status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.MEAN", PS_DATA_F32, "psphot sky mean", sky->sampleMean); 54 // XXX : replace? status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.SIGMA", PS_DATA_F32, "psphot sky stdev", sky->sampleStdev); 72 55 73 56 // free up the local copies of the data 74 57 psFree (psf); 75 psFree (sky);76 psFree (model);77 58 psFree (peaks); 78 59 psFree (sources); 60 psFree (skymodel); 79 61 80 62 return true; 81 63 } 64 65 66 // XXX Deprecate or allow these versions? 67 # if (0) 68 if (!strcasecmp(FITMODE, "FULL")) { 69 psphotEnsemblePSF (readout, config, sources, psf); 70 psphotFullFit (readout, config, sources, psf); 71 psphotReplaceUnfit (sources); 72 psphotApResid (readout, sources, config, psf); 73 } 74 75 if (!strcasecmp(FITMODE, "BASIC")) { 76 psphotApplyPSF (readout, config, sources, psf); 77 psphotFitExtended (readout, config, sources); 78 } 79 80 # endif -
trunk/psphot/src/psphotSourceFits.c
r6379 r6427 45 45 static pmModelType modelTypeEXT; 46 46 47 bool psphotInitLimitsEXT (psMetadata *config , psStats *sky) {47 bool psphotInitLimitsEXT (psMetadata *config) { 48 48 49 49 bool status; … … 56 56 char *modelNameEXT = psMetadataLookupStr (&status, config, "EXT_MODEL"); 57 57 modelTypeEXT = pmModelSetType (modelNameEXT); 58 psphotInitRadiusEXT (config, sky,modelTypeEXT);58 psphotInitRadiusEXT (config, modelTypeEXT); 59 59 60 60 return true; … … 250 250 } 251 251 252 model->params->data.F32[1] = blend->peak->counts; 252 // XXX assume local sky is 0.0? 253 model->params->data.F32[1] = blend->moments->Peak - blend->moments->Sky; 253 254 model->params->data.F32[2] = blend->peak->x; 254 255 model->params->data.F32[3] = blend->peak->y; -
trunk/psphot/src/psphotSourceStats.c
r6379 r6427 25 25 26 26 // allocate image, weight, mask arrays for each peak (square of radius OUTER) 27 // XXX EAM : this has 12 leaks (v.5)28 27 psphotDefinePixels (source, readout, source->peak->x, source->peak->y, OUTER); 29 28 … … 31 30 // XXX EAM : this should use ROBUST not SAMPLE median, but it is broken 32 31 status = pmSourceLocalSky (source, PS_STAT_SAMPLE_MEDIAN, INNER); 32 if (!status) { 33 psFree (source); 34 continue; 35 } 36 37 // measure the local sky variance (needed if noise is not sqrt(signal)) 38 // XXX EAM : this should use ROBUST not SAMPLE median, but it is broken 39 status = pmSourceLocalSkyVariance (source, PS_STAT_SAMPLE_MEDIAN, INNER); 33 40 if (!status) { 34 41 psFree (source);
Note:
See TracChangeset
for help on using the changeset viewer.
