IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19065


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
Files:
5 edited

Legend:

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

    r16810 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/addstar/src/ReadImageHeader.c

    r18427 r19065  
    55int ReadImageHeader (Header *header, Image *image, int photcode) {
    66
    7   int Nastro, ccdnum, hour, min, Nx, Ny;
     7  int Nastro, ccdnum, hour, min, Nx, Ny, haveNx, haveNy;
    88  double tmp, sec, Cerror, ZeroPt, FWHM_X, FWHM_Y;
    99  char *c, photname[64], line[80];
     
    2121  gfits_scan (header, "NAXIS1",   "%d", 1, &Nx);
    2222  gfits_scan (header, "NAXIS2",   "%d", 1, &Ny);
     23
     24  if (!haveNx && !haveNy) {
     25      haveNx = gfits_scan (header, "IMNAXIS1",   "%d", 1, &Nx);
     26      haveNy = gfits_scan (header, "IMNAXIS2",   "%d", 1, &Ny);
     27  }
     28
     29  if (!haveNx || !haveNy) {
     30      fprintf (stderr, "missing image dimensions in header\n");
     31      return (FALSE);
     32  }
     33
    2334  if ((Nx < 0) || (Nx > 0xffff)) {
    2435    fprintf (stderr, "WARNING: NX, NY out of range : image boundary will be wrong\n");
    2536  }
     37
    2638  image[0].NX = Nx;
    2739  image[0].NY = Ny;
  • trunk/Ohana/src/delstar/src/gimages.c

    r15509 r19065  
    1212  double tmp;
    1313  Image *image;
    14   int Nc;
     14  int Nc, haveNx, haveNy;
    1515
    1616  ALLOCATE (image, Image, 1);
     
    4848 
    4949  /* get other header info */
    50   gfits_scan (&header, "NAXIS1",   "%hd", 1, &image[0].NX);
    51   gfits_scan (&header, "NAXIS2",   "%hd", 1, &image[0].NY);
     50  haveNx = gfits_scan (&header, "NAXIS1",   "%hd", 1, &image[0].NX);
     51  haveNy = gfits_scan (&header, "NAXIS2",   "%hd", 1, &image[0].NY);
     52  if (!haveNx && !haveNy) {
     53      haveNx = gfits_scan (&header, "IMNAXIS1",   "%hd", 1, &image[0].NX);
     54      haveNy = gfits_scan (&header, "IMNAXIS2",   "%hd", 1, &image[0].NY);
     55  }     
     56  if (!haveNx || !haveNy) {
     57      Shutdown ("ERROR: missing image dimensions in header");
     58  }
    5259
    5360  gfits_scan (&header, "PHOTCODE", "%s", 1, photcode);
  • 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.