Changeset 27657 for trunk/psphot/src/psphotStackImageLoop.c
- Timestamp:
- Apr 11, 2010, 5:08:29 PM (16 years ago)
- Location:
- trunk/psphot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot
-
Property svn:mergeinfo
set to
/branches/eam_branches/stackphot.20100406/psphot merged eligible
-
Property svn:mergeinfo
set to
-
trunk/psphot/src
- Property svn:ignore
-
old new 21 21 psphotForced 22 22 psphotMakePSF 23 psphotStack
-
- Property svn:ignore
-
trunk/psphot/src/psphotStackImageLoop.c
r27547 r27657 7 7 } 8 8 9 bool psphot ImageLoop (pmConfig *config) {9 bool psphotStackImageLoop (pmConfig *config) { 10 10 11 11 bool status; … … 14 14 pmReadout *readout; 15 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 16 22 pmFPAview *view = pmFPAviewAlloc (0); 17 23 … … 19 25 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa in psphot."); 20 26 21 // XXX for now, we assume there is only a single chip in the PHU: 22 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."); 23 67 24 68 // fail if we failed to handle an error … … 32 76 the easiest way to implement this is to assume we can pre-load the full set of images up front. 33 77 with 5 filters and 6000^2 (image, mask, var = 10 byte per pixel), we need 1.8GB, which is not too bad. 34 */78 */ 35 79
Note:
See TracChangeset
for help on using the changeset viewer.
