IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 27, 2015, 4:49:06 PM (11 years ago)
Author:
eugene
Message:

extensive work on relphot, relastro, uniphot, dvomerge aiming to the construction and calibration of PV3

Location:
trunk/Ohana
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/libfits/Makefile

    r38441 r38986  
    2525TEST_CPPFLAGS = $(BASE_CPPFLAGS)
    2626TEST_LDFLAGS  = $(BASE_LDFLAGS) -lFITS -lohana -ltap_ohana
    27 
    2827
    2928TESTXTRA = tcomptiming
  • trunk/Ohana/src/libfits/extern/gzip.c

    r38441 r38986  
    215215  err = inflate(&stream, Z_FINISH);
    216216  if (err != Z_STREAM_END) {
     217    if (err == Z_DATA_ERROR) {
     218      fprintf (stderr, "compressed data is corrupted\n");
     219      ESCAPE(err);
     220    }
    217221    inflateEnd(&stream);
    218222    if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) ESCAPE (Z_DATA_ERROR);
  • trunk/Ohana/src/libfits/header/F_H_field.c

    r29537 r38986  
    3333  }
    3434
    35   if (N < 0) {
     35  if (N <= 0) {
    3636    /* count the entries */
    3737    Nfound = 0;
  • trunk/Ohana/src/libfits/include/gfitsio.h

    r38553 r38986  
    237237int     gfits_fread_ftable             PROTO((FILE *f, FTable *ftable, char *extname));
    238238int     gfits_fread_ftable_data        PROTO((FILE *f, FTable *ftable, int padIfShort));
    239 int     gfits_fread_ftable_range       PROTO((FILE *f, int padIfShort, FTable *ftable, off_t start, off_t Nrows));
     239int     gfits_fread_ftable_range       PROTO((FILE *f, int padIfShort, int noSeek, FTable *ftable, off_t start, off_t Nrows));
    240240int     gfits_fread_vtable             PROTO((FILE *f, VTable *vtable, char *extname, off_t Nrow, off_t *row));
    241241int     gfits_fread_vtable_range       PROTO((FILE *f, VTable *vtable, off_t start, off_t Nrows));
  • trunk/Ohana/src/libfits/matrix/F_compress_data.c

    r38441 r38986  
    119119      return (FALSE);
    120120    }
     121    if (Nout > *Nzdata) {
     122      fprintf (stderr, "buffer overrun! %d out, %d available\n", Nout, *Nzdata);
     123      return FALSE;
     124    }
    121125    *Nzdata = Nout;
    122126    return TRUE;
  • trunk/Ohana/src/libfits/table/F_compress_T.c

    r38553 r38986  
    211211
    212212  // allocate the intermediate storage buffers
    213   int Nzdata_alloc = max_width*ztilelen + 100;
     213  int Nzdata_alloc = 2*max_width*ztilelen + 100;
    214214  ALLOCATE (raw,   char, max_width*ztilelen);
    215215  ALLOCATE (zdata, char, Nzdata_alloc);
     
    223223  gettimeofday (&startTimer, (void *) NULL);
    224224
     225  // ohana_memcheck (TRUE);
     226
    225227  // compress the data : copy into a tile, compress the tile, then add to the output table
    226228  // each tile -> 1 row of the output table
     
    243245      }
    244246     
     247      // ohana_memcheck (TRUE);
     248
    245249      // XXX TIMER 2a
    246250      gettimeofday (&stopTimer, (void *) NULL);
     
    260264      }
    261265
     266      // ohana_memcheck (TRUE);
    262267      // optname, optvalue = NULL, Noptions = 0
    263268     
  • trunk/Ohana/src/libfits/table/F_read_T.c

    r38441 r38986  
    6262
    6363/*********************** fits read ftable data ***********************************/
    64 int gfits_fread_ftable_range (FILE *f, int padIfShort, FTable *table, off_t start, off_t Nrows) {
     64int gfits_fread_ftable_range (FILE *f, int padIfShort, int noSeek, FTable *table, off_t start, off_t Nrows) {
    6565
    6666  off_t Nbytes, Nread, Nskip, Nx, Ny;
     
    7979  Nskip = start * Nx;
    8080  Nbytes = Nrows * Nx;
    81   ALLOCATE (table[0].buffer, char, MAX (Nbytes, 1));
    82 
    83   fseeko (f, Nskip, SEEK_CUR);
     81
     82  if (table[0].buffer) {
     83    if (table[0].datasize < Nbytes) {
     84      REALLOCATE (table[0].buffer, char, MAX (Nbytes, 1));
     85    }
     86  } else {
     87    ALLOCATE (table[0].buffer, char, MAX (Nbytes, 1));
     88  }
     89
     90  if (!noSeek) {
     91    fseeko (f, Nskip, SEEK_CUR);
     92  }
    8493
    8594  Nread = fread (table[0].buffer, sizeof (char), Nbytes, f);
  • trunk/Ohana/src/libfits/test/tcomptiming.c

    r38553 r38986  
    2525    int Ntile = pow (10.0, lNtile);
    2626    fprintf (stderr, "--- Ntile = %d ---\n", Ntile);
    27     test_compress_timing ("NONE_2", Ntile);
     27    test_compress_timing ("GZIP_2", Ntile);
    2828    gfits_compress_timing();
    2929    gfits_uncompress_timing();
Note: See TracChangeset for help on using the changeset viewer.