Changeset 41676 for trunk/Ohana/src/libfits/table/F_table_format.c
- Timestamp:
- Jul 1, 2021, 1:58:44 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/table/F_table_format.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/table/F_table_format.c
r41474 r41676 5 5 // get the format of a table column 6 6 // Nval : number of joined columns 7 // Nbytes : width of column 7 // Nbytes : width of column, determined by the type (e.g., float = 4 bytes) 8 8 int gfits_bintable_format (char *format, char *type, int *Nval, int *Nbytes) { 9 9 … … 90 90 91 91 /***********************/ 92 // get the format of a table column 93 // Nval : number of fields (1 for all types except string) 94 // Nbytes : width of FITS table column, ie number of bytes in ASCII table 92 95 int gfits_table_format (char *format, char *type, int *Nval, int *Nbytes) { 93 96 … … 109 112 int isLong = FALSE; 110 113 char Type = 'x'; 111 if (Fchar == 'D') { *Nbytes = 1; strcpy (type, "double"); Type = 'e'; *Nval = Nv; isLong = TRUE; }112 if (Fchar == 'E') { *Nbytes = 1; strcpy (type, "float"); Type = 'e'; *Nval = Nv; }113 if (Fchar == 'F') { *Nbytes = 1; strcpy (type, "float"); Type = 'f'; *Nval = Nv; }114 if (Fchar == 'I') { *Nbytes = 1; strcpy (type, "int"); Type = 'd'; *Nval = Nv; }115 if (Fchar == 'A') { *Nbytes = 1; strcpy (type, "char"); Type = 's'; *Nval = Nv; }114 if (Fchar == 'D') { *Nbytes = Nv; strcpy (type, "double"); Type = 'e'; *Nval = 1; isLong = TRUE; } 115 if (Fchar == 'E') { *Nbytes = Nv; strcpy (type, "float"); Type = 'e'; *Nval = 1; } 116 if (Fchar == 'F') { *Nbytes = Nv; strcpy (type, "float"); Type = 'f'; *Nval = 1; } 117 if (Fchar == 'I') { *Nbytes = Nv; strcpy (type, "int"); Type = 'd'; *Nval = 1; } 118 if (Fchar == 'A') { *Nbytes = 1; strcpy (type, "char"); Type = 's'; *Nval = Nv; } 116 119 if (!*Nbytes) { return (FALSE); } 117 120 … … 133 136 /* 134 137 valid TABLE column formats: 135 FN.N - floating point 136 INN - integer 138 FN.N - floating point taking NN characters in the table 139 INN - integer taking NN characters in the table 137 140 ANN - NN char string 138 141
Note:
See TracChangeset
for help on using the changeset viewer.
