IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5384


Ignore:
Timestamp:
Oct 19, 2005, 9:18:59 PM (21 years ago)
Author:
eugene
Message:

fixed error on handling of DIS images (should not load stars)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/gstars.c

    r5328 r5384  
    171171  fseek (f, header.size, SEEK_SET);
    172172
    173   /* read from FITS table or from text table */
    174   extend = FALSE;
    175   fits_scan (&header, "EXTEND",  "%t", 1, &extend);
    176   if (extend && !TEXTMODE) {
    177     Nbytes = fits_matrix_size (&header);
    178     fseek (f, Nbytes, SEEK_CUR);
    179     rdstars = rfits (f, &image[0].nstar);
    180     if (rdstars == NULL) {
    181       fprintf (stderr, "ERROR: failed to read fits table\n");
    182       exit (1);
    183     }
     173  /* don't try to read stars for mosaic */
     174  if (!strcmp (&image[0].coords.ctype[4], "-DIS")) {
     175    rdstars = NULL;
     176    image[0].nstar = 0;
    184177  } else {
    185     /* allocate space for stars */
    186     if (!fits_scan (&header, "NSTARS", "%d", 1, &image[0].nstar)) {
    187       fprintf (stderr, "ERROR: failed to find NSTARS\n");
    188       exit (1);
    189     }
    190     rdstars = rtext (f, &image[0].nstar);
     178    /* read from FITS table or from text table */
     179    extend = FALSE;
     180    fits_scan (&header, "EXTEND",  "%t", 1, &extend);
     181    if (extend && !TEXTMODE) {
     182      Nbytes = fits_matrix_size (&header);
     183      fseek (f, Nbytes, SEEK_CUR);
     184      rdstars = rfits (f, &image[0].nstar);
     185      if (rdstars == NULL) {
     186        fprintf (stderr, "ERROR: failed to read fits table\n");
     187        exit (1);
     188      }
     189    } else {
     190      /* allocate space for stars */
     191      if (!fits_scan (&header, "NSTARS", "%d", 1, &image[0].nstar)) {
     192        fprintf (stderr, "ERROR: failed to find NSTARS\n");
     193        exit (1);
     194      }
     195      rdstars = rtext (f, &image[0].nstar);
     196    }
    191197  }
    192198  fclose (f);
Note: See TracChangeset for help on using the changeset viewer.