Changeset 15216 for trunk/psastro
- Timestamp:
- Oct 4, 2007, 9:55:03 AM (19 years ago)
- Location:
- trunk/psastro/src
- Files:
-
- 2 edited
-
psastroDataLoad.c (modified) (2 diffs)
-
psastroDataSave.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroDataLoad.c
r12806 r15216 5 5 // into the correct fpa structure locations (readout.analysis:PSPHOT.SOURCES) 6 6 7 # define ESCAPE { \ 8 psError(PS_ERR_UNKNOWN, false, "Failure in psastroDataSave"); \ 9 psFree (view); \ 10 return false; \ 11 } 12 7 13 // all of the different astrometry analysis modes use the same data load loop 8 14 bool psastroDataLoad (pmConfig *config) { … … 33 39 34 40 // files associated with the science image 35 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);41 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 36 42 37 43 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 38 44 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 39 45 if (!chip->process || !chip->file_exists) { continue; } 40 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);46 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 41 47 42 48 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 43 49 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 44 50 if (!cell->process || !cell->file_exists) { continue; } 45 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);51 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 46 52 47 53 // process each of the readouts 48 54 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 49 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);50 if (! readout->data_exists) { continue; }55 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 56 if (!readout->data_exists) { continue; } 51 57 52 psastroConvertReadout (readout, recipe);58 if (!psastroConvertReadout (readout, recipe)) ESCAPE; 53 59 54 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);60 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 55 61 } 56 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);62 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 57 63 } 58 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);64 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 59 65 } 60 pmFPAfileIOChecks (config, view, PM_FPA_AFTER); 66 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 67 61 68 psFree (view); 62 69 return true; -
trunk/psastro/src/psastroDataSave.c
r12806 r15216 2 2 // XXX leak free 2006.04.27 3 3 4 # define ESCAPE { \ 5 psError(PS_ERR_UNKNOWN, false, "Failure in psastroDataSave"); \ 6 psFree (view); \ 7 return false; \ 8 } 9 4 10 // this loop saves the photometry/astrometry data files 5 11 bool psastroDataSave (pmConfig *config) { … … 30 36 31 37 // open/load files as needed 32 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);38 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 33 39 34 40 while ((chip = pmFPAviewNextChip (view, output->fpa, 1)) != NULL) { 35 41 psTrace ("psastro", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 36 42 if (!chip->process || !chip->file_exists) { continue; } 37 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);43 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 38 44 39 45 while ((cell = pmFPAviewNextCell (view, output->fpa, 1)) != NULL) { 40 46 psTrace ("psastro", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 41 47 if (!cell->process || !cell->file_exists) { continue; } 42 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);48 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 43 49 44 50 // process each of the readouts 45 51 while ((readout = pmFPAviewNextReadout (view, output->fpa, 1)) != NULL) { 46 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);47 if (! readout->data_exists) { continue; }52 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 53 if (!readout->data_exists) { continue; } 48 54 49 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);55 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 50 56 } 51 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);57 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 52 58 } 53 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);59 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 54 60 } 55 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);61 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE; 56 62 57 63 // activate all files except PSASTRO.OUTPUT 58 pmFPAfileActivate (config->files, true, NULL);59 pmFPAfileActivate (config->files, false, "PSASTRO.OUTPUT");64 if (!pmFPAfileActivate (config->files, true, NULL)) ESCAPE; 65 if (!pmFPAfileActivate (config->files, false, "PSASTRO.OUTPUT")) ESCAPE; 60 66 61 67 psFree (view);
Note:
See TracChangeset
for help on using the changeset viewer.
