IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8648


Ignore:
Timestamp:
Aug 27, 2006, 1:36:29 PM (20 years ago)
Author:
eugene
Message:

fixed test for TEXT vs FITS cmp files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/cmpread.c

    r7917 r8648  
    66int cmpread (int argc, char **argv) {
    77 
    8   int i, field, extend, Nbytes, Nstars;
     8  int i, field, Naxis, Nbytes, Nstars;
    99  double tR, tD;
    1010  float value;
     
    7171
    7272  /* read from FITS table or from text table */
    73   extend = FALSE;
    74   gfits_scan (&header, "EXTEND",  "%t", 1, &extend);
    75   if (extend) {
    76     gprint (GP_ERR, "reading from FITS cmp file %s\n", argv[2]);
    77     Nbytes = gfits_matrix_size (&header);
    78     fseek (f, Nbytes, SEEK_CUR);
    79     stars = cmpReadFits (f, &Nstars);
    80   } else {
     73  Naxis = 0;
     74  gfits_scan (&header, "NAXIS",  "%d", 1, &Naxis);
     75  if (Naxis == 2) {
    8176    /* allocate space for stars */
    8277    gprint (GP_ERR, "reading from TEXT cmp file %s\n", argv[2]);
     
    8681    }
    8782    stars = cmpReadText (f, &Nstars);
     83  } else {
     84    gprint (GP_ERR, "reading from FITS cmp file %s\n", argv[2]);
     85    Nbytes = gfits_matrix_size (&header);
     86    fseek (f, Nbytes, SEEK_CUR);
     87    stars = cmpReadFits (f, &Nstars);
    8888  }
    8989  fclose (f);
Note: See TracChangeset for help on using the changeset viewer.