Changeset 10930
- Timestamp:
- Jan 5, 2007, 10:30:02 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/imbox.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/imbox.c
r7917 r10930 3 3 int imbox (int argc, char **argv) { 4 4 5 int i, j, status, InPic, flipped, Nextend;5 int i, j, Nskip, status, InPic, flipped, Nextend; 6 6 Vector Xvec, Yvec; 7 7 double r, d, x[4], y[4], Rmin, Rmax, Rmid; 8 8 Header header; 9 9 Coords coords; 10 Coords mosaic; 10 11 Graphdata graphmode; 12 FILE *f; 11 13 12 14 if (!style_args (&graphmode, &argc, argv, 0)) return FALSE; … … 18 20 SetGraph (graphmode); 19 21 20 if (!gfits_read_header (argv[1], &header)) { 22 f = fopen (argv[1], "r"); 23 if (f == NULL) { 21 24 gprint (GP_ERR, "file not found\n"); 22 25 return (FALSE); 23 }24 25 Nextend = 0;26 if (header.Naxes == 0) {27 gfits_scan (&header, "NEXTEND", "%d", 1, &Nextend);28 26 } 29 27 … … 36 34 ALLOCATE (Yvec.elements, float, 8); 37 35 38 for (i = Nextend ? 0 : -1; i < Nextend; i++) { 39 if (Nextend) { 40 gfits_read_Xheader (argv[1], &header, i); 41 } 42 if (!GetCoords (&coords, &header)) { 43 gprint (GP_ERR, "can't get WCS info from header\n"); 44 return (TRUE); 36 while (gfits_fread_header (f, &header)) { 37 if (!GetCoords (&coords, &header)) goto skip; 38 if (!strcmp (&coords.ctype[4], "-DIS")) { 39 mosaic = coords; 40 RegisterMosaic (&mosaic); 41 goto skip; 45 42 } 46 43 x[0] = 0; y[0] = 0; … … 84 81 PlotVector (8, Yvec.elements); 85 82 } 83 skip: 84 Nskip = gfits_matrix_size (&header); 85 fseek (f, Nskip, SEEK_CUR); 86 gfits_free_header (&header); 86 87 } 87 88 gfits_free_header (&header); 88 fclose (f); 89 89 free (Xvec.elements); 90 90 free (Yvec.elements);
Note:
See TracChangeset
for help on using the changeset viewer.
