Changeset 3520 for trunk/Ohana/src/gastro2/src/rtext.c
- Timestamp:
- Mar 27, 2005, 4:39:46 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/gastro2/src/rtext.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/gastro2/src/rtext.c
r3413 r3520 5 5 # define BLOCK 1000 6 6 7 StarData *rtext ( char *filename, Header *header, int *nstars) {7 StarData *rtext (FILE *f, int *nstars) { 8 8 9 9 FILE *f; … … 13 13 StarData *stars; 14 14 15 /* allocate space for stars */ 16 NSTARS = -1; 17 fits_scan (header, "NSTARS", "%d", 1, &NSTARS); 18 if (NSTARS == -1) { 19 fprintf (stderr, "ERROR: failed to find NSTARS\n"); 20 exit (1); 21 } 15 NSTARS = *nstars; 22 16 ALLOCATE (stars, StarData, MAX (NSTARS, 1)); 23 17 Nbytes = NSTARS*BYTES_STAR; 24 25 /* open file for stars */26 f = fopen (filename, "r");27 if (f == NULL) {28 fprintf (stderr, "ERROR: can't open file to load stars\n");29 exit (1);30 }31 fseek (f, header[0].size, SEEK_SET);32 18 33 19 N = Nstars = 0; … … 52 38 } 53 39 free (buffer); 54 fclose (f);55 40 56 41 if (Nstars != NSTARS) {
Note:
See TracChangeset
for help on using the changeset viewer.
