Changeset 20070 for trunk/psphot/src/psphotMergeSources.c
- Timestamp:
- Oct 11, 2008, 11:55:22 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMergeSources.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMergeSources.c
r13411 r20070 51 51 return true; 52 52 } 53 54 pmDetections *detections = psphotLoadPSFSources (pmConfig *config, const pmFPAview *view) { 55 56 // find the currently selected readout 57 pmReadout *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT.CMF"); 58 if (!readout) { 59 psLogMsg ("psphot", 3, "readout not found"); 60 return NULL; 61 } 62 63 pmDetections *detections = pmDetectionsAlloc(); 64 65 psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES"); 66 if (!sources) { 67 psLogMsg ("psphot", 3, "no psf sources for this readout"); 68 return detections; 69 } 70 71 detections->peaks = psArrayAllocEmpty(100); 72 73 for (int i = 0; i < sources->n; i++) { 74 pmSource *source = sources->data[i]; 75 pmModel *model = source->modelPSF; 76 77 float xpos = model->params->data.F32[PM_PAR_XPOS]; 78 float ypos = model->params->data.F32[PM_PAR_YPOS]; 79 80 pmPeak *peak = pmPeakAlloc(xpos, ypos, 1.0, PM_PEAK_LONE); 81 peak->xf = xpos; 82 peak->yf = ypos; 83 peak->flux = 1.0; 84 85 psArrayAdd (detections->peaks, 100, peak); 86 psFree (peak); 87 } 88 89 psLogMsg ("psphot", 3, "%ld PSF sources loaded", detections->peaks->nn); 90 91 return detections; 92 }
Note:
See TracChangeset
for help on using the changeset viewer.
