OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
hdf5utils.h
Go to the documentation of this file.
1 //-*- Mode: C++; -*-
2 
3 #ifndef HDF5UTILS_H
4 #define HDF5UTILS_H
5 
6 #include <sstream>
7 
8 using namespace std;
9 
10 #include "hdf5.h"
11 //#define VOIDP (void*)
12 
13 #define DIFF1980_1970 315532800
14 #define DIFFJAN0680_1970 (315532800 + 432000)
15 #define DIFF2000_1980 631152000
16 #define DIFF2000_JAN0680 (631152000 - 432000)
17 
18 int32_t get_millisec(string *ydhmsf_str);
19 double get_tai(int32_t year, int32_t doy, double millisec);
20 double get_tai(char *orbString);
21 double gpstai2utc2000(double gpstai);
22 double gpstai2unix(double gpstai);
23 double unix2gpstai(double unixtime);
24 
25 
26 namespace Hdf {
27 
28 int CreateH5D(
29  hid_t grp, /* group id */
30  const char *sname, /* short name */
31  const char *lname, /* long name */
32  const char *units, /* units (not set if passed NULL or "") */
33  double low, /* low end of valid range */
34  double high, /* high end of range (no range set if low >= high) */
35  float slope, /* scale factor (not set if 0) */
36  float offset, /* scaling offset (not set if 0) */
37  hid_t nt, /* HDF number type */
38  int rank, /* number of dimensions (must be <= 3) */
39  int32_t d0, /* size of 1st dimension */
40  int32_t d1, /* size of 2nd dimension */
41  int32_t d2, /* size of 3rd dimension */
42  int32_t d3, /* size of 4th dimension */
43  int32_t d4, /* size of 5th dimension */
44  int32_t d5, /* size of 6t dimension */
45  const char *dn0, /* name of 1st dimension */
46  const char *dn1, /* name of 2nd dimension */
47  const char *dn2, /* name of 3rd dimension */
48  const char *dn3, /* name of 4th dimension */
49  const char *dn4, /* name of 5th dimension */
50  const char *dn5, /* name of 6th dimension */
51  hid_t plist /* Dataset property list */
52  );
53 
54 int CreateH5D(
55  hid_t grp, /* group id */
56  const char *sname, /* short name */
57  const char *lname, /* long name */
58  const char *stdname, /* standard name */
59  const char *units, /* units (not set if passed NULL or "") */
60  double low, /* low end of valid range */
61  double high, /* high end of range (no range set if low >= high) */
62  float slope, /* scale factor (not set if 0) */
63  float offset, /* scaling offset (not set if 0) */
64  float fillvalue, /* fill value */
65  hid_t nt, /* HDF number type */
66  int rank, /* number of dimensions (must be <= 3) */
67  int32_t d0, /* size of 1st dimension */
68  int32_t d1, /* size of 2nd dimension */
69  int32_t d2, /* size of 3rd dimension */
70  int32_t d3, /* size of 4th dimension */
71  int32_t d4, /* size of 5th dimension */
72  int32_t d5, /* size of 6th dimension */
73  const char *dn0, /* name of 1st dimension */
74  const char *dn1, /* name of 2nd dimension */
75  const char *dn2, /* name of 3rd dimension */
76  const char *dn3, /* name of 4th dimension */
77  const char *dn4, /* name of 5th dimension */
78  const char *dn5, /* name of 6th dimension */
79  hid_t plist /* Dataset property list */
80  );
81 
82 
83 int h5a_set(hid_t dataset, const char *nam, hid_t typ,
84  hid_t cnt, void* data);
85 
86 hid_t h5d_create(hid_t grp, const char *nam, hid_t typ,
87  int rank,
88  hsize_t d0, hsize_t d1, hsize_t d2,
89  hsize_t d3, hsize_t d4, hsize_t d5,
90  hid_t *dataset,
91  hid_t *dataspace,
92  hid_t plist);
93 
94 herr_t h5d_read(hid_t id, const char *name, void* data, hsize_t rank,
95  hsize_t s[6], hsize_t e[6]);
96 
97 herr_t h5d_write(hid_t id, const char *name, void* data, hsize_t rank,
98  hsize_t s[6], hsize_t e[6]);
99 
100 int SetScalarH5A(hid_t id, const char *name, hid_t type, const void *value);
101 
102 }
103 #endif
104 
int32 value
Definition: Granule.c:1235
Definition: bin_io.cpp:23
double unix2gpstai(double unixtime)
hid_t h5d_create(hid_t grp, const char *nam, hid_t typ, int rank, hsize_t d0, hsize_t d1, hsize_t d2, hsize_t d3, hsize_t d4, hsize_t d5, hid_t *dataset, hid_t *dataspace, hid_t plist)
Definition: hdf5util.cpp:129
int32_t get_millisec(string *ydhmsf_str)
Definition: hdf5util.cpp:19
double gpstai2utc2000(double gpstai)
float32 slope[]
Definition: l2lists.h:30
but the philosophy of the MODIS L1 routines is that the output granule must be if it contains even a single packet of useable data Some of the spacecraft ancillary data in L0 datasets is available only on a cycle that repeates every seconds MOD_PR01 therefore looks backwards up to for such packets If the seconds preceeding the start of an MOD_PR01 run are covered by a different L0 dataset
Definition: MOD_PR01_pr.txt:33
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude data
Definition: HISTORY.txt:356
double get_tai(int32_t year, int32_t doy, double millisec)
Extra metadata that will be written to the HDF4 file l2prod rank
herr_t h5d_write(hid_t id, const char *name, void *data, hsize_t rank, hsize_t s[6], hsize_t e[6])
Definition: hdf5util.cpp:365
data_t s[NROOTS]
Definition: decode_rs.h:75
l2prod offset
double gpstai2unix(double gpstai)
herr_t h5d_read(hid_t id, const char *name, void *data, hsize_t rank, hsize_t s[6], hsize_t e[6])
Definition: hdf5util.cpp:427
int CreateH5D(hid_t grp, const char *sname, const char *lname, const char *units, double low, double high, float slope, float offset, hid_t nt, int rank, int32_t d0, int32_t d1, int32_t d2, int32_t d3, int32_t d4, int32_t d5, const char *dn0, const char *dn1, const char *dn2, const char *dn3, const char *dn4, const char *dn5, hid_t plist)
Definition: hdf5util.cpp:181
int SetScalarH5A(hid_t id, const char *name, hid_t type, const void *value)
Definition: hdf5util.cpp:166
int h5a_set(hid_t dataset, const char *nam, hid_t typ, hid_t cnt, void *data)
Definition: hdf5util.cpp:41