Changeset 4024 for trunk/Ohana/src/imregister/imphot/rtext.c
- Timestamp:
- May 25, 2005, 6:23:25 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/imregister/imphot/rtext.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/imregister/imphot/rtext.c
r4018 r4024 1 # include "imregister.h" 2 # include "imphot.h" 1 3 2 4 int rtext (FITS_DB *db) { 5 6 int Nimage, size, nimage; 7 struct stat filestatus; 8 Image *image; 3 9 4 10 /* check that file size makes sense */ 5 11 Nimage = 0; 6 12 fits_scan (&db[0].header, "NIMAGES", "%d", 1, &Nimage); 7 if (stat (d BFile, &filestatus) == -1) {13 if (stat (db[0].filename, &filestatus) == -1) { 8 14 if (VERBOSE) fprintf (stderr, "ERROR: failed to get status of image catalog\n"); 9 15 exit (1); 10 16 } 11 size = Nimage*sizeof(Image) + header.size;17 size = Nimage*sizeof(Image) + db[0].header.size; 12 18 if (size != filestatus.st_size) { 13 19 int Ndata; 14 20 15 Ndata = (filestatus.st_size - header.size) / sizeof (Image);21 Ndata = (filestatus.st_size - db[0].header.size) / sizeof (Image); 16 22 if (VERBOSE) fprintf (stderr, "ERROR: image catalog has inconsistent size\n"); 17 23 if (VERBOSE) fprintf (stderr, "header: %d, data: %d\n", Nimage, Ndata); … … 27 33 db[0].ftable.header = &db[0].theader; 28 34 29 /* set theader size information to match loaded data */30 31 35 /* alloc, read images */ 32 36 ALLOCATE (image, Image, MAX (Nimage, 1)); … … 36 40 exit (1); 37 41 } 38 db[0].ftable.buffer = image; 42 db[0].ftable.buffer = (char *) image; 43 fits_modify (&db[0].theader, "NAXIS2", "%d", 1, Nimage); 44 db[0].theader.Naxis[1] = Nimage; 45 db[0].ftable.size = fits_matrix_size (&db[0].theader); 46 39 47 return (TRUE); 40 48 }
Note:
See TracChangeset
for help on using the changeset viewer.
