Changeset 12487
- Timestamp:
- Mar 18, 2007, 12:08:06 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/addstar/src/ReadImageHeader.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/ReadImageHeader.c
r12332 r12487 5 5 int ReadImageHeader (Header *header, Image *image, int photcode) { 6 6 7 int Nastro, ccdnum, hour, min ;7 int Nastro, ccdnum, hour, min, Nx, Ny; 8 8 double tmp, sec; 9 9 char *c, photname[64], line[80]; … … 11 11 /* get astrometry information */ 12 12 if (!GetCoords (&image[0].coords, header)) { 13 fprintf (stderr, " ERROR:no astrometric solution in header\n");14 exit (1);13 fprintf (stderr, "no astrometric solution in header\n"); 14 return (FALSE); 15 15 } 16 gfits_scan (header, "NAXIS1", "%hd", 1, &image[0].NX); 17 gfits_scan (header, "NAXIS2", "%hd", 1, &image[0].NY); 16 // XXX currently, image uses an unsigned short for NX,XY. this is rather restrictive 17 // and needs to be at least checked. 18 gfits_scan (header, "NAXIS1", "%d", 1, &Nx); 19 gfits_scan (header, "NAXIS2", "%d", 1, &Ny); 20 if ((Nx < 0) || (Nx > 0xffff)) { 21 fprintf (stderr, "WARNING: NX, NY out of range : image boundary will be wrong\n"); 22 } 23 image[0].NX = Nx; 24 image[0].NY = Ny; 18 25 19 26 if (!gfits_scan (header, "TZERO", "%d", 1, &image[0].tzero)) { … … 31 38 gfits_scan (header, "NASTRO", "%d", 1, &Nastro); 32 39 if ((Nastro == 0) && !ACCEPT_ASTROM) { 33 fprintf (stderr, " ERROR:bad astrometric solution in header\n");34 exit (1);40 fprintf (stderr, "bad astrometric solution in header\n"); 41 return (FALSE); 35 42 } 36 43 if (!strcmp (&image[0].coords.ctype[4], "-WRP")) { 37 44 if (MOSAIC == NULL) { 38 fprintf (stderr, " ERROR:no mosaic for WRP image (use -mosaic)\n");39 exit (1);45 fprintf (stderr, "no mosaic for WRP image (use -mosaic)\n"); 46 return (FALSE); 40 47 } 41 48 RegisterMosaic (MOSAIC); … … 53 60 if (photcode == 0) { 54 61 if (!gfits_scan (header, "PHOTCODE", "%s", 1, photname)) { 55 fprintf (stderr, " ERROR:photcode not supplied in header\n");56 exit (1);62 fprintf (stderr, "photcode not supplied in header\n"); 63 return (FALSE); 57 64 } 58 65 photcode = GetPhotcodeCodebyName (photname); 59 66 if (photcode == 0) { 60 fprintf (stderr, " ERROR:photcode %s not found in photcode table\n", photname);61 exit (1);67 fprintf (stderr, "photcode %s not found in photcode table\n", photname); 68 return (FALSE); 62 69 } 63 70 } 64 71 if (photcode == 0) { 65 fprintf (stderr, " ERROR:no valid photcode is supplied\n");66 exit (1);72 fprintf (stderr, "no valid photcode is supplied\n"); 73 return (FALSE); 67 74 } 68 75 image[0].photcode = photcode; … … 137 144 /* find expected number of stars */ 138 145 if (!gfits_scan (header, "NSTARS", "%d", 1, &image[0].nstar)) { 139 fprintf (stderr, " ERROR:can't get NSTARS from header\n");140 exit (1);146 fprintf (stderr, "can't get NSTARS from header\n"); 147 return (FALSE); 141 148 } 142 149
Note:
See TracChangeset
for help on using the changeset viewer.
