- Timestamp:
- Jan 20, 2010, 12:59:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psphot.stack.20100120/src/psphotFindDetections.c
r26634 r26643 2 2 3 3 // smooth the image, search for peaks, optionally define footprints based on the peaks 4 pmDetections *psphotFindDetections (pmDetections *detections, pmReadout *readout, psMetadata *recipe) {4 bool psphotFindDetections (pmConfig *config, const pmFPAview *view, const char *filename, int index) { 5 5 6 6 bool status; … … 9 9 int NMAX = 0; 10 10 11 // find the currently selected readout 12 pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest 13 psAssert (readout, "missing file?"); 14 15 pmReadout *readout = pmFPAviewThisReadout(view, file->fpa); 16 psAssert (readout, "missing readout?"); 17 18 // select the appropriate recipe information 19 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 20 psAssert (recipe, "missing recipe?"); 21 11 22 // user-defined masks to test for good/bad pixels (build from recipe list if not yet set) 12 23 psImageMaskType maskVal = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels 13 assert (maskVal);24 psAssert (maskVal, "missing mask value?"); 14 25 15 26 // Use the new pmFootprints approach? … … 71 82 psphotVisualShowFootprints (detections); 72 83 73 return detections; 84 // save detections on the readout->analysis 85 if (!psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_PTR, "psphot detectinos", detections)) { 86 psError (PSPHOT_ERR_CONFIG, false, "problem saving detections on readout"); 87 return NULL; 88 } 89 90 return true; 74 91 } 75 92 … … 77 94 // otherwise it only contains the new peaks. 78 95 79 # if 0 80 // XXX where do we place the N sets of detections? 96 // for now, let's store the detections on the readout->analysis for each readout 81 97 bool psphotFindDetections (pmConfig *config, const pmFPAview *view) 82 98 { … … 84 100 85 101 int num = psMetadataAddS32 (&status, config->arguments, "PSPHOT.INPUT.NUM"); 86 psA bort (!status, "programming error: must define PSPHOT.INPUT.NUM");102 psAssert (status, "programming error: must define PSPHOT.INPUT.NUM"); 87 103 88 104 // loop over the available readouts 89 105 for (int i = 0; i < num; i++) { 90 106 if (!psphotFindDetectionsReadout (config, view, "PSPHOT.INPUT", i)) { 91 psError (PSPHOT_ERR_CONFIG, false, "failed to subtract backgroundfor PSPHOT.INPUT entry %d", i);107 psError (PSPHOT_ERR_CONFIG, false, "failed to find initial detections for PSPHOT.INPUT entry %d", i); 92 108 return false; 93 109 } … … 95 111 return true; 96 112 } 97 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
