IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 1, 2012, 2:22:08 PM (14 years ago)
Author:
eugene
Message:

fix byteswap error for 64bit tables (simplify byteswap code generally to clean up); add function to get type of specified column by seq number; defaults for Bzero and Bscale in tables without temp (0.0,1.0); function to set a bintable column from a vector of different type; better error handling for F_print,F_modify

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libfits/table/F_get_column.c

    r31371 r33648  
    126126
    127127/***********************/
     128int gfits_get_bintable_column_type_by_N (Header *header, int N, char *type, int *Nval) {
     129
     130  int Nbytes;
     131  char field[80], format[80];
     132
     133  assert (N > 0);
     134
     135  sprintf (field, "TFORM%d", N);
     136  if (!gfits_scan (header, field, "%s", 1, format)) return FALSE;
     137  if (!gfits_bintable_format (format, type, Nval, &Nbytes)) return (FALSE);
     138  return (TRUE);
     139}
     140
     141/***********************/
    128142int gfits_get_bintable_column_type (Header *header, char *label, char *type, int *Nval) {
    129143
    130   int i, N, Nfields, Nbytes;
    131   char tlabel[80], field[80], format[80];
     144  int i, N, Nfields;
     145  char tlabel[80], field[80];
    132146
    133147  if (label == (char *) NULL) return (FALSE);
     
    144158  N = i - 1;
    145159
    146   sprintf (field, "TFORM%d", N);
    147   gfits_scan (header, field, "%s", 1, format);
    148 
    149   if (!gfits_bintable_format (format, type, Nval, &Nbytes)) return (FALSE);
     160  if (!gfits_get_bintable_column_type_by_N (header, N, type, Nval)) return FALSE;
    150161  return (TRUE);
    151162}
Note: See TracChangeset for help on using the changeset viewer.