Changeset 7647
- Timestamp:
- Jun 22, 2006, 4:11:01 PM (20 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 2 edited
-
ppImage.c (modified) (4 diffs)
-
ppImageCleanup.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImage.c
r7639 r7647 2 2 3 3 int main(int argc, char **argv) { 4 5 psLibInit(NULL); 4 6 5 7 psTimerStart(TIMERNAME); … … 11 13 pmConfig *config = ppImageArguments(&argc, argv); 12 14 if (config == NULL) { 13 psErrorStackPrint(stderr, "");14 exit(1);15 psErrorStackPrint(stderr, ""); 16 exit(1); 15 17 } 16 18 … … 19 21 ppImageOptions *options = ppImageParseCamera(config); 20 22 if (options == NULL) { 21 psErrorStackPrint(stderr, "");22 exit(1);23 psErrorStackPrint(stderr, ""); 24 exit(1); 23 25 } 24 26 25 27 // Image Arithmetic Loop 26 28 if (!ppImageLoop(config, options)) { 27 psErrorStackPrint(stderr, "");28 exit(1);29 psErrorStackPrint(stderr, ""); 30 exit(1); 29 31 } 30 32 … … 42 44 psMetadataIterator *iter = psMetadataIteratorAlloc (config->files, PS_LIST_HEAD, NULL); 43 45 while ((item = psMetadataGetAndIncrement (iter)) != NULL) { 44 pmFPAfile *file = item->data.V;45 pmFPA *fpa = file->fpa;46 fprintf (stderr, "file %s\n", file->name);47 if (!fpa) {48 fprintf (stderr, " has no FPA\n");49 continue;50 }51 if (fpa->hdu) {52 if (fpa->hdu->images) fprintf (stderr, " (%d,%d) images\n", -1, -1);53 if (fpa->hdu->weights) fprintf (stderr, " (%d,%d) weights\n", -1, -1);54 if (fpa->hdu->masks) fprintf (stderr, " (%d,%d) masks\n", -1, -1);55 if (fpa->hdu->header) fprintf (stderr, " (%d,%d) header\n", -1, -1);56 continue;57 }58 fprintf (stderr, " has no fpa data (%d,%d)\n", -1, -1);59 for (int i = 0; i < fpa->chips->n; i++) {60 pmChip *chip = fpa->chips->data[i];61 if (chip->hdu) {62 if (chip->hdu->images) fprintf (stderr, " (%d,%d) images\n", i, -1);63 if (chip->hdu->weights) fprintf (stderr, " (%d,%d) weights\n", i, -1);64 if (chip->hdu->masks) fprintf (stderr, " (%d,%d) masks\n", i, -1);65 if (chip->hdu->header) fprintf (stderr, " (%d,%d) header\n", i, -1);66 continue;67 }68 fprintf (stderr, " has no chip data (%d,%d)\n", i, -1);69 for (int j = 0; j < chip->cells->n; j++) {70 pmCell *cell = chip->cells->data[j];71 if (cell->hdu) {72 if (cell->hdu->images) fprintf (stderr, " (%d,%d) images\n", i, j);73 if (cell->hdu->weights) fprintf (stderr, " (%d,%d) weights\n", i, j);74 if (cell->hdu->masks) fprintf (stderr, " (%d,%d) masks\n", i, j);75 if (cell->hdu->header) fprintf (stderr, " (%d,%d) header\n", i, j);76 continue;77 }78 fprintf (stderr, " has no cell data (%d,%d)\n", i, j);79 }80 }46 pmFPAfile *file = item->data.V; 47 pmFPA *fpa = file->fpa; 48 fprintf (stderr, "file %s\n", file->name); 49 if (!fpa) { 50 fprintf (stderr, " has no FPA\n"); 51 continue; 52 } 53 if (fpa->hdu) { 54 if (fpa->hdu->images) fprintf (stderr, " (%d,%d) images\n", -1, -1); 55 if (fpa->hdu->weights) fprintf (stderr, " (%d,%d) weights\n", -1, -1); 56 if (fpa->hdu->masks) fprintf (stderr, " (%d,%d) masks\n", -1, -1); 57 if (fpa->hdu->header) fprintf (stderr, " (%d,%d) header\n", -1, -1); 58 continue; 59 } 60 fprintf (stderr, " has no fpa data (%d,%d)\n", -1, -1); 61 for (int i = 0; i < fpa->chips->n; i++) { 62 pmChip *chip = fpa->chips->data[i]; 63 if (chip->hdu) { 64 if (chip->hdu->images) fprintf (stderr, " (%d,%d) images\n", i, -1); 65 if (chip->hdu->weights) fprintf (stderr, " (%d,%d) weights\n", i, -1); 66 if (chip->hdu->masks) fprintf (stderr, " (%d,%d) masks\n", i, -1); 67 if (chip->hdu->header) fprintf (stderr, " (%d,%d) header\n", i, -1); 68 continue; 69 } 70 fprintf (stderr, " has no chip data (%d,%d)\n", i, -1); 71 for (int j = 0; j < chip->cells->n; j++) { 72 pmCell *cell = chip->cells->data[j]; 73 if (cell->hdu) { 74 if (cell->hdu->images) fprintf (stderr, " (%d,%d) images\n", i, j); 75 if (cell->hdu->weights) fprintf (stderr, " (%d,%d) weights\n", i, j); 76 if (cell->hdu->masks) fprintf (stderr, " (%d,%d) masks\n", i, j); 77 if (cell->hdu->header) fprintf (stderr, " (%d,%d) header\n", i, j); 78 continue; 79 } 80 fprintf (stderr, " has no cell data (%d,%d)\n", i, j); 81 } 82 } 81 83 } 82 84 psFree (iter); -
trunk/ppImage/src/ppImageCleanup.c
r7639 r7647 3 3 void ppImageCleanup (pmConfig *config, ppImageOptions *options) { 4 4 5 // Free memory used by ppImage 5 6 psFree(options); 6 7 psFree(config); 7 8 8 psTimerStop(); 9 psMemCheckCorruption (true); 10 psTraceReset(); 9 // Free memory used by psModules 11 10 pmConceptsDone(); 12 11 pmConfigDone(); 13 12 pmModelGroupCleanup(); 14 fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "ppImage"); 15 // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "ppImage"); 13 14 // Free memory used by psLib 15 psLibFinalize(); 16 16 17 return; 17 18 }
Note:
See TracChangeset
for help on using the changeset viewer.
