IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 25, 2005, 6:23:25 AM (21 years ago)
Author:
eugene
Message:

adding autocode to imphotsearch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/imregister/imphot/rtext.c

    r4018 r4024  
     1# include "imregister.h"
     2# include "imphot.h"
    13
    24int rtext (FITS_DB *db) {
     5
     6  int Nimage, size, nimage;
     7  struct stat filestatus;
     8  Image *image;
    39
    410  /* check that file size makes sense */
    511  Nimage = 0;
    612  fits_scan (&db[0].header, "NIMAGES", "%d", 1, &Nimage);
    7   if (stat (dBFile, &filestatus) == -1) {
     13  if (stat (db[0].filename, &filestatus) == -1) {
    814    if (VERBOSE) fprintf (stderr, "ERROR: failed to get status of image catalog\n");
    915    exit (1);
    1016  }
    11   size = Nimage*sizeof(Image) + header.size;
     17  size = Nimage*sizeof(Image) + db[0].header.size;
    1218  if (size != filestatus.st_size) {
    1319    int Ndata;
    1420
    15     Ndata = (filestatus.st_size - header.size) / sizeof (Image);
     21    Ndata = (filestatus.st_size - db[0].header.size) / sizeof (Image);
    1622    if (VERBOSE) fprintf (stderr, "ERROR: image catalog has inconsistent size\n");
    1723    if (VERBOSE) fprintf (stderr, "header: %d, data: %d\n", Nimage, Ndata);
     
    2733  db[0].ftable.header = &db[0].theader;
    2834
    29   /* set theader size information to match loaded data */
    30 
    3135  /* alloc, read images */
    3236  ALLOCATE (image, Image, MAX (Nimage, 1));
     
    3640    exit (1);
    3741  }
    38   db[0].ftable.buffer = image;
     42  db[0].ftable.buffer = (char *) image;
     43  fits_modify (&db[0].theader, "NAXIS2", "%d", 1, Nimage);
     44  db[0].theader.Naxis[1] = Nimage;
     45  db[0].ftable.size = fits_matrix_size (&db[0].theader);
     46 
    3947  return (TRUE);
    4048}
Note: See TracChangeset for help on using the changeset viewer.