Changeset 23211
- Timestamp:
- Mar 6, 2009, 12:25:41 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackSources.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackSources.c
r23190 r23211 110 110 pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout 111 111 pmPSF *psf = psMetadataLookupPtr(NULL, config->arguments, "PSF.TARGET"); // PSF for fake image 112 pmReadoutFakeFromSources(fake, FAKE_COLS, FAKE_ROWS, sourceLists->data[i], NULL, NULL, psf, 5, 0, false, true); 112 pmReadoutFakeFromSources(fake, FAKE_COLS, FAKE_ROWS, sourceLists->data[i], 113 NULL, NULL, psf, 5, 0, false, true); 113 114 psString name = NULL; 114 115 psStringAppend(&name, "start_%03d.fits", i); … … 185 186 psArray *sourcesBest = psArrayAllocEmpty (100); 186 187 187 // XXX something of a hack: require at 2 detections or 1/2 of the max possible188 int minMatches = PS_MAX (2, 0.5*num);188 // XXX something of a hack: require at least 2 detections or 1/2 of the max possible 189 int minMatches = PS_MAX(2, 0.3*num);// Minimum number of matches required 189 190 for (int i = 0; i < matches->n; i++) { 190 191 pmSourceMatch *match = matches->data[i]; // Match of interest 191 if (match->num < minMatches) continue; 192 if (match->num < minMatches) { 193 continue; 194 } 192 195 193 196 // We need to grab a single instance of this source: just take the first available 194 int nImage = match->image->data.S32[0];195 int nIndex = match->index->data.S32[0];196 psArray *sources = sourceLists->data[ nImage];197 pmSource *source = sources->data[ nIndex];198 199 // stick this sample source on sourcesBest200 psArrayAdd (sourcesBest, 100, source);201 }202 psMetadataAdd (sourcesCell->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY | PS_META_REPLACE,"psphot sources", sourcesBest);203 psLogMsg("ppStack", PS_LOG_INFO, "Selected %ld sources for photometry analysis \n", sourcesBest->n);204 psFree (sourcesBest);197 int image = match->image->data.S32[0]; // Index of image 198 int index = match->index->data.S32[0]; // Index of source within image 199 psArray *sources = sourceLists->data[image]; // Sources for image 200 pmSource *source = sources->data[index]; // Source of interest 201 202 psArrayAdd(sourcesBest, 100, source); 203 } 204 psMetadataAdd(sourcesCell->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY | PS_META_REPLACE, 205 "psphot sources", sourcesBest); 206 psLogMsg("ppStack", PS_LOG_INFO, "Selected %ld sources for photometry analysis", sourcesBest->n); 207 psFree(sourcesBest); 205 208 206 209 psFree(matches);
Note:
See TracChangeset
for help on using the changeset viewer.
