IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 6, 2015, 10:04:55 AM (11 years ago)
Author:
eugene
Message:

fix AUTO types to match funpack needs; swap double correctly

File:
1 edited

Legend:

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

    r38404 r38408  
    129129
    130130    if (!strcasecmp (fields[i].zctype, "AUTO")) {
    131       if (!strcmp (fields[i].datatype, "float") ||
     131      if (!strcmp (fields[i].datatype, "short") ||
     132          !strcmp (fields[i].datatype, "float") ||
    132133          !strcmp (fields[i].datatype, "double")||
    133134          !strcmp (fields[i].datatype, "int64_t")) {
     
    135136        goto got_cmptype;
    136137      }
    137       if (!strcmp (fields[i].datatype, "byte") ||
    138           !strcmp (fields[i].datatype, "short") ||
    139           !strcmp (fields[i].datatype, "int")) {
     138      if (!strcmp (fields[i].datatype, "int")) {
    140139        strcpy (fields[i].zctype, "RICE_1");
    141140        goto got_cmptype;
    142141      }
    143       if (!strcmp (fields[i].datatype, "char")) {
     142      if (!strcmp (fields[i].datatype, "byte") ||
     143          !strcmp (fields[i].datatype, "char")) {
    144144        strcpy (fields[i].zctype, "GZIP_1");
    145145        goto got_cmptype;
     
    154154        strcpy (fields[i].zctype, "GZIP_2");
    155155      }
     156    }
     157
     158    // OVERRIDE: GZIP_2 invalid for B (use GZIP_1)
     159    if (!strcasecmp (fields[i].zctype, "GZIP_2") && !strcmp (fields[i].datatype, "byte")) {
     160      strcpy (fields[i].zctype, "GZIP_1");
    156161    }
    157162
Note: See TracChangeset for help on using the changeset viewer.