Changeset 11201
- Timestamp:
- Jan 19, 2007, 3:47:27 PM (19 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 5 edited
-
psphot.h (modified) (1 diff)
-
psphotArguments.c (modified) (1 diff)
-
psphotMergeSources.c (modified) (1 diff)
-
psphotParseCamera.c (modified) (1 diff)
-
psphotReadout.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphot.h
r11187 r11201 98 98 bool psphotFitSummary (); 99 99 bool psphotMergeSources (psArray *oldSources, psArray *newSources); 100 101 bool psphotSaveExtSources (pmReadout *readout); 102 bool psphotLoadExtSources (pmReadout *readout, psArray *sources); -
trunk/psphot/src/psphotArguments.c
r11190 r11201 103 103 pmConfigFileSetsMD (config->arguments, config, "WEIGHT", "-weight", "-weightlist"); 104 104 pmConfigFileSetsMD (config->arguments, config, "PSF", "-psf", "-psflist"); 105 pmConfigFileSetsMD (config->arguments, config, "SRC", "-src", "-srclist"); 105 106 106 107 // the input file is a required argument; if not found, we will exit -
trunk/psphot/src/psphotMergeSources.c
r11183 r11201 10 10 return true; 11 11 } 12 13 // XXX this is something of a hack: external sources are loaded with the same functions used to 14 // read and write the sources. These use the readout->analysis entry PSPHOT.SOURCES. at the 15 // beginning of psphotReadout, we need to rename any such entry for later use by 16 // psphotLoadExtSources below 17 18 bool psphotSaveExtSources (pmReadout *readout) { 19 20 psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES"); 21 if (!sources) return true; 22 23 psLogMsg ("psphot", 3, "%ld external sources loaded, saved for later use", sources->n); 24 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.EXTSRC", PS_DATA_ARRAY, "external sources", sources); 25 26 psMetadataRemoveKey (readout->analysis, "PSPHOT.SOURCES"); 27 28 return true; 29 } 30 31 // merge the externally supplied sources with the existing sources. mark them as having 32 // mode PM_SOURCE_MODE_EXTERNAL 33 bool psphotLoadExtSources (pmReadout *readout, psArray *sources) { 34 35 psArray *extSources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.EXTSRC"); 36 if (!extSources) return true; 37 38 for (int i = 0; i < extSources->n; i++) { 39 pmSource *source = extSources->data[i]; 40 source->mode |= PM_SOURCE_MODE_EXTERNAL; 41 pmModel *model = source->modelPSF; 42 43 float xpos = model->params->data.F32[PM_PAR_XPOS]; 44 float ypos = model->params->data.F32[PM_PAR_YPOS]; 45 46 source->peak = pmPeakAlloc(xpos, ypos, 1.0, PM_PEAK_LONE); 47 source->peak->xf = xpos; 48 source->peak->yf = ypos; 49 source->peak->flux = 1.0; 50 51 // drop the loaded source modelPSF 52 psFree (source->modelPSF); 53 source->modelPSF = NULL; 54 } 55 56 psphotMergeSources (sources, extSources); 57 psLogMsg ("psphot", 3, "%ld external sources merged to yield %ld total sources", extSources->n, sources->n); 58 59 return true; 60 } -
trunk/psphot/src/psphotParseCamera.c
r11190 r11201 20 20 pmFPAfileBindFromArgs (NULL, input, config, "INPUT.MASK", "MASK"); 21 21 pmFPAfileBindFromArgs (NULL, input, config, "INPUT.WEIGHT", "WEIGHT"); 22 23 // optionally load the PSF Model 24 pmFPAfile *psfInput = pmFPAfileBindFromArgs (NULL, input, config, "INPUT.PSF", "PSF"); 25 if (psfInput == NULL) { 22 23 // optionally load the PSF Model and/or fixed stars 24 pmFPAfileBindFromArgs (NULL, input, config, "INPUT.PSF", "PSF"); 25 pmFPAfile *srcInput = pmFPAfileBindFromArgs (NULL, input, config, "INPUT.SRC", "SRC"); 26 if (!srcInput) { 26 27 fprintf (stderr, "!"); 27 28 } -
trunk/psphot/src/psphotReadout.c
r11188 r11201 8 8 // find the currently selected readout 9 9 pmReadout *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT"); 10 psphotSaveExtSources (readout); 10 11 11 12 // optional break-point for processing … … 79 80 } 80 81 81 // construct an initial PSF model for each object 82 // include externally-supplied sources 83 psphotLoadExtSources (readout, sources); 84 85 // construct an initial model for each object 82 86 psphotGuessModels (readout, sources, recipe, psf); 83 87
Note:
See TracChangeset
for help on using the changeset viewer.
