c_hdf_reader.h

Go to the documentation of this file.
00001 #ifndef HDF_READER_H
00002 #define HDF_READER_H
00003 
00018 #include <stdio.h>
00019 #include <string.h>
00020 #include "mfhdf.h"
00021 
00026 typedef struct {
00028     char name[MAX_NC_NAME];
00030     int32 data_type;
00032     int32 n_val;
00034     void * value;
00035 } ATTR;
00036 
00041 typedef struct {
00043     char name[MAX_NC_NAME];
00045     int32 data_type;
00047     int32 rank;
00049     int32 dim_size[MAX_VAR_DIMS];
00051     int32 n_attr;
00053     ATTR * v_attr;
00054 } SDS_INFO;
00055 
00061 int32 open_hdf_file(const char* filename);
00062 
00068 int32 close_hdf_file(const int32 hdf_id);
00069 
00079 int32 get_file_info( const char* filename, int32 * n_sds, char *** v_sds_name, int32 * n_file_attr, char *** v_file_attr_name );
00080 
00088 int32 get_sds_info( const char* filename, const char * sds_name, SDS_INFO * sds_info );
00089 
00097 int32 get_sds_info_by_id( const int32 sd_id, const char * sds_name, SDS_INFO * sds_info );
00098 
00103 void print_sds_info (const SDS_INFO * sds_info);
00104 
00112 int32 get_file_attr ( const char* filename, const char* attr_name, ATTR * attr);
00113 
00121 int32 get_file_attr_by_id ( const int32 sd_id, const char* attr_name, ATTR * attr);
00122 
00131 int32 get_sds_attr ( const char* filename, const char * sds_name, const char* attr_name, ATTR * attr);
00132 
00141 int32 get_sds_attr_by_id ( const int32 sd_id, const char * sds_name, const char* attr_name, ATTR * attr);
00142 
00143 
00148 void print_attr (const ATTR * attr);
00149 
00158 int32 get_obj_attr ( const int32 obj_id, const char* attr_name, ATTR * attr );
00159 
00168 int32 get_obj_attr_by_index( const int32 obj_id, const int32 i_attr, ATTR * attr );
00169 
00181 double * read_sds_data( const char * filename, const char* sds_name, double *sds_data, int32 *start, int32 *stride, int32 *edges );
00182 
00194 double * read_sds_data_by_id( const int32 sd_id, const char* sds_name, double *sds_data, int32 *start, int32 *stride, int32 *edges );
00195 
00208 void* read_sds_binary_data( const char * filename, const char* sds_name, void *sds_data, int32 *start, int32 *stride, int32 *edges );
00209 
00222 void* read_sds_binary_data_by_id( const int32 sd_id, const char* sds_name, void *sds_data, int32 *start, int32 *stride, int32 *edges );
00223 
00235 int32 get_sds_calibration( const char* filename, const char* sds_name, float64 *cal, float64 *cal_err, float64 *offset, float64 *offset_err, int32 *data_type );
00236 
00249 int32 get_sds_calibration_by_id( const int32 sd_id, const char* sds_name, float64 *cal, float64 *cal_err, float64 *offset, float64 *offset_err, int32 *data_type );
00250 
00256 int16 get_data_type_size ( const int32 data_type );
00257 
00262 void print_data_type_description ( const int32 data_type );
00263 
00271 int32 get_sds_id ( const int32 sd_id, const char * sds_name ) ;
00272 
00283 int32 set_start_stride_edge (const int32 sd_id, const char * sds_name, int32 **start, const int32 *stride, int32 **edges);
00284 
00295 int32 scale_data( const void* unscaled_data, const int32 unscaled_data_type, const int32 nb_data, const double scale_factor, const double offset, double* scaled_data );
00296 
00303 inline void* allocate_data(const int32 data_type, const int32 data_size);
00304 
00310 void free_typed_data (void* data, const int32 data_type);
00311 
00316 void free_attr (ATTR * attr);
00317 
00322 void free_sds_info (SDS_INFO * sds_info);
00323 
00330 void free_v_string( char *** v_string, const int32 n_string );
00331 
00340 int32 array_cast ( const double* indata, const int32 nb_data, const int32 typecode, void* outdata );
00341 
00349 int32 value_cast ( const double inval, const int32 typecode, void* outval );
00350 
00351 #endif
00352 

Generated on Wed Sep 2 15:04:31 2009 for caltrack_reader.kdevelop by  doxygen 1.5.8