ocssw  1.0
/disk01/web/ocssw/build/inc/swfinc/hdf5util.h (r8090/r7536)
Go to the documentation of this file.
00001 //-*- Mode: C++; -*-
00002 
00003 #ifndef hdf5util_h
00004 #define hdf5util_h
00005 
00006 #include <sstream>
00007 
00008 using namespace std;
00009 
00010 #include "hdf5.h"
00011 #define VOIDP void*
00012 
00013 #define DIFF1980_1970 315532800
00014 #define DIFFJAN0680_1970 (315532800 + 432000)
00015 #define DIFF2000_1980 631152000
00016 #define DIFF2000_JAN0680 (631152000 - 432000)
00017 
00018 int32_t get_millisec( string *ydhmsf_str);
00019 double get_tai( int32_t year, int32_t doy, double millisec);
00020 double get_tai( char *orbString);
00021 double gpstai2utc2000( double gpstai);
00022 double gpstai2unix( double gpstai);
00023 double unix2gpstai( double unixtime);
00024 
00025 
00026 namespace Hdf {
00027 
00028   int CreateH5D(
00029         hid_t grp,      /* group id */
00030         const char *sname,    /* short name */
00031         const char *lname,    /* long name */
00032         const char *units,    /* units (not set if passed NULL or "") */
00033         double low,     /* low end of valid range */
00034         double high,    /* high end of range (no range set if low >= high) */
00035         float slope,    /* scale factor (not set if 0)  */
00036         float offset,   /* scaling offset (not set if 0)  */
00037         hid_t nt,       /* HDF number type */
00038         int   rank,     /* number of dimensions (must be <= 3) */
00039         int32_t  d0,       /* size of 1st dimension */
00040         int32_t  d1,       /* size of 2nd dimension */
00041         int32_t  d2,       /* size of 3rd dimension */
00042         int32_t  d3,       /* size of 4th dimension */
00043         int32_t  d4,       /* size of 5th dimension */
00044         int32_t  d5,       /* size of 6t dimension  */
00045         const char *dn0,      /* name of 1st dimension */
00046         const char *dn1,      /* name of 2nd dimension */
00047         const char *dn2,      /* name of 3rd dimension */
00048         const char *dn3,      /* name of 4th dimension */
00049         const char *dn4,      /* name of 5th dimension */
00050         const char *dn5,      /* name of 6th dimension */
00051         hid_t plist     /* Dataset property list */
00052         );
00053   
00054   int CreateH5D(
00055         hid_t grp,      /* group id */
00056         const char *sname,    /* short name */
00057         const char *lname,    /* long name */
00058         const char *stdname,    /* standard name */
00059         const char *units,    /* units (not set if passed NULL or "") */
00060         double low,     /* low end of valid range */
00061         double high,    /* high end of range (no range set if low >= high) */
00062         float slope,    /* scale factor (not set if 0)  */
00063         float offset,   /* scaling offset (not set if 0)  */
00064         float fillvalue,/* fill value */
00065         hid_t nt,       /* HDF number type */
00066         int   rank,     /* number of dimensions (must be <= 3) */
00067         int32_t  d0,       /* size of 1st dimension */
00068         int32_t  d1,       /* size of 2nd dimension */
00069         int32_t  d2,       /* size of 3rd dimension */
00070         int32_t  d3,       /* size of 4th dimension */
00071         int32_t  d4,       /* size of 5th dimension */
00072         int32_t  d5,       /* size of 6th dimension */
00073         const char *dn0,      /* name of 1st dimension */
00074         const char *dn1,      /* name of 2nd dimension */
00075         const char *dn2,      /* name of 3rd dimension */
00076         const char *dn3,      /* name of 4th dimension */
00077         const char *dn4,      /* name of 5th dimension */
00078         const char *dn5,      /* name of 6th dimension */
00079         hid_t plist     /* Dataset property list */
00080         );
00081 
00082 
00083   int h5a_set(hid_t dataset, const char *nam, hid_t typ,
00084           hid_t cnt, VOIDP data);
00085   
00086   hid_t h5d_create(hid_t grp, const char *nam, hid_t typ,
00087            int rank, 
00088            hsize_t d0, hsize_t d1, hsize_t d2, 
00089            hsize_t d3, hsize_t d4, hsize_t d5, 
00090            hid_t *dataset, 
00091            hid_t *dataspace,
00092            hid_t plist);
00093 
00094   herr_t h5d_read(hid_t id, const char *name, VOIDP data, hsize_t rank,
00095           hsize_t s[6], hsize_t e[6]);
00096 
00097   herr_t h5d_write(hid_t id, const char *name, VOIDP data, hsize_t rank,
00098            hsize_t s[6], hsize_t e[6]);
00099 
00100   int SetScalarH5A(hid_t id, const char *name, hid_t type, const void *value);
00101 
00102 }
00103 #endif
00104