Changeset 4864 for trunk/Ohana/src/opihi/dvo/badimages.c
- Timestamp:
- Aug 23, 2005, 8:55:22 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/badimages.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/badimages.c
r4689 r4864 8 8 int badimages (int argc, char **argv) { 9 9 10 FILE *f; 11 int i, Nimage, nimage, entry, First, Cross; 10 int i, Nimage, entry, First, Cross; 12 11 float *ptr; 13 12 double nominal, big, small, value; 14 Header header;15 13 Image *image; 16 char ImageCat[256];17 14 18 VarConfig ("IMAGE_CATALOG", "%s", ImageCat);19 20 15 if (argc != 3) { 21 16 fprintf (stderr, "USAGE: badimages entry value\n"); … … 24 19 } 25 20 21 image = LoadImages (&Nimage); 22 26 23 Cross = FALSE; 27 24 First = FALSE; … … 36 33 Cross = TRUE; 37 34 } 38 }39 40 /* check if image datafile exists, get header */41 if (!fits_read_header (ImageCat, &header)) {42 fprintf (stderr, "can't open image catalog %s\n", ImageCat);43 return (FALSE);44 }45 46 /* get ready to read data on images */47 f = fopen (ImageCat, "r");48 if (f == (FILE *) NULL) {49 fprintf (stderr, "can't open image catalog %s\n", ImageCat);50 return (FALSE);51 }52 fseek (f, header.size, SEEK_SET);53 54 /* read in image data */55 Nimage = 0;56 fits_scan (&header, "NIMAGES", "%d", 1, &Nimage);57 ALLOCATE (image, Image, Nimage);58 nimage = Fread (image, sizeof(Image), Nimage, f, "image");59 fclose (f);60 if (nimage != Nimage) {61 fprintf (stderr, "error reading all data from image file (%d != %d)\n", nimage, Nimage);62 free (image);63 return (FALSE);64 35 } 65 36 … … 101 72 102 73 } 103
Note:
See TracChangeset
for help on using the changeset viewer.
