IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 4, 2015, 5:42:47 PM (11 years ago)
Author:
eugene
Message:

libfits compressed I/O seems to be generally working

File:
1 edited

Legend:

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

    r38329 r38366  
    175175
    176176/***********************/
    177 int gfits_set_bintable_column_reformat (Header *header, FTable *table, char *label, char *intype, void *data, off_t Nrow) {
     177// convert the input data array (of the specified intype) to the desired table data type. swap unless nativeOrder is requested
     178int gfits_set_bintable_column_reformat (Header *header, FTable *table, char *label, char *intype, void *data, off_t Nrow, char nativeOrder) {
    178179
    179180  off_t Nx, Ny;
     
    256257      *(short *)Pout = (*(char *)Pin - Bzero) / Bscale;
    257258# ifdef BYTE_SWAP
    258       SWAP_BYTE;
     259      if (!nativeOrder) { SWAP_BYTE; }
    259260# endif
    260261    } 
     
    265266      *(int *)Pout = (*(char *)Pin - Bzero) / Bscale;
    266267# ifdef BYTE_SWAP
    267       SWAP_WORD;
     268      if (!nativeOrder) { SWAP_WORD; }
    268269# endif
    269270    }
     
    274275      *(int64_t *)Pout = (*(char *)Pin - Bzero) / Bscale;
    275276# ifdef BYTE_SWAP
    276       SWAP_DBLE;
     277      if (!nativeOrder) { SWAP_DBLE; }
    277278# endif
    278279    }
     
    283284      *(float *)Pout = (*(char *)Pin - Bzero) / Bscale;
    284285# ifdef BYTE_SWAP
    285       SWAP_WORD;
     286      if (!nativeOrder) { SWAP_WORD; }
    286287# endif
    287288    }
     
    292293      *(double *)Pout = (*(char *)Pin - Bzero) / Bscale;
    293294# ifdef BYTE_SWAP
    294       SWAP_DBLE;
     295      if (!nativeOrder) { SWAP_DBLE; }
    295296# endif
    296297    }
     
    315316      *(short *)Pout = (*(char *)Pin - Bzero) / Bscale;
    316317# ifdef BYTE_SWAP
    317       SWAP_BYTE;
     318      if (!nativeOrder) { SWAP_BYTE; }
    318319# endif
    319320    } 
     
    324325      *(int *)Pout = (*(char *)Pin - Bzero) / Bscale;
    325326# ifdef BYTE_SWAP
    326       SWAP_WORD;
     327      if (!nativeOrder) { SWAP_WORD; }
    327328# endif
    328329    }
     
    333334      *(int64_t *)Pout = (*(char *)Pin - Bzero) / Bscale;
    334335# ifdef BYTE_SWAP
    335       SWAP_DBLE;
     336      if (!nativeOrder) { SWAP_DBLE; }
    336337# endif
    337338    }
     
    342343      *(float *)Pout = (*(char *)Pin - Bzero) / Bscale;
    343344# ifdef BYTE_SWAP
    344       SWAP_WORD;
     345      if (!nativeOrder) { SWAP_WORD; }
    345346# endif
    346347    }
     
    351352      *(double *)Pout = (*(char *)Pin - Bzero) / Bscale;
    352353# ifdef BYTE_SWAP
    353       SWAP_DBLE;
     354      if (!nativeOrder) { SWAP_DBLE; }
    354355# endif
    355356    }
     
    374375      *(short *)Pout = (*(short *)Pin - Bzero) / Bscale;
    375376# ifdef BYTE_SWAP
    376       SWAP_BYTE;
     377      if (!nativeOrder) { SWAP_BYTE; }
    377378# endif
    378379    } 
     
    383384      *(int *)Pout = (*(short *)Pin - Bzero) / Bscale;
    384385# ifdef BYTE_SWAP
    385       SWAP_WORD;
     386      if (!nativeOrder) { SWAP_WORD; }
    386387# endif
    387388    }
     
    392393      *(int64_t *)Pout = (*(short *)Pin - Bzero) / Bscale;
    393394# ifdef BYTE_SWAP
    394       SWAP_DBLE;
     395      if (!nativeOrder) { SWAP_DBLE; }
    395396# endif
    396397    }
     
    401402      *(float *)Pout = (*(short *)Pin - Bzero) / Bscale;
    402403# ifdef BYTE_SWAP
    403       SWAP_WORD;
     404      if (!nativeOrder) { SWAP_WORD; }
    404405# endif
    405406    }
     
    410411      *(double *)Pout = (*(short *)Pin - Bzero) / Bscale;
    411412# ifdef BYTE_SWAP
    412       SWAP_DBLE;
     413      if (!nativeOrder) { SWAP_DBLE; }
    413414# endif
    414415    }
     
    433434      *(short *)Pout = (*(int *)Pin - Bzero) / Bscale;
    434435# ifdef BYTE_SWAP
    435       SWAP_BYTE;
     436      if (!nativeOrder) { SWAP_BYTE; }
    436437# endif
    437438    } 
     
    442443      *(int *)Pout = (*(int *)Pin - Bzero) / Bscale;
    443444# ifdef BYTE_SWAP
    444       SWAP_WORD;
     445      if (!nativeOrder) { SWAP_WORD; }
    445446# endif
    446447    }
     
    451452      *(int64_t *)Pout = (*(int *)Pin - Bzero) / Bscale;
    452453# ifdef BYTE_SWAP
    453       SWAP_DBLE;
     454      if (!nativeOrder) { SWAP_DBLE; }
    454455# endif
    455456    }
     
    460461      *(float *)Pout = (*(int *)Pin - Bzero) / Bscale;
    461462# ifdef BYTE_SWAP
    462       SWAP_WORD;
     463      if (!nativeOrder) { SWAP_WORD; }
    463464# endif
    464465    }
     
    469470      *(double *)Pout = (*(int *)Pin - Bzero) / Bscale;
    470471# ifdef BYTE_SWAP
    471       SWAP_DBLE;
     472      if (!nativeOrder) { SWAP_DBLE; }
    472473# endif
    473474    }
     
    492493      *(short *)Pout = (*(int64_t *)Pin - Bzero) / Bscale;
    493494# ifdef BYTE_SWAP
    494       SWAP_BYTE;
     495      if (!nativeOrder) { SWAP_BYTE; }
    495496# endif
    496497    } 
     
    501502      *(int *)Pout = (*(int64_t *)Pin - Bzero) / Bscale;
    502503# ifdef BYTE_SWAP
    503       SWAP_WORD;
     504      if (!nativeOrder) { SWAP_WORD; }
    504505# endif
    505506    }
     
    510511      *(int64_t *)Pout = (*(int64_t *)Pin - Bzero) / Bscale;
    511512# ifdef BYTE_SWAP
    512       SWAP_DBLE;
     513      if (!nativeOrder) { SWAP_DBLE; }
    513514# endif
    514515    }
     
    519520      *(float *)Pout = (*(int64_t *)Pin - Bzero) / Bscale;
    520521# ifdef BYTE_SWAP
    521       SWAP_WORD;
     522      if (!nativeOrder) { SWAP_WORD; }
    522523# endif
    523524    }
     
    528529      *(double *)Pout = (*(int64_t *)Pin - Bzero) / Bscale;
    529530# ifdef BYTE_SWAP
    530       SWAP_DBLE;
     531      if (!nativeOrder) { SWAP_DBLE; }
    531532# endif
    532533    }
     
    551552      *(short *)Pout = (*(float *)Pin - Bzero) / Bscale;
    552553# ifdef BYTE_SWAP
    553       SWAP_BYTE;
     554      if (!nativeOrder) { SWAP_BYTE; }
    554555# endif
    555556    } 
     
    560561      *(int *)Pout = (*(float *)Pin - Bzero) / Bscale;
    561562# ifdef BYTE_SWAP
    562       SWAP_WORD;
     563      if (!nativeOrder) { SWAP_WORD; }
    563564# endif
    564565    }
     
    569570      *(int64_t *)Pout = (*(float *)Pin - Bzero) / Bscale;
    570571# ifdef BYTE_SWAP
    571       SWAP_DBLE;
     572      if (!nativeOrder) { SWAP_DBLE; }
    572573# endif
    573574    }
     
    578579      *(float *)Pout = (*(float *)Pin - Bzero) / Bscale;
    579580# ifdef BYTE_SWAP
    580       SWAP_WORD;
     581      if (!nativeOrder) { SWAP_WORD; }
    581582# endif
    582583    }
     
    587588      *(double *)Pout = (*(float *)Pin - Bzero) / Bscale;
    588589# ifdef BYTE_SWAP
    589       SWAP_DBLE;
     590      if (!nativeOrder) { SWAP_DBLE; }
    590591# endif
    591592    }
     
    610611      *(short *)Pout = (*(double *)Pin - Bzero) / Bscale;
    611612# ifdef BYTE_SWAP
    612       SWAP_BYTE;
     613      if (!nativeOrder) { SWAP_BYTE; }
    613614# endif
    614615    } 
     
    619620      *(int *)Pout = (*(double *)Pin - Bzero) / Bscale;
    620621# ifdef BYTE_SWAP
    621       SWAP_WORD;
     622      if (!nativeOrder) { SWAP_WORD; }
    622623# endif
    623624    }
     
    628629      *(int64_t *)Pout = (*(double *)Pin - Bzero) / Bscale;
    629630# ifdef BYTE_SWAP
    630       SWAP_DBLE;
     631      if (!nativeOrder) { SWAP_DBLE; }
    631632# endif
    632633    }
     
    637638      *(float *)Pout = (*(double *)Pin - Bzero) / Bscale;
    638639# ifdef BYTE_SWAP
    639       SWAP_WORD;
     640      if (!nativeOrder) { SWAP_WORD; }
    640641# endif
    641642    }
     
    646647      *(double *)Pout = (*(double *)Pin - Bzero) / Bscale;
    647648# ifdef BYTE_SWAP
    648       SWAP_DBLE;
     649      if (!nativeOrder) { SWAP_DBLE; }
    649650# endif
    650651    }
Note: See TracChangeset for help on using the changeset viewer.