IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 5, 2015, 7:58:50 PM (11 years ago)
Author:
eugene
Message:

handle zzero,zscale = 0,1 specially to avoid bitlevel errors

File:
1 edited

Legend:

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

    r38366 r38399  
    7878    if (!gfits_scan_alt (srcheader, keyword, "%C", 1, fields[i].tformat_cmt)) ESCAPE;
    7979
    80     // for now we set all fields to the requested type
     80    // for now we set all fields to the requested type.  since I do not yet know the column data types I cannot yet assign automatic cmptypes
    8181    strcpy (fields[i].zctype, zcmptype);
    8282
     
    127127    fields[i].rowsize = fields[i].Nvalues*fields[i].pixsize;
    128128    max_width = MAX(max_width, fields[i].rowsize);
     129
     130    if (!strcasecmp (fields[i].zctype, "AUTO")) {
     131      if (!strcmp (fields[i].datatype, "float") ||
     132          !strcmp (fields[i].datatype, "double")||
     133          !strcmp (fields[i].datatype, "int64_t")) {
     134        strcpy (fields[i].zctype, "GZIP_2");
     135        goto got_cmptype;
     136      }
     137      if (!strcmp (fields[i].datatype, "byte") ||
     138          !strcmp (fields[i].datatype, "short") ||
     139          !strcmp (fields[i].datatype, "int")) {
     140        strcpy (fields[i].zctype, "RICE_1");
     141        goto got_cmptype;
     142      }
     143      if (!strcmp (fields[i].datatype, "char")) {
     144        strcpy (fields[i].zctype, "GZIP_1");
     145        goto got_cmptype;
     146      }
     147    }
     148  got_cmptype:
     149
    129150
    130151    // RICE can only be used on integer fields
Note: See TracChangeset for help on using the changeset viewer.