- Timestamp:
- May 3, 2010, 8:45:22 AM (16 years ago)
- Location:
- branches/simmosaic_branches
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (1 prop)
-
psphot/src/psphotDeblendSatstars.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simmosaic_branches
- Property svn:mergeinfo changed
-
branches/simmosaic_branches/psphot
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/psphot merged eligible /branches/eam_branches/stackphot.20100406/psphot 27622-27655 /branches/pap_delete/psphot 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/simmosaic_branches/psphot/src
- Property svn:ignore
-
old new 18 18 psphotVersionDefinitions.h 19 19 psphotMomentsStudy 20 psphotPetrosianStudy 21 psphotForced 22 psphotMakePSF 23 psphotStack
-
- Property svn:ignore
-
branches/simmosaic_branches/psphot/src/psphotDeblendSatstars.c
r21519 r27839 1 1 # include "psphotInternal.h" 2 2 3 bool psphotDeblendSatstars (psArray *sources, psMetadata *recipe) { 3 // for now, let's store the detections on the readout->analysis for each readout 4 bool psphotDeblendSatstars (pmConfig *config, const pmFPAview *view) 5 { 6 bool status = true; 7 8 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 9 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 10 11 // loop over the available readouts 12 for (int i = 0; i < num; i++) { 13 if (!psphotDeblendSatstarsReadout (config, view, "PSPHOT.INPUT", i)) { 14 psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for PSPHOT.INPUT entry %d", i); 15 return false; 16 } 17 } 18 return true; 19 } 20 21 bool psphotDeblendSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filename, int fileIndex) { 4 22 5 23 int N; 6 24 pmSource *source; 25 bool status; 7 26 8 27 psTimerStart ("psphot.deblend.sat"); 9 28 10 29 int Nblend = 0; 11 float SAT_TEST_LEVEL = 50000;12 30 float SAT_MIN_RADIUS = 5.0; 31 32 // find the currently selected readout 33 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, fileIndex); // File of interest 34 psAssert (file, "missing file?"); 35 36 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 37 psAssert (readout, "missing readout?"); 38 39 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 40 psAssert (detections, "missing detections?"); 41 42 psArray *sources = detections->newSources; 43 psAssert (sources, "missing sources?"); 44 45 if (!sources->n) { 46 psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping satstar blend"); 47 return true; 48 } 49 50 // select the appropriate recipe information 51 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 52 psAssert (recipe, "missing recipe?"); 53 54 pmCell *cell = readout->parent; 55 float SATURATION = 0.75*psMetadataLookupF32 (&status, cell->concepts, "CELL.SATURATION"); 56 float SAT_TEST_LEVEL = 0.5*SATURATION; 13 57 14 58 // we need sources spatially-sorted to find overlaps … … 32 76 // XXX filter? if (source->mode & PM_SOURCE_MODE_SATSTAR) continue; 33 77 if (source->mode & PM_SOURCE_MODE_BLEND) continue; 34 if (source->peak->flux < SAT _TEST_LEVEL) continue;78 if (source->peak->flux < SATURATION) continue; 35 79 36 80 // save these for reference below … … 45 89 psVector *xVec = contour->data[0]; 46 90 psVector *yVec = contour->data[1]; 47 48 // XXX should we filter based on the number of pixels in the contour? 91 if (xVec->n < 5) { 92 psFree(contour); 93 continue; 94 } 49 95 50 96 // find the center of the contour (let's just use mid[x,y]) … … 62 108 int yCenter = 0.5*(yMin + yMax); 63 109 psFree (contour); 110 111 psAssert (xCenter >= source->pixels->col0, "invalid shift in object center"); 112 psAssert (xCenter < source->pixels->col0 + source->pixels->numCols, "invalid shift in object center"); 113 psAssert (yCenter >= source->pixels->row0, "invalid shift in object center"); 114 psAssert (yCenter < source->pixels->row0 + source->pixels->numRows, "invalid shift in object center"); 64 115 65 116 // reset the peak for this source to the value of the center pixel
Note:
See TracChangeset
for help on using the changeset viewer.
