Changeset 30975
- Timestamp:
- Mar 18, 2011, 2:10:35 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/psphot
- Files:
-
- 35 edited
-
src/models/pmModel_STRAIL.c (modified) (1 diff)
-
src/models/pmModel_TEST1.c (modified) (1 diff)
-
src/psphot.h (modified) (1 diff)
-
src/psphotBasicDeblend.c (modified) (3 diffs)
-
src/psphotBlendFit.c (modified) (2 diffs)
-
src/psphotChoosePSF.c (modified) (1 diff)
-
src/psphotCullPeaks.c (modified) (3 diffs)
-
src/psphotDeblendSatstars.c (modified) (2 diffs)
-
src/psphotEllipticalProfile.c (modified) (1 diff)
-
src/psphotExtendedSourceAnalysis.c (modified) (2 diffs)
-
src/psphotExtendedSourceAnalysisByObject.c (modified) (2 diffs)
-
src/psphotExtendedSourceFits.c (modified) (2 diffs)
-
src/psphotFindDetections.c (modified) (1 diff)
-
src/psphotFindPeaks.c (modified) (4 diffs)
-
src/psphotFitSourcesLinear.c (modified) (1 diff)
-
src/psphotGuessModels.c (modified) (1 diff)
-
src/psphotLoadSRCTEXT.c (modified) (1 diff)
-
src/psphotMergeSources.c (modified) (5 diffs)
-
src/psphotMosaicSubimage.c (modified) (1 diff)
-
src/psphotOutput.c (modified) (2 diffs)
-
src/psphotPetrosianAnalysis.c (modified) (1 diff)
-
src/psphotRadialApertures.c (modified) (2 diffs)
-
src/psphotRadialAperturesByObject.c (modified) (2 diffs)
-
src/psphotRadialProfile.c (modified) (1 diff)
-
src/psphotReplaceUnfit.c (modified) (1 diff)
-
src/psphotSavePSFStars.c (modified) (1 diff)
-
src/psphotSourceFits.c (modified) (3 diffs)
-
src/psphotSourceMatch.c (modified) (1 diff)
-
src/psphotSourcePlots.c (modified) (1 diff)
-
src/psphotSourceSize.c (modified) (1 diff)
-
src/psphotSourceStats.c (modified) (3 diffs)
-
src/psphotStackMatchPSFsUtils.c (modified) (2 diffs)
-
src/psphotTestPSF.c (modified) (1 diff)
-
src/psphotVisual.c (modified) (2 diffs)
-
test/tap_psphot_forced.pro (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psphot/src/models/pmModel_STRAIL.c
r19881 r30975 496 496 497 497 params[PM_PAR_SKY] = Smoments->Sky; 498 params[PM_PAR_I0] = peak-> flux;498 params[PM_PAR_I0] = peak->rawFlux; 499 499 params[PM_PAR_XPOS] = peak->xf; 500 500 params[PM_PAR_YPOS] = peak->yf; -
branches/eam_branches/ipp-20110213/psphot/src/models/pmModel_TEST1.c
r19881 r30975 139 139 140 140 PAR[PM_PAR_SKY] = moments->Sky; 141 PAR[PM_PAR_I0] = peak-> flux;141 PAR[PM_PAR_I0] = peak->rawFlux; 142 142 PAR[PM_PAR_XPOS] = peak->xf; 143 143 PAR[PM_PAR_YPOS] = peak->yf; -
branches/eam_branches/ipp-20110213/psphot/src/psphot.h
r30936 r30975 182 182 // used by psphotFindDetections 183 183 pmReadout *psphotSignificanceImage (pmReadout *readout, psMetadata *recipe, psImageMaskType maskVal); 184 psArray *psphotFindPeaks (p sImage*significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax);184 psArray *psphotFindPeaks (pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax); 185 185 bool psphotFindFootprints (pmDetections *detections, pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int pass, psImageMaskType maskVal); 186 186 psErrorCode psphotCullPeaks(const pmReadout *readout, const pmReadout *signifRO, const psMetadata *recipe, psArray *footprints); -
branches/eam_branches/ipp-20110213/psphot/src/psphotBasicDeblend.c
r29936 r30975 63 63 for (int i = 0; i < SN->n; i++) { 64 64 source = sources->data[i]; 65 SN->data.F32[i] = source->peak-> SN;65 SN->data.F32[i] = source->peak->rawFlux; 66 66 } 67 67 psVector *index = psVectorSortIndex (NULL, SN); … … 115 115 // threshold is fraction of the source peak flux 116 116 // image is background subtracted; source->moments->Sky should always be 0.0 117 threshold = FRACTION * s ource->peak->SN;117 threshold = FRACTION * sqrt(source->peak->detValue); 118 118 // threshold is no less than NSIGMA 119 119 threshold = PS_MAX (threshold, NSIGMA); … … 138 138 testSource = overlap->data[k]; 139 139 if (testSource->mode & PM_SOURCE_MODE_BLEND) continue; 140 if (testSource->peak-> value > source->peak->value) continue;140 if (testSource->peak->rawFlux > source->peak->rawFlux) continue; 141 141 for (int j = 0; j < xv->n; j+=2) { 142 142 if (fabs(yv->data.F32[j] - testSource->peak->y) > 0.5) continue; -
branches/eam_branches/ipp-20110213/psphot/src/psphotBlendFit.c
r30764 r30975 104 104 105 105 // source analysis is done in S/N order (brightest first) 106 sources = psArraySort (sources, pmSourceSortBy SN);106 sources = psArraySort (sources, pmSourceSortByFlux); 107 107 if (!sources->n) { 108 108 psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping blend"); … … 243 243 244 244 // limit selection to some SN limit 245 if (s ource->peak->SN< FIT_SN_LIM) continue;245 if (sqrt(source->peak->detValue) < FIT_SN_LIM) continue; 246 246 247 247 // exclude sources outside optional analysis region -
branches/eam_branches/ipp-20110213/psphot/src/psphotChoosePSF.c
r30772 r30975 70 70 71 71 // examine PSF sources in S/N order (brightest first) 72 sources = psArraySort (sources, pmSourceSortBy SN);72 sources = psArraySort (sources, pmSourceSortByFlux); 73 73 74 74 // structure to store user options defining the psf -
branches/eam_branches/ipp-20110213/psphot/src/psphotCullPeaks.c
r30932 r30975 1 1 # include "psphotInternal.h" 2 3 # define CULL_WITH_SMOOTHED_IMAGE 14 2 5 3 /* … … 63 61 float SAT_THRESHOLD = 0.05*SATURATION; 64 62 65 # if ( CULL_WITH_SMOOTHED_IMAGE)63 # if (PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE) 66 64 psLogMsg ("psphot", PS_LOG_INFO, "Culling peaks from footprints using the smoothed image"); 67 65 # else … … 81 79 pmPeak *brightPeak = fp->peaks->data[0]; 82 80 float max_threshold = SAT_TEST_LEVEL; 83 if (brightPeak-> flux > SAT_TEST_LEVEL) {81 if (brightPeak->rawFlux > SAT_TEST_LEVEL) { 84 82 max_threshold = SAT_THRESHOLD; 85 83 brightPeak->type = PM_PEAK_SUSPECT_SATURATION; 86 84 } 87 85 88 # if ( CULL_WITH_SMOOTHED_IMAGE)86 # if (PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE) 89 87 // New (post r30869) style of culling using the smoothed image and variance (S/N) 90 88 // if we cull using the significance image, then the definition of variance is different (thus the bool in arg 8) 91 if (pmFootprintCullPeaks(signifR->image, signifR->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, false) != PS_ERR_NONE) {89 if (pmFootprintCullPeaks(signifR->image, signifR->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, true) != PS_ERR_NONE) { 92 90 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id); 93 91 } 94 92 # else 95 93 // Old (pre r30869) style of culling using the raw image and variance 96 if (pmFootprintCullPeaks(readout->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, true) != PS_ERR_NONE) {94 if (pmFootprintCullPeaks(readout->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, false) != PS_ERR_NONE) { 97 95 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id); 98 }99 # endif100 101 // Alternate style of culling using the smoothed image and raw variance (probably a bad idea)102 # if (0)103 if (pmFootprintCullPeaks(signifR->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, true) != PS_ERR_NONE) {104 return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id);105 96 } 106 97 # endif -
branches/eam_branches/ipp-20110213/psphot/src/psphotDeblendSatstars.c
r30871 r30975 74 74 for (int i = 0; i < SN->n; i++) { 75 75 source = sources->data[i]; 76 SN->data.F32[i] = source->peak-> SN;76 SN->data.F32[i] = source->peak->rawFlux; 77 77 } 78 78 psVector *index = psVectorSortIndex (NULL, SN); … … 86 86 // XXX filter? if (source->mode & PM_SOURCE_MODE_SATSTAR) continue; 87 87 if (source->mode & PM_SOURCE_MODE_BLEND) continue; 88 if (source->peak-> flux < SAT_TEST_LEVEL) continue;88 if (source->peak->rawFlux < SAT_TEST_LEVEL) continue; 89 89 90 90 // save these for reference below -
branches/eam_branches/ipp-20110213/psphot/src/psphotEllipticalProfile.c
r27819 r30975 82 82 // } 83 83 84 psphotPetrosianVisualProfileRadii (radius, flux, radiusRaw, fluxRaw, source->peak-> flux, 0.0);84 psphotPetrosianVisualProfileRadii (radius, flux, radiusRaw, fluxRaw, source->peak->rawFlux, 0.0); 85 85 // psphotPetrosianVisualProfileByAngle (radius, flux); 86 86 -
branches/eam_branches/ipp-20110213/psphot/src/psphotExtendedSourceAnalysis.c
r30707 r30975 79 79 80 80 // source analysis is done in S/N order (brightest first) 81 sources = psArraySort (sources, pmSourceSortBy SN);81 sources = psArraySort (sources, pmSourceSortByFlux); 82 82 83 83 // option to limit analysis to a specific region … … 105 105 // limit selection to some SN limit 106 106 assert (source->peak); // how can a source not have a peak? 107 if (s ource->peak->SN< SN_LIM) continue;107 if (sqrt(source->peak->detValue) < SN_LIM) continue; 108 108 109 109 // limit selection by analysis region -
branches/eam_branches/ipp-20110213/psphot/src/psphotExtendedSourceAnalysisByObject.c
r30776 r30975 61 61 62 62 // source analysis is done in S/N order (brightest first) 63 objects = psArraySort (objects, pmPhotObjSortBy SN);63 objects = psArraySort (objects, pmPhotObjSortByFlux); 64 64 65 65 // process the objects in order. … … 88 88 // limit selection to some SN limit 89 89 assert (source->peak); // how can a source not have a peak? 90 if (s ource->peak->SN< SN_LIM) continue;90 if (sqrt(source->peak->detValue) < SN_LIM) continue; 91 91 measureSource = true; 92 92 } -
branches/eam_branches/ipp-20110213/psphot/src/psphotExtendedSourceFits.c
r30780 r30975 146 146 147 147 // source analysis is done in S/N order (brightest first) 148 sources = psArraySort (sources, pmSourceSortBy SN);148 sources = psArraySort (sources, pmSourceSortByFlux); 149 149 150 150 // choose Cx, Cy (see psphotThreadTools.c for overview of the concepts) … … 383 383 // limit selection to some SN limit 384 384 assert (source->peak); // how can a source not have a peak? 385 if (s ource->peak->SN< SNlim) {385 if (sqrt(source->peak->detValue) < SNlim) { 386 386 Nfaint ++; 387 387 continue; -
branches/eam_branches/ipp-20110213/psphot/src/psphotFindDetections.c
r30903 r30975 93 93 94 94 // detect the peaks in the significance image 95 detections->peaks = psphotFindPeaks (significance ->variance, readout, recipe, threshold, NMAX);95 detections->peaks = psphotFindPeaks (significance, readout, recipe, threshold, NMAX); 96 96 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PEAK_THRESHOLD", PS_META_REPLACE, "Peak Detection Threshold", threshold); 97 97 if (!detections->peaks) { -
branches/eam_branches/ipp-20110213/psphot/src/psphotFindPeaks.c
r26894 r30975 4 4 // image must be constructed to represent (S/N)^2. If nMax is non-zero, only return a maximum 5 5 // of nMax peaks 6 psArray *psphotFindPeaks (p sImage*significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax) {6 psArray *psphotFindPeaks (pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax) { 7 7 8 8 bool status = false; … … 11 11 12 12 // find the peaks in the smoothed image 13 psArray *peaks = pmPeaksInImage (significance, threshold); 13 // NOTE : significance->variance actually carries the detection S/N image 14 psArray *peaks = pmPeaksInImage (significance->variance, threshold); 14 15 if (peaks == NULL) { 15 16 // we only get a NULL peaks array due to a programming or config error. … … 34 35 for (int i = 0; i < peaks->n; i++) { 35 36 pmPeak *peak = peaks->data[i]; 36 peak->SN = sqrt(peak->value); 37 peak->flux = readout->image->data.F32[peak->y-row0][peak->x-col0]; 38 // if (peak->flux / peak->value > 5.0/12.0) { 39 // psWarning ("odd peak levels (1)"); 40 // } 41 // if (peak->value / peak->flux > 5*12.0) { 42 // psWarning ("odd peak levels (2)"); 43 // } 37 peak->rawFlux = readout->image->data.F32[peak->y-row0][peak->x-col0]; 38 peak->rawFluxStdev = sqrt(readout->variance->data.F32[peak->y-row0][peak->x-col0]); 39 peak->smoothFlux = significance->image->data.F32[peak->y-row0][peak->x-col0]; 40 peak->smoothFluxStdev = peak->smoothFlux / sqrt(significance->variance->data.F32[peak->y-row0][peak->x-col0]); 41 // NOTE smoothFluxStdev is actually (sqrt(variance) / covar_factor) 42 43 // do we need this or not? 44 // peak->SN = sqrt(peak->detValue); 45 44 46 if (readout->variance && isfinite (peak->dx)) { 45 47 peak->dx *= sqrt(readout->variance->data.F32[peak->y-row0][peak->x-col0]); … … 51 53 52 54 // limit the total number of returned peaks as specified 53 psArraySort (peaks, pmPeak SortBySN);55 psArraySort (peaks, pmPeaksSortByRawFluxDescend); 54 56 if (nMax && (peaks->n > nMax)) { 55 57 psArray *tmpPeaks = psArrayAllocEmpty (nMax); -
branches/eam_branches/ipp-20110213/psphot/src/psphotFitSourcesLinear.c
r30784 r30975 174 174 if (modelSum < 0.8) { 175 175 fprintf (stderr, "low-sig model @ %f, %f (%f sum, %f peak)\n", 176 source->peak->xf, source->peak->yf, modelSum, source->peak-> flux);176 source->peak->xf, source->peak->yf, modelSum, source->peak->rawFlux); 177 177 } 178 178 -
branches/eam_branches/ipp-20110213/psphot/src/psphotGuessModels.c
r30932 r30975 176 176 177 177 // the guess central intensity comes from the peak: 178 float Io = source->peak-> flux;178 float Io = source->peak->rawFlux; 179 179 180 180 // We have two options to get a guess for the object position: the position from the -
branches/eam_branches/ipp-20110213/psphot/src/psphotLoadSRCTEXT.c
r29004 r30975 78 78 79 79 source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE); 80 source->peak->flux = peakFlux; 80 source->peak->rawFlux = peakFlux; 81 source->peak->smoothFlux = peakFlux; 81 82 source->peak->dx = dPAR[PM_PAR_XPOS]; 82 83 source->peak->dy = dPAR[PM_PAR_YPOS]; -
branches/eam_branches/ipp-20110213/psphot/src/psphotMergeSources.c
r30883 r30975 111 111 112 112 // the supplied peak flux needs to be re-normalized 113 source->peak->flux = 1.0; 114 source->peak->value = 1.0; 113 source->peak->rawFlux = 1.0; 114 source->peak->smoothFlux = 1.0; 115 source->peak->detValue = 1.0; 115 116 116 117 // drop the loaded source modelPSF … … 282 283 for (int i = 0; i < sources->n; i++) { 283 284 pmSource *source = sources->data[i]; 284 source->peak->flux = source->moments->Peak; 285 source->peak->rawFlux = source->moments->Peak; 286 source->peak->smoothFlux = source->moments->Peak; 285 287 } 286 288 … … 332 334 float ypos = model->params->data.F32[PM_PAR_YPOS]; 333 335 334 pmPeak *peak = pmPeakAlloc(xpos, ypos, 1.0, PM_PEAK_LONE);336 pmPeak *peak = pmPeakAlloc(xpos, ypos, flux, PM_PEAK_LONE); 335 337 peak->xf = xpos; 336 338 peak->yf = ypos; 337 peak->flux = flux; // this are being set wrong, but does it matter? 338 339 if (isfinite (source->errMag) && (source->errMag > 0.0)) { 340 peak->SN = 1.0 / source->errMag; 341 } else { 342 peak->SN = 0.0; 343 } 339 peak->rawFlux = flux; // this are being set wrong, but does it matter? 340 peak->smoothFlux = flux; // this are being set wrong, but does it matter? 344 341 345 342 psArrayAdd (detections->peaks, 100, peak); … … 383 380 float ypos = model->params->data.F32[PM_PAR_YPOS]; 384 381 385 pmPeak *peak = pmPeakAlloc(xpos, ypos, 1.0, PM_PEAK_LONE);382 pmPeak *peak = pmPeakAlloc(xpos, ypos, flux, PM_PEAK_LONE); 386 383 peak->xf = xpos; 387 384 peak->yf = ypos; 388 peak->flux = flux; // this are being set wrong, but does it matter? 389 390 if (isfinite (source->errMag) && (source->errMag > 0.0)) { 391 peak->SN = 1.0 / source->errMag; 392 } else { 393 peak->SN = 0.0; 394 } 385 peak->rawFlux = flux; // this are being set wrong, but does it matter? 386 peak->smoothFlux = flux; // this are being set wrong, but does it matter? 395 387 396 388 source->peak = peak; … … 686 678 objectsOut->data[k] = objectOut; 687 679 688 objectOut-> SN = objectSrc->SN;689 objectOut->x = objectSrc->x;690 objectOut->y = objectSrc->y;680 objectOut->flux = objectSrc->flux; 681 objectOut->x = objectSrc->x; 682 objectOut->y = objectSrc->y; 691 683 692 684 objectOut->sources = psArrayAlloc(objectSrc->sources->n); -
branches/eam_branches/ipp-20110213/psphot/src/psphotMosaicSubimage.c
r21253 r30975 29 29 inRegion = psRegionForImage (inImage, inRegion); 30 30 31 float peak = source->peak-> flux;31 float peak = source->peak->rawFlux; 32 32 33 33 psImage *subImage = psImageSubset (inImage, inRegion); -
branches/eam_branches/ipp-20110213/psphot/src/psphotOutput.c
r30749 r30975 70 70 // float mpeak = model ? model->params->data.F32[PM_PAR_I0] : NAN; 71 71 // bool subtracted = source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED; 72 // fprintf (stderr, "%d %d : %d : %f %f : %f %f\n", source->peak->x, source->peak->y, subtracted, source->peak-> flux, source->pixels->data.F32[yc][xc], mcore, mpeak);72 // fprintf (stderr, "%d %d : %d : %f %f : %f %f\n", source->peak->x, source->peak->y, subtracted, source->peak->rawFlux, source->pixels->data.F32[yc][xc], mcore, mpeak); 73 73 74 74 fprintf (f, "%6.1f %6.1f : %6.1f %6.1f : %8.3f %8.3f %8.3f : %f : %f %f %f : %f\n", … … 436 436 if (!source->moments) continue; 437 437 438 float Io = source->peak-> flux;438 float Io = source->peak->rawFlux; 439 439 440 440 fprintf (f, "%f %f : %f %f :: %f\n", -
branches/eam_branches/ipp-20110213/psphot/src/psphotPetrosianAnalysis.c
r30624 r30975 29 29 30 30 // source analysis is done in S/N order (brightest first) 31 sources = psArraySort (sources, pmSourceSortBy SN);31 sources = psArraySort (sources, pmSourceSortByFlux); 32 32 33 33 // choose the sources of interest -
branches/eam_branches/ipp-20110213/psphot/src/psphotRadialApertures.c
r30932 r30975 79 79 // source analysis is done in S/N order (brightest first) 80 80 // XXX are we getting the objects out of order? does it matter? 81 sources = psArraySort (sources, pmSourceSortBy SN);81 sources = psArraySort (sources, pmSourceSortByFlux); 82 82 83 83 // option to limit analysis to a specific region … … 99 99 // limit selection to some SN limit 100 100 assert (source->peak); // how can a source not have a peak? 101 if (s ource->peak->SN< SN_LIM) continue;101 if (sqrt(source->peak->detValue) < SN_LIM) continue; 102 102 103 103 // limit selection by analysis region -
branches/eam_branches/ipp-20110213/psphot/src/psphotRadialAperturesByObject.c
r30776 r30975 60 60 61 61 // source analysis is done in S/N order (brightest first) 62 objects = psArraySort (objects, pmPhotObjSortBy SN);62 objects = psArraySort (objects, pmPhotObjSortByFlux); 63 63 64 64 // generate look-up arrays for readouts … … 106 106 // limit selection to some SN limit 107 107 assert (source->peak); // how can a source not have a peak? 108 if (s ource->peak->SN< SN_LIM) continue;108 if (sqrt(source->peak->detValue) < SN_LIM) continue; 109 109 110 110 int index = source->imageID; -
branches/eam_branches/ipp-20110213/psphot/src/psphotRadialProfile.c
r30776 r30975 14 14 float Rmax = 200; 15 15 float fluxMin = 0.0; 16 float fluxMax = source->peak-> flux;16 float fluxMax = source->peak->rawFlux; 17 17 18 18 bool RAW_RADIUS = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_RAW_RADIUS"); -
branches/eam_branches/ipp-20110213/psphot/src/psphotReplaceUnfit.c
r30771 r30975 239 239 if (isPSF || model->isPCM) { 240 240 // the guess central intensity comes from the peak: 241 float Io = source->peak-> flux;241 float Io = source->peak->rawFlux; 242 242 float Xo = source->modelPSF->params->data.F32[PM_PAR_XPOS]; 243 243 float Yo = source->modelPSF->params->data.F32[PM_PAR_YPOS]; -
branches/eam_branches/ipp-20110213/psphot/src/psphotSavePSFStars.c
r19869 r30975 17 17 18 18 // examine PSF sources in S/N order (brightest first) 19 sources = psArraySort (sources, pmSourceSortBy SN);19 sources = psArraySort (sources, pmSourceSortByFlux); 20 20 21 21 // counters to track the size of the image and area used in a row -
branches/eam_branches/ipp-20110213/psphot/src/psphotSourceFits.c
r30790 r30975 51 51 psArrayAdd (sourceSet, 16, source); 52 52 53 psTrace ("psphot", 4, "fitting blended source at %f %f : %f\n", source->peak->xf, source->peak->yf, source->peak-> flux);53 psTrace ("psphot", 4, "fitting blended source at %f %f : %f\n", source->peak->xf, source->peak->yf, source->peak->rawFlux); 54 54 55 55 // we need to include all blends in the fit (unless primary is saturated?) … … 69 69 70 70 // XXX assume local sky is 0.0? 71 model->params->data.F32[PM_PAR_I0] = blend->peak-> flux;71 model->params->data.F32[PM_PAR_I0] = blend->peak->rawFlux; 72 72 model->params->data.F32[PM_PAR_XPOS] = blend->peak->xf; 73 73 model->params->data.F32[PM_PAR_YPOS] = blend->peak->yf; … … 83 83 psArrayAdd (sourceSet, 16, blend); 84 84 85 psTrace ("psphot", 5, "adding source at %f %f : %f\n", blend->peak->xf, blend->peak->yf, blend->peak-> flux);85 psTrace ("psphot", 5, "adding source at %f %f : %f\n", blend->peak->xf, blend->peak->yf, blend->peak->rawFlux); 86 86 87 87 // free to avoid double counting model -
branches/eam_branches/ipp-20110213/psphot/src/psphotSourceMatch.c
r30892 r30975 233 233 float peakFlux = readout->image->data.F32[(int)(obj->y-row0-0.5)][(int)(obj->x-col0-0.5)]; 234 234 pmPeak *peak = pmPeakAlloc(obj->x, obj->y, peakFlux, PM_PEAK_LONE); 235 peak-> flux = peakFlux;236 peak-> SN = 1.0;235 peak->rawFlux = peakFlux; 236 peak->smoothFlux = peakFlux; 237 237 peak->xf = obj->x; 238 238 peak->yf = obj->y; -
branches/eam_branches/ipp-20110213/psphot/src/psphotSourcePlots.c
r25755 r30975 18 18 19 19 // examine PSF sources in S/N order (brightest first) 20 sources = psArraySort (sources, pmSourceSortBy SN);20 sources = psArraySort (sources, pmSourceSortByFlux); 21 21 22 22 // counters to track the size of the image and area used in a row -
branches/eam_branches/ipp-20110213/psphot/src/psphotSourceSize.c
r30772 r30975 1268 1268 1269 1269 // Soften variances (add systematic error) 1270 float softening = options->soft * PS_SQR(source->peak-> flux); // Softening for variances1270 float softening = options->soft * PS_SQR(source->peak->rawFlux); // Softening for variances 1271 1271 1272 1272 // Across the middle: y = 0 -
branches/eam_branches/ipp-20110213/psphot/src/psphotSourceStats.c
r30883 r30975 398 398 399 399 // skip faint sources for moments measurement 400 if (s ource->peak->SN< MIN_SN) {400 if (sqrt(source->peak->detValue) < MIN_SN) { 401 401 source->mode |= PM_SOURCE_MODE_BELOW_MOMENTS_SN; 402 402 Nfaint++; … … 494 494 int Nout[NSIGMA]; // number of stars found in clump : use this to control the number of regions measured by psphotRoughClass 495 495 496 // this sorts by peak-> SN497 sources = psArraySort (sources, pmSourceSortBy SN);496 // this sorts by peak->rawFlux 497 sources = psArraySort (sources, pmSourceSortByFlux); 498 498 499 499 // loop over radii: … … 508 508 509 509 // skip faint sources for moments measurement 510 if (s ource->peak->SN< MIN_SN) {510 if (sqrt(source->peak->detValue) < MIN_SN) { 511 511 continue; 512 512 } -
branches/eam_branches/ipp-20110213/psphot/src/psphotStackMatchPSFsUtils.c
r30772 r30975 64 64 } 65 65 if (!source->peak) continue; 66 if (s ource->peak->SN< SN_MIN) continue;66 if (sqrt(source->peak->detValue) < SN_MIN) continue; 67 67 coordsFromSource(&x->data.F32[numGood], &y->data.F32[numGood], source); 68 68 numGood++; … … 81 81 } 82 82 if (!source->peak) continue; 83 if (s ource->peak->SN< SN_MIN) continue;83 if (sqrt(source->peak->detValue) < SN_MIN) continue; 84 84 float xSource, ySource; // Coordinates of source 85 85 coordsFromSource(&xSource, &ySource, source); -
branches/eam_branches/ipp-20110213/psphot/src/psphotTestPSF.c
r21183 r30975 17 17 18 18 // examine PSF sources in S/N order (brightest first) 19 sources = psArraySort (sources, pmSourceSortBy SN);19 sources = psArraySort (sources, pmSourceSortByFlux); 20 20 21 21 // array to store candidate PSF stars -
branches/eam_branches/ipp-20110213/psphot/src/psphotVisual.c
r30883 r30975 1029 1029 1030 1030 // examine PSF sources in S/N order (brightest first) 1031 sources = psArraySort (sources, pmSourceSortBy SN);1031 sources = psArraySort (sources, pmSourceSortByFlux); 1032 1032 1033 1033 // counters to track the size of the image and area used in a row … … 1181 1181 1182 1182 // examine PSF sources in S/N order (brightest first) 1183 sources = psArraySort (sources, pmSourceSortBy SN);1183 sources = psArraySort (sources, pmSourceSortByFlux); 1184 1184 1185 1185 // counters to track the size of the image and area used in a row -
branches/eam_branches/ipp-20110213/psphot/test/tap_psphot_forced.pro
r30838 r30975 134 134 135 135 # create the chip output 136 echo ppImage $ppImageConfig -file $basename.fits $basename 137 exec ppImage $ppImageConfig -file $basename.fits $basename 136 echo ppImage $ppImageConfig -file $basename.fits $basename -seed 12345 137 exec ppImage $ppImageConfig -file $basename.fits $basename -seed 12345 138 138 end 139 139 … … 158 158 $forcedOpt = $forcedOpt -psf $basename.psf 159 159 $forcedOpt = $forcedOpt -srctext $basename.$2.frc.dat 160 exec psphotForced $forcedOpt $basename.$2.frc 160 exec psphotForced $forcedOpt $basename.$2.frc -seed 12345 161 161 end 162 162
Note:
See TracChangeset
for help on using the changeset viewer.
