- Timestamp:
- Jul 30, 2009, 5:20:29 PM (17 years ago)
- Location:
- branches/czw_branch/cleanup
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
magic/censorObjects/src/censorLoop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/cleanup
- Property svn:mergeinfo changed
/trunk (added) merged: 24714-24742,24744-24784,24786-24798,24801-24824,24827-24834,24836-24859,24861-24901,24903-24912,24914-24939
- Property svn:mergeinfo changed
-
branches/czw_branch/cleanup/magic/censorObjects/src/censorLoop.c
r24695 r24951 43 43 } 44 44 45 // select the input data sources 46 pmFPAfile *inMask = psMetadataLookupPtr (NULL, config->files, "CENSOR.INPUT.MASK"); 47 if (!inMask) { 48 psError(CENSOR_ERR_CONFIG, true, "Can't find input masks!\n"); 49 return false; 50 } 51 45 52 pmFPAview *view = pmFPAviewAlloc (0); 53 bool badMaskFile = false; 54 55 // check on the mask file at this level if possible 56 badMaskFile = censorBadFileByView(badMaskFile, inMask, config, view); 46 57 47 58 // files associated with the science image … … 49 60 50 61 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 51 psTrace ("censor", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 52 if (!chip->process || !chip->file_exists) { continue; } 62 psTrace ("censor", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 63 if (!chip->process || !chip->file_exists) { continue; } 64 65 // check on the mask file at this level if possible 66 badMaskFile = censorBadFileByView(badMaskFile, inMask, config, view); 67 53 68 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 54 69 55 70 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 56 psTrace ("censor", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 57 if (!cell->process || !cell->file_exists) { continue; } 71 psTrace ("censor", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 72 if (!cell->process || !cell->file_exists) { continue; } 73 74 // check on the mask file at this level if possible 75 badMaskFile = censorBadFileByView(badMaskFile, inMask, config, view); 76 58 77 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 59 78 60 79 // process each of the readouts 61 80 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 81 82 // check on the mask file at this level if possible 83 badMaskFile = censorBadFileByView(badMaskFile, inMask, config, view); 84 62 85 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 63 86 if (!readout->data_exists) { continue; } 64 87 65 if (!censorReadout (readout, config, view )) ESCAPE;88 if (!censorReadout (readout, config, view, badMaskFile)) ESCAPE; 66 89 67 90 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; … … 78 101 return true; 79 102 } 103 104 bool censorBadFileByView (bool badFile, pmFPAfile *file, pmConfig *config, pmFPAview *view) { 105 106 // get the current level 107 pmFPALevel level = pmFPAviewLevel (view); 108 109 // can we try to open this file? (if not, leave the existing badView intact) 110 if (level != file->fileLevel) return badFile; 111 112 // free, and if needed, realloc badView below 113 badFile = false; 114 115 char *filename = pmFPAfileName(file, view, config); 116 if (filename) { 117 // activate the file 118 pmFPAfileActivate (config->files, true, file->name); 119 psFree (filename); 120 return false; 121 } 122 123 // de-activate the file 124 pmFPAfileActivate (config->files, false, file->name); 125 return true; 126 }
Note:
See TracChangeset
for help on using the changeset viewer.
