IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 6, 2015, 2:28:50 PM (11 years ago)
Author:
eugene
Message:

add timing test; handle empty table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/libfits/table/F_compress_T.c

    r38408 r38415  
    3939  if (!ztilelen) ztilelen = srcheader->Naxis[1];
    4040
    41   if (srcheader->Naxis[1] % ztilelen) {
    42     Ntile = srcheader->Naxis[1] / ztilelen + 1;
    43     ztilelast = srcheader->Naxis[1] % ztilelen;
     41  if (!srcheader->Naxis[1]) {
     42    Ntile = 0;
     43    ztilelast = 0;
    4444  } else {
    45     Ntile = srcheader->Naxis[1] / ztilelen;
     45    if (srcheader->Naxis[1] % ztilelen) {
     46      Ntile = srcheader->Naxis[1] / ztilelen + 1;
     47      ztilelast = srcheader->Naxis[1] % ztilelen;
     48    } else {
     49      Ntile = srcheader->Naxis[1] / ztilelen;
    4650    ztilelast = ztilelen;
     51    }
    4752  }
    4853
     
    237242      }
    238243
    239       if (strcasecmp(fields[j].zctype, "NONE") &&
    240           strcasecmp(fields[j].zctype, "NONE_2") &&
     244      if (strcasecmp(fields[j].zctype, "NONE_2") && // NONE and NONE_1 not swapped?
    241245          strcasecmp(fields[j].zctype, "GZIP_1") &&
    242246          strcasecmp(fields[j].zctype, "GZIP_2") &&
Note: See TracChangeset for help on using the changeset viewer.