- Timestamp:
- May 28, 2015, 8:27:00 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/libfits/include/gfitsio.h
r38062 r38329 73 73 off_t datasize; // size of the buffer (including block padding at the end) 74 74 off_t validsize; // size of the valid portion of the table (< validsize if file is short) 75 off_t heap_start; // byte offset to start of HEAP 75 76 } FTable; 76 77 … … 85 86 } VTable; 86 87 87 typedef struct { 88 int maxlen; // max size of all table rows 89 int nbytes; // number of bytes per column element 90 int Nstart; // byte offset of this column relative to first column 91 off_t heap_start; // byte offset to start of HEAP 92 char format; // data format character (one of: XLABIJEDCM) 93 char mode; // access data pointer type (one of P or Q) 88 // description / metadata needed for a single varlength column. A varlength column has a 89 // 2-element array giving the (length,offset) of data in the heap. Below, 'real data' are 90 // the values in the heap; 'metadata' are the values in the main table. 91 typedef struct { 92 int column; // field number (of the metadata) 93 char format; // format character for real data (one of: XLABIJKEDCM) 94 char mode; // format character for metadata (one of P [float] or Q [double]) 95 int maxlen; // max size of all table rows for this column 96 int nbytes; // number of bytes per real data column element 97 int offset; // byte offset of the metadata column relative to first column 94 98 } VarLengthColumn; 99 100 typedef struct { 101 char ttype[16]; // TTYPE field of original table 102 char ttype_cmt[80]; // comment associated with TTYPE 103 char tunit[16]; // TUNIT field of original table 104 char tunit_cmt[80]; // comment associated with TUNIT 105 char tformat[16]; // TFORM field of original table 106 char tformat_cmt[80]; // comment associated with TFORM 107 char zctype[80]; // compression type for this field 108 VarLengthColumn zdef; // description of the output variable length column 109 110 char datatype[80]; // named data type associated with ttype (eg, 18J -> int, 18D -> double) 111 int Nvalues; // number of values per row (eg 18J -> 18 int values) 112 int pixsize; // number of bytes per value of this row (eg, 18J -> 4 bytes) 113 int rowsize; // number of bytes for a full row (Nvalues * pixsize) 114 int offset; // byte offset of the real data column relative to first column 115 } TableField; 95 116 96 117 # ifndef PROTO … … 133 154 off_t gfits_data_min_size PROTO((Header *header)); 134 155 off_t gfits_data_pad_size PROTO((off_t rawsize)); 156 off_t gfits_heap_start PROTO((Header *header)); 135 157 int gfits_extended_to_primary PROTO((Header *header, int simple, char *comment)); 136 158 int gfits_primary_to_extended PROTO((Header *header, char *exttype, char *comment)); … … 166 188 void gfits_set_matrix_value PROTO((Matrix *matrix, off_t x, off_t y, double value)); 167 189 int gfits_write_matrix PROTO((char *filename, Matrix *matrix)); 190 168 191 int gfits_uncompress_image PROTO((Header *header, Matrix *matrix, FTable *ftable)); 169 192 int gfits_uncompress_data PROTO((char *zdata, int Nzdata, char *cmptype, char **optname, char **optvalue, int Nopt, char *outdata, int *Nout, int out_pixsize)); 170 193 int gfits_distribute_data PROTO((Matrix *matrix, int bitpix, char *data, int Ndata, int *otile, int oblank, int *ztile, int zblank, float zscale, float zzero)); 194 195 int gfits_compress_data PROTO((char *zdata, int *Nzdata, char *cmptype, char **optname, char **optvalue, int Nopt, char *rawdata, int Nraw, int raw_pixsize)); 196 int gfits_compress_image PROTO((Header *header, Matrix *matrix, FTable *ftable, int *Ztile, char *zcmptype)); 197 int gfits_collect_data PROTO((Matrix *matrix, char *raw, int Nraw, int raw_pixsize, int *otile, int oblank, int *ztile, int zblank, float zscale, float zzero)); 198 int gfits_copy_keywords_compress PROTO((Header *srchead, Header *tgthead)); 199 200 off_t gfits_tile_size PROTO((Matrix *matrix, int *otile, int *ztile)); 201 int gfits_imtile_maxsize PROTO((Matrix *matrix, int *ztile)); 202 int gfits_imtile_count PROTO((Matrix *matrix, int *ztile, int *ntile)); 203 int gfits_imtile_start PROTO((Matrix *matrix, int *otile)); 204 int gfits_imtile_next PROTO((Matrix *matrix, int *ztile, int *ntile, int *otile)); 205 171 206 int gfits_byteswap_zdata PROTO((char *zdata, int Nzdata, int bitpix)); 172 207 int gfits_extension_is_compressed PROTO((Header *header)); 173 off_t gfits_tile_size PROTO((Matrix *matrix, int *otile, int *ztile));174 208 int gfits_uncompressed_data_pixsize PROTO((char *cmptype, int out_bitpix, char **optname, char **optvalue, int Noptions)); 175 209 int gfits_vartable_heap_pixsize PROTO((char format)); 176 210 211 int gfits_varlength_column_add_data PROTO((FTable *table, char *data, off_t Ndata, int row, VarLengthColumn *column)); 212 void *gfits_varlength_column_pointer PROTO((FTable *ftable, VarLengthColumn *column, off_t row, off_t *length)); 213 int gfits_varlength_column_define PROTO((FTable *ftable, VarLengthColumn *def, int column)); 214 int gfits_varlength_column_finish PROTO((FTable *ftable, VarLengthColumn *def)); 215 int gfits_byteswap_varlength_column PROTO((FTable *ftable, int column)); 216 177 217 /******************************* Table functions *************/ 178 218 … … 182 222 char *gfits_table_print PROTO((FTable *ftable,...)); 183 223 int gfits_add_rows PROTO((FTable *ftable, char *data, off_t Nrow, off_t Nbytes)); 224 int gfits_set_table_rows PROTO((Header *header, FTable *table, off_t Nrows)); 184 225 int gfits_bintable_format PROTO((char *format, char *type, int *Nval, int *Nbytes)); 185 226 int gfits_create_table PROTO((Header *header, FTable *ftable)); … … 226 267 int gfits_write_Theader PROTO((char *filename, Header *header)); 227 268 228 int gfits_varlength_column_define PROTO((FTable *ftable, VarLengthColumn *def, int column)); 229 void *gfits_varlength_column_pointer PROTO((FTable *ftable, VarLengthColumn *column, off_t row, off_t *length)); 269 int gfits_compress_table PROTO((FTable *srctable, FTable *tgttable, int ztilelen, char *zcmptype)); 230 270 231 271 #endif /* FITSIO */
Note:
See TracChangeset
for help on using the changeset viewer.
