- Timestamp:
- Apr 9, 2010, 4:41:16 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/stackphot.20100406/psphot/src/psphotStackImageLoop.c
r27625 r27649 9 9 bool psphotStackImageLoop (pmConfig *config) { 10 10 11 bool status; 12 pmChip *chip; 13 pmCell *cell; 14 pmReadout *readout; 15 16 pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT"); 17 if (!status) { 18 psError(PSPHOT_ERR_PROG, false, "Can't find input data!"); 19 return false; 20 } 21 11 22 pmFPAview *view = pmFPAviewAlloc (0); 12 23 … … 14 25 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa in psphot."); 15 26 16 // XXX for now, we assume there is only a single chip in the PHU: 17 psphotStackReadout (config, view); 27 // for psphot, we force data to be read at the chip level 28 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 29 psLogMsg ("psphot", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 30 if (! chip->process || ! chip->file_exists) { continue; } 31 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphotStack."); 32 33 // there is now only a single chip (multiple readouts?). loop over it and process 34 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 35 psLogMsg ("psphot", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 36 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Cell in psphotStack."); 37 38 // process each of the readouts 39 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 40 psLogMsg ("psphot", 6, "Readout %d: %x %x\n", view->readout, cell->file_exists, cell->process); 41 if (! readout->data_exists) { continue; } 42 43 // XXX for now, we assume there is only a single chip in the PHU: 44 if (!psphotStackReadout (config, view)) { 45 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 46 psFree (view); 47 return false; 48 } 49 50 } 51 // drop all versions of the internal files 52 status = true; 53 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL"); 54 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV"); 55 status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND"); 56 if (!status) { 57 psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files"); 58 psFree (view); 59 return false; 60 } 61 } 62 // save output which is saved at the chip level 63 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed output for Chip in psphot."); 64 } 65 // save output which is saved at the fpa level 66 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed ouput for FPA in psphot."); 18 67 19 68 // fail if we failed to handle an error … … 27 76 the easiest way to implement this is to assume we can pre-load the full set of images up front. 28 77 with 5 filters and 6000^2 (image, mask, var = 10 byte per pixel), we need 1.8GB, which is not too bad. 29 */78 */ 30 79
Note:
See TracChangeset
for help on using the changeset viewer.
