IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19130


Ignore:
Timestamp:
Aug 19, 2008, 6:51:33 PM (18 years ago)
Author:
eugene
Message:

add support for IMNAXIS1,2

Location:
trunk/Ohana/src
Files:
2 edited

Legend:

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

    r19065 r19130  
    1919  // XXX currently, image uses an unsigned short for NX,XY. this is rather restrictive
    2020  // and needs to be at least checked.
    21   gfits_scan (header, "NAXIS1",   "%d", 1, &Nx);
    22   gfits_scan (header, "NAXIS2",   "%d", 1, &Ny);
     21  haveNx = gfits_scan (header, "NAXIS1",   "%d", 1, &Nx);
     22  haveNy = gfits_scan (header, "NAXIS2",   "%d", 1, &Ny);
    2323
    2424  if (!haveNx && !haveNy) {
  • trunk/Ohana/src/opihi/dvo/imbox.c

    r16000 r19130  
    33int imbox (int argc, char **argv) {
    44 
    5   int j, kapa, Nskip, status, InPic, flipped, N, SOLO_PHU;
     5  int j, kapa, Nskip, status, InPic, flipped, N, haveNx, haveNy, Nx, Ny, SOLO_PHU;
    66  Vector Xvec, Yvec;
    77  double r, d, x[4], y[4], Rmin, Rmax, Rmid;
     
    4646      goto skip;
    4747    }
    48     x[0] = 0;               y[0] = 0;
    49     x[1] = header.Naxis[0]; y[1] = 0;
    50     x[2] = header.Naxis[0]; y[2] = header.Naxis[1];
    51     x[3] = 0;               y[3] = header.Naxis[1];
     48
     49    // XXX currently, image uses an unsigned short for NX,XY. this is rather restrictive
     50    // and needs to be at least checked.
     51    haveNx = gfits_scan (&header, "NAXIS1",   "%d", 1, &Nx);
     52    haveNy = gfits_scan (&header, "NAXIS2",   "%d", 1, &Ny);
     53
     54    if (!haveNx && !haveNy) {
     55        haveNx = gfits_scan (&header, "IMNAXIS1",   "%d", 1, &Nx);
     56        haveNy = gfits_scan (&header, "IMNAXIS2",   "%d", 1, &Ny);
     57    }
     58
     59    if (!haveNx || !haveNy) {
     60        fprintf (stderr, "missing image dimensions in header\n");
     61        goto skip;
     62    }
     63
     64    x[0] = 0;  y[0] = 0;
     65    x[1] = Nx; y[1] = 0;
     66    x[2] = Ny; y[2] = Ny;
     67    x[3] = 0;  y[3] = Ny;
    5268    status = FALSE;
    5369    flipped = FALSE;
Note: See TracChangeset for help on using the changeset viewer.