Changeset 15216 for trunk/psphot/src/psphotImageLoop.c
- Timestamp:
- Oct 4, 2007, 9:55:03 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotImageLoop.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotImageLoop.c
r12805 r15216 1 1 # include "psphotStandAlone.h" 2 3 # define ESCAPE(MESSAGE) { \ 4 psError(PSPHOT_ERR_DATA, false, MESSAGE); \ 5 psFree (view); \ 6 return false; \ 7 } 2 8 3 9 bool psphotImageLoop (pmConfig *config) { … … 22 28 23 29 // files associated with the science image 24 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 25 psError(PSPHOT_ERR_DATA, false, "failed IO for fpa in psphot\n"); 26 psFree(view); 27 return false; 28 } 30 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa in psphot."); 29 31 30 32 // for psphot, we force data to be read at the chip level … … 38 40 pmFPAfileActivate (config->files, true, "PSPHOT.MASK"); 39 41 pmFPAfileActivate (config->files, true, "PSPHOT.WEIGHT"); 40 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 41 psError(PSPHOT_ERR_DATA, false, "failed IO for chip %d in psphot\n", view->chip); 42 psFree (view); 43 return false; 44 } 42 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphot."); 45 43 46 44 // mosaic the cells of a chip into a single contiguous (trimmed) chip 47 if (!psphotMosaicChip(config, view, "PSPHOT.INPUT", "PSPHOT.LOAD")) { 48 psError(PS_ERR_UNKNOWN, false, "Unable to mosaic chip.\n"); 49 return false; 50 } 45 if (!psphotMosaicChip(config, view, "PSPHOT.INPUT", "PSPHOT.LOAD")) ESCAPE ("Unable to mosaic chip."); 51 46 52 47 // try to load other supporting data (PSF, SRC, etc). … … 56 51 pmFPAfileActivate (config->files, false, "PSPHOT.MASK"); 57 52 pmFPAfileActivate (config->files, false, "PSPHOT.WEIGHT"); 58 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) { 59 psError(PSPHOT_ERR_DATA, false, "failed IO for chip %d in psphot\n", view->chip); 60 psFree (view); 61 return false; 62 } 53 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphot."); 54 63 55 // re-activate files so they will be closed and freed below 64 56 pmFPAfileActivate (config->files, true, NULL); … … 83 75 84 76 // save output which is saved at the chip level 85 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 86 psError(PSPHOT_ERR_DATA, false, "failed IO for chip %d in psphot\n", view->chip); 87 psFree (view); 88 return false; 89 } 77 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed output for Chip in psphot."); 90 78 } 91 79 // save output which is saved at the fpa level 92 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) { 93 psError(PSPHOT_ERR_DATA, false, "failed IO for fpa in psphot\n"); 94 psFree (view); 95 return false; 96 } 80 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed ouput for FPA in psphot."); 81 82 // fail if we failed to handle an error 83 if (psErrorCodeLast() != PS_ERR_NONE) psAbort ("failed to handle an error!"); 97 84 98 85 psFree (view); 99 100 // fail if we failed to handle an error101 if (psErrorCodeLast() != PS_ERR_NONE) return false;102 86 return true; 103 87 }
Note:
See TracChangeset
for help on using the changeset viewer.
