Changeset 27269
- Timestamp:
- Mar 12, 2010, 9:38:14 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20100225/psphot/src/psphotFitSourcesLinear.c
r26894 r27269 17 17 bool status = true; 18 18 19 // select the appropriate recipe information 20 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 21 assert (recipe); 22 19 23 int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 20 24 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); … … 22 26 // loop over the available readouts 23 27 for (int i = 0; i < num; i++) { 24 if (!psphotFitSourcesLinearReadout (config, view, "PSPHOT.INPUT", i, final)) { 28 29 // find the currently selected readout 30 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", i); // File of interest 31 psAssert (file, "missing file?"); 32 33 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 34 psAssert (readout, "missing readout?"); 35 36 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 37 psAssert (detections, "missing detections?"); 38 39 psArray *sources = detections->allSources; 40 psAssert (sources, "missing sources?"); 41 42 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF"); 43 psAssert (psf, "missing psf?"); 44 45 if (!psphotFitSourcesLinearReadout (recipe, readout, sources, psf, final)) { 25 46 psError (PSPHOT_ERR_CONFIG, false, "failed to fit sources (linear) for PSPHOT.INPUT entry %d", i); 26 47 return false; … … 30 51 } 31 52 32 bool psphotFitSourcesLinearReadout (p mConfig *config, const pmFPAview *view, const char *filename, int index, bool final) {53 bool psphotFitSourcesLinearReadout (psMetadata *recipe, pmReadout *readout, psArray *sources, pmPSF *psf, bool final) { 33 54 34 55 bool status; … … 36 57 float y; 37 58 float f; 38 // float r;39 40 // select the appropriate recipe information41 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);42 assert (recipe);43 44 // find the currently selected readout45 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest46 psAssert (file, "missing file?");47 48 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);49 psAssert (readout, "missing readout?");50 51 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");52 psAssert (detections, "missing detections?");53 54 psArray *sources = detections->allSources;55 psAssert (sources, "missing sources?");56 59 57 60 if (!sources->n) { … … 59 62 return true; 60 63 } 61 62 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");63 psAssert (sources, "missing psf?");64 64 65 65 psTimerStart ("psphot.linear");
Note:
See TracChangeset
for help on using the changeset viewer.
