IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 27, 2005, 4:39:46 PM (21 years ago)
Author:
eugene
Message:

converted to autocode SMPData

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/gastro2/src/rtext.c

    r3413 r3520  
    55# define BLOCK 1000
    66
    7 StarData *rtext (char *filename, Header *header, int *nstars) {
     7StarData *rtext (FILE *f, int *nstars) {
    88
    99  FILE *f;
     
    1313  StarData *stars;
    1414
    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;
    2216  ALLOCATE (stars, StarData, MAX (NSTARS, 1));
    2317  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);
    3218
    3319  N = Nstars = 0;
     
    5238  }
    5339  free (buffer);
    54   fclose (f);
    5540 
    5641  if (Nstars != NSTARS) {
Note: See TracChangeset for help on using the changeset viewer.