IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 14, 2008, 2:24:45 PM (18 years ago)
Author:
eugene
Message:

testing for NAXISi, fall-back on IMNAXISi

Location:
trunk/Ohana/src/getstar/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/getstar/src/GetFileMode.c

    r12774 r19065  
    55
    66  char ctype[80];
    7   int Naxis, Nx, Ny;
    8   int simple, extend, haveNaxis, haveNx, haveNy, haveCTYPE;
     7  int Naxis;
     8  int simple, extend, haveNaxis, haveCTYPE;
    99
    1010  gfits_scan (header, "SIMPLE", "%t", 1, &simple);
    1111  haveNaxis = gfits_scan (header, "NAXIS",  "%d", 1, &Naxis);
    12   haveNx    = gfits_scan (header, "NAXIS1", "%d", 1, &Nx);
    13   haveNy    = gfits_scan (header, "NAXIS2", "%d", 1, &Ny);
    1412  haveCTYPE = gfits_scan (header, "CTYPE1", "%s", 1, ctype);
    1513
  • trunk/Ohana/src/getstar/src/ReadImageHeader.c

    r16810 r19065  
    44int ReadImageHeader (Header *header, Image *image) {
    55
    6   int Nastro, Nx, Ny;
     6  int Nastro, Nx, Ny, haveNx, haveNy;
    77  double tmp;
    88
     
    1414  // XXX currently, image uses an unsigned short for NX,XY. this is rather restrictive
    1515  // and needs to be at least checked.
    16   gfits_scan (header, "NAXIS1",   "%d", 1, &Nx);
    17   gfits_scan (header, "NAXIS2",   "%d", 1, &Ny);
     16  haveNx = gfits_scan (header, "NAXIS1",   "%d", 1, &Nx);
     17  haveNy = gfits_scan (header, "NAXIS2",   "%d", 1, &Ny);
     18
     19  if (!haveNx && !haveNy) {
     20      haveNx = gfits_scan (header, "IMNAXIS1",   "%d", 1, &Nx);
     21      haveNy = gfits_scan (header, "IMNAXIS2",   "%d", 1, &Ny);
     22  }
     23
     24  if (!haveNx || !haveNy) {
     25      fprintf (stderr, "missing image dimensions in header\n");
     26      return (FALSE);
     27  }
     28
    1829  if ((Nx < 0) || (Nx > 0xffff)) {
    1930    fprintf (stderr, "WARNING: NX, NY out of range : image boundary will be wrong\n");
Note: See TracChangeset for help on using the changeset viewer.