Main Page | Class List | Directories | File List | Class Members

hdf_reader.h

00001 /*
00002 *
00003 * Description: Generic library for reading HDF4 files
00004 *
00005 * History :
00006 *   v0.0.0 2008/02/25 : creation
00007 *
00008 * Author: Nicolas PASCAL <nicolas.pascal@icare.univ-lille1.fr>, (C) Centre de Gestion et de Traitement de Données (CGTD) ICARE 2008
00009 *
00010 * Copyright: See COPYING file that comes with this distribution
00011 *
00012 */
00013 
00014 #ifndef HDF_READER_H
00015 #define HDF_READER_H
00016 
00017 #include <stdio.h>
00018 #include <string.h>
00019 #include "mfhdf.h"
00020 
00024 typedef struct {
00026     char name[MAX_NC_NAME];
00028     int32 datatype;
00030     int32 n_val;
00032     void * value;
00033 } ATTR;
00034 
00038 typedef struct {
00040     char name[MAX_NC_NAME];
00042     int32 datatype;
00044     int32 rank;
00046     int32 dim_size[MAX_VAR_DIMS];
00048     int32 n_attr;
00050     ATTR * v_attr;
00051 } SDS_INFO;
00052 
00058 int32 open_hdf_file(const char* filename);
00059 
00065 int32 close_hdf_file(const int32 hdf_id);
00066 
00076 int32 get_file_info( const char* filename, int32 * n_sds, char *** v_sds_name, int32 * n_file_attr, char *** v_file_attr_name );
00077 
00085 int32 get_sds_info( const char* filename, const char * sds_name, SDS_INFO * sds_info );
00086 
00094 int32 get_sds_info_by_id( const int32 sd_id, const char * sds_name, SDS_INFO * sds_info );
00095 
00100 void print_sds_info (const SDS_INFO * sds_info);
00101 
00109 int32 get_file_attr ( const char* filename, const char* attr_name, ATTR * attr);
00117 int32 get_file_attr_by_id ( const int32 sd_id, const char* attr_name, ATTR * attr);
00118 
00127 int32 get_sds_attr ( const char* filename, const char * sds_name, const char* attr_name, ATTR * attr);
00128 
00133 void print_attr (const ATTR * attr);
00134 
00143 int32 get_obj_attr ( const int32 obj_id, const char* attr_name, ATTR * attr );
00144 
00153 int32 get_obj_attr_by_index( const int32 obj_id, const int32 i_attr, ATTR * attr );
00154 
00166 int32 read_sds( const char * filename, const char* sds_name, void *sds_data, int32 *start, int32 *stride, int32 *edges );
00167 
00179 int32 read_sds_by_id( const int32 sd_id, const char* sds_name, void *sds_data, int32 *start, int32 *stride, int32 *edges );
00180 
00192 int32 get_sds_calibration( const char* filename, const char* sds_name, float64 *cal, float64 *cal_err, float64 *offset, float64 *offset_err, int32 *data_type );
00193 
00206 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 );
00207 
00213 int16 get_datatype_size ( const int32 datatype );
00214 
00219 void print_datatype_description ( const int32 datatype );
00220 
00228 int32 get_sds_id ( const int32 sd_id, const char * sds_name ) ;
00229 
00230 #endif
00231 

Generated on Wed Feb 27 15:07:02 2008 for caltrack_reader.kdevelop by  doxygen 1.4.4