Changeset 19065
- Timestamp:
- Aug 14, 2008, 2:24:45 PM (18 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 5 edited
-
addstar/src/GetFileMode.c (modified) (1 diff)
-
addstar/src/ReadImageHeader.c (modified) (2 diffs)
-
delstar/src/gimages.c (modified) (2 diffs)
-
getstar/src/GetFileMode.c (modified) (1 diff)
-
getstar/src/ReadImageHeader.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/GetFileMode.c
r16810 r19065 5 5 6 6 char ctype[80]; 7 int Naxis , Nx, Ny;8 int simple, extend, haveNaxis, have Nx, haveNy, haveCTYPE;7 int Naxis; 8 int simple, extend, haveNaxis, haveCTYPE; 9 9 10 10 gfits_scan (header, "SIMPLE", "%t", 1, &simple); 11 11 haveNaxis = gfits_scan (header, "NAXIS", "%d", 1, &Naxis); 12 haveNx = gfits_scan (header, "NAXIS1", "%d", 1, &Nx);13 haveNy = gfits_scan (header, "NAXIS2", "%d", 1, &Ny);14 12 haveCTYPE = gfits_scan (header, "CTYPE1", "%s", 1, ctype); 15 13 -
trunk/Ohana/src/addstar/src/ReadImageHeader.c
r18427 r19065 5 5 int ReadImageHeader (Header *header, Image *image, int photcode) { 6 6 7 int Nastro, ccdnum, hour, min, Nx, Ny ;7 int Nastro, ccdnum, hour, min, Nx, Ny, haveNx, haveNy; 8 8 double tmp, sec, Cerror, ZeroPt, FWHM_X, FWHM_Y; 9 9 char *c, photname[64], line[80]; … … 21 21 gfits_scan (header, "NAXIS1", "%d", 1, &Nx); 22 22 gfits_scan (header, "NAXIS2", "%d", 1, &Ny); 23 24 if (!haveNx && !haveNy) { 25 haveNx = gfits_scan (header, "IMNAXIS1", "%d", 1, &Nx); 26 haveNy = gfits_scan (header, "IMNAXIS2", "%d", 1, &Ny); 27 } 28 29 if (!haveNx || !haveNy) { 30 fprintf (stderr, "missing image dimensions in header\n"); 31 return (FALSE); 32 } 33 23 34 if ((Nx < 0) || (Nx > 0xffff)) { 24 35 fprintf (stderr, "WARNING: NX, NY out of range : image boundary will be wrong\n"); 25 36 } 37 26 38 image[0].NX = Nx; 27 39 image[0].NY = Ny; -
trunk/Ohana/src/delstar/src/gimages.c
r15509 r19065 12 12 double tmp; 13 13 Image *image; 14 int Nc ;14 int Nc, haveNx, haveNy; 15 15 16 16 ALLOCATE (image, Image, 1); … … 48 48 49 49 /* get other header info */ 50 gfits_scan (&header, "NAXIS1", "%hd", 1, &image[0].NX); 51 gfits_scan (&header, "NAXIS2", "%hd", 1, &image[0].NY); 50 haveNx = gfits_scan (&header, "NAXIS1", "%hd", 1, &image[0].NX); 51 haveNy = gfits_scan (&header, "NAXIS2", "%hd", 1, &image[0].NY); 52 if (!haveNx && !haveNy) { 53 haveNx = gfits_scan (&header, "IMNAXIS1", "%hd", 1, &image[0].NX); 54 haveNy = gfits_scan (&header, "IMNAXIS2", "%hd", 1, &image[0].NY); 55 } 56 if (!haveNx || !haveNy) { 57 Shutdown ("ERROR: missing image dimensions in header"); 58 } 52 59 53 60 gfits_scan (&header, "PHOTCODE", "%s", 1, photcode); -
trunk/Ohana/src/getstar/src/GetFileMode.c
r12774 r19065 5 5 6 6 char ctype[80]; 7 int Naxis , Nx, Ny;8 int simple, extend, haveNaxis, have Nx, haveNy, haveCTYPE;7 int Naxis; 8 int simple, extend, haveNaxis, haveCTYPE; 9 9 10 10 gfits_scan (header, "SIMPLE", "%t", 1, &simple); 11 11 haveNaxis = gfits_scan (header, "NAXIS", "%d", 1, &Naxis); 12 haveNx = gfits_scan (header, "NAXIS1", "%d", 1, &Nx);13 haveNy = gfits_scan (header, "NAXIS2", "%d", 1, &Ny);14 12 haveCTYPE = gfits_scan (header, "CTYPE1", "%s", 1, ctype); 15 13 -
trunk/Ohana/src/getstar/src/ReadImageHeader.c
r16810 r19065 4 4 int ReadImageHeader (Header *header, Image *image) { 5 5 6 int Nastro, Nx, Ny ;6 int Nastro, Nx, Ny, haveNx, haveNy; 7 7 double tmp; 8 8 … … 14 14 // XXX currently, image uses an unsigned short for NX,XY. this is rather restrictive 15 15 // and needs to be at least checked. 16 gfits_scan (header, "NAXIS1", "%d", 1, &Nx); 17 gfits_scan (header, "NAXIS2", "%d", 1, &Ny); 16 haveNx = gfits_scan (header, "NAXIS1", "%d", 1, &Nx); 17 haveNy = gfits_scan (header, "NAXIS2", "%d", 1, &Ny); 18 19 if (!haveNx && !haveNy) { 20 haveNx = gfits_scan (header, "IMNAXIS1", "%d", 1, &Nx); 21 haveNy = gfits_scan (header, "IMNAXIS2", "%d", 1, &Ny); 22 } 23 24 if (!haveNx || !haveNy) { 25 fprintf (stderr, "missing image dimensions in header\n"); 26 return (FALSE); 27 } 28 18 29 if ((Nx < 0) || (Nx > 0xffff)) { 19 30 fprintf (stderr, "WARNING: NX, NY out of range : image boundary will be wrong\n");
Note:
See TracChangeset
for help on using the changeset viewer.
