00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef QFITS_TABLE_H
00029 #define QFITS_TABLE_H
00030
00031
00032
00033
00034
00035 #include <stdio.h>
00036 #include <string.h>
00037 #include <stdlib.h>
00038 #include <unistd.h>
00039
00040 #include "qfits_header.h"
00041
00042
00043
00044
00045
00046
00047 #define FITSVALSZ 60
00048
00049 #define QFITS_INVALIDTABLE 0
00050 #define QFITS_BINTABLE 1
00051 #define QFITS_ASCIITABLE 2
00052
00053
00054
00055
00056
00057
00061
00062 typedef enum _TFITS_DATA_TYPE_ {
00063 TFITS_ASCII_TYPE_A,
00064 TFITS_ASCII_TYPE_D,
00065 TFITS_ASCII_TYPE_E,
00066 TFITS_ASCII_TYPE_F,
00067 TFITS_ASCII_TYPE_I,
00068 TFITS_BIN_TYPE_A,
00069 TFITS_BIN_TYPE_B,
00070 TFITS_BIN_TYPE_C,
00071 TFITS_BIN_TYPE_D,
00072 TFITS_BIN_TYPE_E,
00073 TFITS_BIN_TYPE_I,
00074 TFITS_BIN_TYPE_J,
00075 TFITS_BIN_TYPE_L,
00076 TFITS_BIN_TYPE_M,
00077 TFITS_BIN_TYPE_P,
00078 TFITS_BIN_TYPE_X,
00079 TFITS_BIN_TYPE_UNKNOWN
00080 } tfits_type ;
00081
00082
00093
00094 typedef struct qfits_col
00095 {
00104 int atom_nb ;
00105
00110 int atom_dec_nb ;
00111
00131 int atom_size ;
00132
00138 tfits_type atom_type ;
00139
00141 char tlabel[FITSVALSZ] ;
00142
00144 char tunit[FITSVALSZ] ;
00145
00147 char nullval[FITSVALSZ] ;
00148
00150 char tdisp[FITSVALSZ] ;
00151
00158 int zero_present ;
00159 float zero ;
00160 int scale_present ;
00161 float scale ;
00162
00164 int off_beg ;
00165
00167 int readable ;
00168 } qfits_col ;
00169
00170
00171
00201
00202 typedef struct qfits_table
00203 {
00207 char filename[512] ;
00212 int tab_t ;
00214 int tab_w ;
00216 int nc ;
00218 int nr ;
00220 qfits_col * col ;
00221 } qfits_table ;
00222
00223
00224
00225
00226
00227 int qfits_is_table(const char * filename, int xtnum) ;
00228 qfits_header * qfits_table_prim_header_default(void) ;
00229 qfits_header * qfits_table_ext_header_default(const qfits_table *) ;
00230 qfits_table * qfits_table_new(const char *, int, int, int, int) ;
00231 int qfits_col_fill(qfits_col *, int, int, int, tfits_type, const char *,
00232 const char *, const char *, const char *, int, float, int, float, int) ;
00233 qfits_table * qfits_table_open(const char *, int) ;
00234 void qfits_table_close(qfits_table *) ;
00235 unsigned char * qfits_query_column(const qfits_table *, int, const int *) ;
00236 unsigned char * qfits_query_column_seq(const qfits_table *, int, int, int) ;
00237 void * qfits_query_column_data(const qfits_table *, int, const int *,
00238 const void *) ;
00239 void * qfits_query_column_seq_data(const qfits_table *, int, int, int,
00240 const void *) ;
00241 int * qfits_query_column_nulls(const qfits_table *, int, const int *, int *,
00242 int *);
00243 int qfits_save_table_hdrdump(const void **, const qfits_table *,
00244 const qfits_header *) ;
00245 int qfits_table_append_xtension(FILE *, const qfits_table *, const void **) ;
00246 int qfits_table_append_xtension_hdr(FILE *, const qfits_table *, const void **,
00247 const qfits_header *) ;
00248 char * qfits_table_field_to_string(const qfits_table *, int, int, int) ;
00249
00250 #endif