Changeset 13411 for trunk/psphot/src/psphotMergeSources.c
- Timestamp:
- May 17, 2007, 11:53:28 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMergeSources.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMergeSources.c
r13225 r13411 5 5 6 6 for (int i = 0; i < newSources->n; i++) { 7 pmSource *source = newSources->data[i];8 psArrayAdd (oldSources, 100, source);7 pmSource *source = newSources->data[i]; 8 psArrayAdd (oldSources, 100, source); 9 9 } 10 10 return true; 11 11 } 12 12 13 // merge the externally supplied sources with the existing sources. mark them as having 13 // merge the externally supplied sources with the existing sources. mark them as having 14 14 // mode PM_SOURCE_MODE_EXTERNAL 15 bool psphotLoadExtSources (pmConfig *config, pmFPAview *view, psArray *sources) {15 bool psphotLoadExtSources (pmConfig *config, const pmFPAview *view, psArray *sources) { 16 16 17 17 // find the currently selected readout 18 18 pmReadout *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT.CMF"); 19 19 if (!readout) { 20 psLogMsg ("psphot", 3, "no external sources supplied");21 return true;20 psLogMsg ("psphot", 3, "no external sources supplied"); 21 return true; 22 22 } 23 23 24 24 psArray *extSources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES"); 25 25 if (!extSources) { 26 psLogMsg ("psphot", 3, "no external sources for this readout");27 return true;26 psLogMsg ("psphot", 3, "no external sources for this readout"); 27 return true; 28 28 } 29 29 30 30 for (int i = 0; i < extSources->n; i++) { 31 pmSource *source = extSources->data[i];32 source->mode |= PM_SOURCE_MODE_EXTERNAL;33 pmModel *model = source->modelPSF;31 pmSource *source = extSources->data[i]; 32 source->mode |= PM_SOURCE_MODE_EXTERNAL; 33 pmModel *model = source->modelPSF; 34 34 35 float xpos = model->params->data.F32[PM_PAR_XPOS];36 float ypos = model->params->data.F32[PM_PAR_YPOS];35 float xpos = model->params->data.F32[PM_PAR_XPOS]; 36 float ypos = model->params->data.F32[PM_PAR_YPOS]; 37 37 38 source->peak = pmPeakAlloc(xpos, ypos, 1.0, PM_PEAK_LONE);39 source->peak->xf = xpos;40 source->peak->yf = ypos;41 source->peak->flux = 1.0;42 43 // drop the loaded source modelPSF44 psFree (source->modelPSF);45 source->modelPSF = NULL;38 source->peak = pmPeakAlloc(xpos, ypos, 1.0, PM_PEAK_LONE); 39 source->peak->xf = xpos; 40 source->peak->yf = ypos; 41 source->peak->flux = 1.0; 42 43 // drop the loaded source modelPSF 44 psFree (source->modelPSF); 45 source->modelPSF = NULL; 46 46 } 47 47
Note:
See TracChangeset
for help on using the changeset viewer.
