OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
h5gmcfdap.cc
Go to the documentation of this file.
1 // This file is part of hdf5_handler: an HDF5 file handler for the OPeNDAP
2 // data server.
3 
4 // Copyright (c) 2011-2013 The HDF Group, Inc. and OPeNDAP, Inc.
5 //
6 // This is free software; you can redistribute it and/or modify it under the
7 // terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 2.1 of the License, or (at your
9 // option) any later version.
10 //
11 // This software is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //
20 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
21 // You can contact The HDF Group, Inc. at 1800 South Oak Street,
22 // Suite 203, Champaign, IL 61820
23 
32 
33 #include <sys/types.h>
34 #include <sys/stat.h>
35 #include <fcntl.h>
36 #include <unistd.h>
37 #include <iostream>
38 #include <sstream>
39 
40 #include <BESDebug.h>
41 #include <InternalErr.h>
42 
43 #include "h5cfdaputil.h"
44 #include "h5gmcfdap.h"
45 #include "HDF5CFByte.h"
46 #include "HDF5CFUInt16.h"
47 #include "HDF5CFInt16.h"
48 #include "HDF5CFUInt32.h"
49 #include "HDF5CFInt32.h"
50 #include "HDF5CFFloat32.h"
51 #include "HDF5CFFloat64.h"
52 #include "HDF5CFStr.h"
53 #include "HDF5CFArray.h"
54 #include "HDF5GMCFMissLLArray.h"
55 #include "HDF5GMCFFillIndexArray.h"
57 #include "HDF5GMCFSpecialCVArray.h"
58 #include "HDF5GMSPCFArray.h"
59 
60 using namespace HDF5CF;
61 
62 void map_gmh5_cfdds(DDS &dds, hid_t file_id, const string& filename){
63 
64  BESDEBUG("h5","Coming to GM products DDS mapping function map_gmh5_cfdds "<<endl);
65  string check_objnameclashing_key ="H5.EnableCheckNameClashing";
66  bool is_check_nameclashing = false;
67  is_check_nameclashing = HDF5CFDAPUtil::check_beskeys(check_objnameclashing_key);
68 
69  H5GCFProduct product_type = check_product(file_id);
70 
71  GMPattern gproduct_pattern = OTHERGMS;
72 
73  GMFile * f = NULL;
74 
75  try {
76  f = new GMFile(filename.c_str(),file_id,product_type,gproduct_pattern);
77  }
78  catch(...) {
79  throw InternalErr(__FILE__,__LINE__,"Cannot allocate memory for GMFile ");
80  }
81  // Generally don't need to handle attributes when handling DDS.
82  bool include_attr = false;
83  try {
84  // Retrieve all HDF5 info(Not the values)
85  f->Retrieve_H5_Info(filename.c_str(),file_id,include_attr);
86 
87  // Need to add dimension names.
88  f->Add_Dim_Name();
89 
90  // Handle coordinate variables
91  f->Handle_CVar();
92 
93  // Handle special variables
94  f->Handle_SpVar();
95 
96  // Handle unsupported datatypes
97  f->Handle_Unsupported_Dtype(include_attr);
98 
99  // Handle unsupported dataspaces
101 
102 
103  // Adjust object names(may remove redundant paths)
104 
105  f->Adjust_Obj_Name();
106 
107  // Flatten the object names
108  f->Flatten_Obj_Name(include_attr);
109 
110  // Handle Object name clashings
111  // Only when the check_nameclashing key is turned on or
112  // general product.
113  if(General_Product == product_type ||
114  true == is_check_nameclashing)
115  f->Handle_Obj_NameClashing(include_attr);
116 
117  // Adjust Dimension name
118  f->Adjust_Dim_Name();
119  if(General_Product == product_type ||
120  true == is_check_nameclashing)
122  }
123  catch (HDF5CF::Exception &e){
124  if (f != NULL)
125  delete f;
126  throw InternalErr(e.what());
127  }
128 
129 
130  // generate DDS.
131  try {
132  gen_gmh5_cfdds(dds,f);
133  }
134  catch(...) {
135  if (f != NULL)
136  delete f;
137  throw;
138  }
139 
140  if (f != NULL)
141  delete f;
142 }
143 
144 void map_gmh5_cfdas(DAS &das, hid_t file_id, const string& filename){
145 
146  BESDEBUG("h5","Coming to GM products DAS mapping function map_gmh5_cfdas "<<endl);
147  string check_objnameclashing_key ="H5.EnableCheckNameClashing";
148  bool is_check_nameclashing = false;
149  is_check_nameclashing = HDF5CFDAPUtil::check_beskeys(check_objnameclashing_key);
150 
151  // if(is_check_nameclashing) cerr<<"checking name clashing "<<endl;
152 
153  string add_path_attrs_key = "H5.EnableAddPathAttrs";
154  bool is_add_path_attrs = false;
155  is_add_path_attrs = HDF5CFDAPUtil::check_beskeys(add_path_attrs_key);
156 
157  // if(is_add_path_attrs) cerr<<"adding attributes "<<endl;
158 
159  H5GCFProduct product_type = check_product(file_id);
160  GMPattern gproduct_pattern = OTHERGMS;
161 
162  GMFile *f = NULL;
163 
164  try {
165  f = new GMFile(filename.c_str(),file_id,product_type,gproduct_pattern);
166  }
167  catch(...) {
168  throw InternalErr(__FILE__,__LINE__,"Cannot allocate memory for GMFile ");
169  }
170 
171  bool include_attr = true;
172  try {
173  f->Retrieve_H5_Info(filename.c_str(),file_id,include_attr);
174  f->Add_Dim_Name();
175  f->Handle_CVar();
176  f->Handle_SpVar();
177  f->Handle_Unsupported_Dtype(include_attr);
178 
179  // Remove unsupported dataspace
181 
182 
183  // Need to retrieve the attribute values to feed DAS
185 
186  // Need to add original variable name and path
187  // and other special attributes
188  // Can be turned on/off by using the check_path_attrs keys.
189  f->Add_Supplement_Attrs(is_add_path_attrs);
190  f->Adjust_Obj_Name();
191  f->Flatten_Obj_Name(include_attr);
192  if(General_Product == product_type ||
193  true == is_check_nameclashing)
194  f->Handle_Obj_NameClashing(include_attr);
195 
196  // Handle the "coordinate" attributes.
197  f->Handle_Coor_Attr();
198  }
199  catch (HDF5CF::Exception &e){
200  if (f!= NULL)
201  delete f;
202  throw InternalErr(e.what());
203  }
204 
205  // Generate the DAS attributes.
206  try {
207  gen_gmh5_cfdas(das,f);
208  }
209  catch (...) {
210  if (f!= NULL)
211  delete f;
212  throw;
213 
214  }
215 
216  if (f != NULL)
217  delete f;
218 }
219 
220 void gen_gmh5_cfdds( DDS & dds, HDF5CF:: GMFile *f) {
221 
222  BESDEBUG("h5","Coming to GM DDS generation function gen_gmh5_cfdds "<<endl);
223  // cerr <<"coming to gen_gmh5_cfdds "<<endl;
224  const vector<HDF5CF::Var *>& vars = f->getVars();
225  const vector<HDF5CF::GMCVar *>& cvars = f->getCVars();
226  const vector<HDF5CF::GMSPVar *>& spvars = f->getSPVars();
227  const string filename = f->getPath();
228  const hid_t fileid = f->getFileID();
229 
230  // Read Variable info.
231 
232  vector<HDF5CF::Var *>::const_iterator it_v;
233  vector<HDF5CF::GMCVar *>::const_iterator it_cv;
234  vector<HDF5CF::GMSPVar *>::const_iterator it_spv;
235 
236  for (it_v = vars.begin(); it_v !=vars.end();++it_v) {
237  // cerr <<"variable full path= "<< (*it_v)->getFullPath() <<endl;
238  gen_dap_onevar_dds(dds,*it_v,fileid, filename);
239  }
240  for (it_cv = cvars.begin(); it_cv !=cvars.end();++it_cv) {
241  // cerr <<"variable full path= "<< (*it_cv)->getFullPath() <<endl;
242  gen_dap_onegmcvar_dds(dds,*it_cv,fileid, filename);
243  }
244 
245  for (it_spv = spvars.begin(); it_spv !=spvars.end();it_spv++) {
246  // cerr <<"variable full path= "<< (*it_spv)->getFullPath() <<endl;
247  gen_dap_onegmspvar_dds(dds,*it_spv,fileid, filename);
248  }
249 
250 }
251 
252 void gen_gmh5_cfdas( DAS & das, HDF5CF:: GMFile *f) {
253 
254  BESDEBUG("h5","Coming to GM DAS generation function gen_gmh5_cfdas "<<endl);
255  // cerr <<"coming to gen_gmh5_cfdas "<<endl;
256 
257  const vector<HDF5CF::Var *>& vars = f->getVars();
258  const vector<HDF5CF::GMCVar *>& cvars = f->getCVars();
259  const vector<HDF5CF::GMSPVar *>& spvars = f->getSPVars();
260  const vector<HDF5CF::Group *>& grps = f->getGroups();
261  const vector<HDF5CF::Attribute *>& root_attrs = f->getAttributes();
262 
263 
264  vector<HDF5CF::Var *>::const_iterator it_v;
265  vector<HDF5CF::GMCVar *>::const_iterator it_cv;
266  vector<HDF5CF::GMSPVar *>::const_iterator it_spv;
267  vector<HDF5CF::Group *>::const_iterator it_g;
268  vector<HDF5CF::Attribute *>::const_iterator it_ra;
269 
270  // Handling the file attributes(attributes under the root group)
271  // The table name is "HDF_GLOBAL".
272 
273  if (false == root_attrs.empty()) {
274 
275  AttrTable *at = das.get_table(FILE_ATTR_TABLE_NAME);
276  if (NULL == at)
277  at = das.add_table(FILE_ATTR_TABLE_NAME, new AttrTable);
278 
279  for (it_ra = root_attrs.begin(); it_ra != root_attrs.end(); ++it_ra) {
280  gen_dap_oneobj_das(at,*it_ra,NULL);
281  }
282  }
283 
284  if (false == grps.empty()) {
285  for (it_g = grps.begin();
286  it_g != grps.end(); ++it_g) {
287  AttrTable *at = das.get_table((*it_g)->getNewName());
288  if (NULL == at)
289  at = das.add_table((*it_g)->getNewName(), new AttrTable);
290 
291  for (it_ra = (*it_g)->getAttributes().begin();
292  it_ra != (*it_g)->getAttributes().end(); ++it_ra) {
293  gen_dap_oneobj_das(at,*it_ra,NULL);
294  }
295  }
296  }
297 
298  for (it_v = vars.begin();
299  it_v != vars.end(); ++it_v) {
300  if (false == ((*it_v)->getAttributes().empty())) {
301 
302  AttrTable *at = das.get_table((*it_v)->getNewName());
303  if (NULL == at)
304  at = das.add_table((*it_v)->getNewName(), new AttrTable);
305 
306  for (it_ra = (*it_v)->getAttributes().begin();
307  it_ra != (*it_v)->getAttributes().end(); ++it_ra)
308  gen_dap_oneobj_das(at,*it_ra,*it_v);
309 
310  }
311 
312  if(GPMS_L3 == f->getProductType() || GPMM_L3 == f->getProductType()
313  || GPM_L1 == f->getProductType())
314  update_GPM_special_attrs(das,*it_v);
315 
316  }
317 
318  for (it_cv = cvars.begin();
319  it_cv != cvars.end(); ++it_cv) {
320  if (false == ((*it_cv)->getAttributes().empty())) {
321 
322  AttrTable *at = das.get_table((*it_cv)->getNewName());
323  if (NULL == at)
324  at = das.add_table((*it_cv)->getNewName(), new AttrTable);
325 
326  for (it_ra = (*it_cv)->getAttributes().begin();
327  it_ra != (*it_cv)->getAttributes().end(); ++it_ra){
328  gen_dap_oneobj_das(at,*it_ra,*it_cv);
329  }
330 
331  }
332  }
333  for (it_spv = spvars.begin();
334  it_spv != spvars.end(); ++it_spv) {
335  if (false == ((*it_spv)->getAttributes().empty())) {
336 
337  AttrTable *at = das.get_table((*it_spv)->getNewName());
338  if (NULL == at)
339  at = das.add_table((*it_spv)->getNewName(), new AttrTable);
340  // cerr<<"spv coordinate variable name "<<(*it_spv)->getNewName() <<endl;
341 
342  for (it_ra = (*it_spv)->getAttributes().begin();
343  it_ra != (*it_spv)->getAttributes().end(); ++it_ra)
344  gen_dap_oneobj_das(at,*it_ra,*it_spv);
345  }
346  }
347 
348  // cerr<<"end of gen_gmh5_cfdas "<<endl;
349 }
350 
351 
352 void gen_dap_onegmcvar_dds(DDS &dds,const HDF5CF::GMCVar* cvar, const hid_t file_id, const string & filename) {
353 
354  BaseType *bt = NULL;
355 
356  switch(cvar->getType()) {
357 #define HANDLE_CASE(tid,type) \
358  case tid: \
359  bt = new (type)(cvar->getNewName(),cvar->getFullPath()); \
360  break;
361 
370  HANDLE_CASE(H5FSTRING, Str);
371  HANDLE_CASE(H5VSTRING, Str);
372 
373  default:
374  throw InternalErr(__FILE__,__LINE__,"unsupported data type.");
375 #undef HANDLE_CASE
376  }
377 
378  if (bt) {
379 
380  const vector<HDF5CF::Dimension *>& dims = cvar->getDimensions();
381  vector <HDF5CF::Dimension*>:: const_iterator it_d;
382 
383  switch(cvar->getCVType()) {
384 
385  case CV_EXIST:
386  {
387  HDF5CFArray *ar = NULL;
388 
389  try {
390  ar = new HDF5CFArray (
391  cvar->getRank(),
392  file_id,
393  filename,
394  cvar->getType(),
395  cvar->getFullPath(),
396  cvar->getNewName(),
397  bt);
398  }
399  catch(...) {
400  delete bt;
401  throw InternalErr(__FILE__,__LINE__,"Unable to allocate HDF5CFArray. ");
402  }
403 
404  for(it_d = dims.begin(); it_d != dims.end(); ++it_d) {
405  if (""==(*it_d)->getNewName())
406  ar->append_dim((*it_d)->getSize());
407  else
408  ar->append_dim((*it_d)->getSize(), (*it_d)->getNewName());
409  }
410 
411  dds.add_var(ar);
412  delete bt;
413  delete ar;
414  }
415  break;
416 
417  case CV_LAT_MISS:
418  case CV_LON_MISS:
419  {
420  // Using HDF5GMCFMissLLArray
422  try {
423  ar = new HDF5GMCFMissLLArray (
424  cvar->getRank(),
425  filename,
426  file_id,
427  cvar->getType(),
428  cvar->getFullPath(),
429  cvar->getPtType(),
430  cvar->getCVType(),
431  cvar->getNewName(),
432  bt);
433  }
434  catch(...) {
435  delete bt;
436  throw InternalErr(__FILE__,__LINE__,"Unable to allocate HDF5GMCFMissLLArray. ");
437  }
438 
439 
440  for(it_d = dims.begin(); it_d != dims.end(); ++it_d) {
441  if (""==(*it_d)->getNewName())
442  ar->append_dim((*it_d)->getSize());
443  else
444  ar->append_dim((*it_d)->getSize(), (*it_d)->getNewName());
445  }
446 
447  dds.add_var(ar);
448  delete bt;
449  delete ar;
450  }
451  break;
452 
453  case CV_NONLATLON_MISS:
454  {
455 
456  if (cvar->getRank() !=1) {
457  delete bt;
458  throw InternalErr(__FILE__, __LINE__, "The rank of missing Z dimension field must be 1");
459  }
460  int nelem = (cvar->getDimensions()[0])->getSize();
461 
463 
464  try {
465  ar = new HDF5GMCFMissNonLLCVArray(
466  cvar->getRank(),
467  nelem,
468  cvar->getNewName(),
469  bt);
470  }
471  catch(...) {
472  delete bt;
473  throw InternalErr(__FILE__,__LINE__,"Unable to allocate HDF5GMCFMissNonLLCVArray. ");
474  }
475 
476 
477  for(it_d = dims.begin(); it_d != dims.end(); ++it_d) {
478  if (""==(*it_d)->getNewName())
479  ar->append_dim((*it_d)->getSize());
480  else
481  ar->append_dim((*it_d)->getSize(), (*it_d)->getNewName());
482  }
483  dds.add_var(ar);
484  delete bt;
485  delete ar;
486  }
487  break;
488 
489  case CV_FILLINDEX:
490  {
491 
492  if (cvar->getRank() !=1) {
493  delete bt;
494  throw InternalErr(__FILE__, __LINE__, "The rank of missing Z dimension field must be 1");
495  }
496 
498 
499  try {
500  ar = new HDF5GMCFFillIndexArray(
501  cvar->getRank(),
502  cvar->getType(),
503  cvar->getNewName(),
504  bt);
505  }
506  catch(...) {
507  delete bt;
508  throw InternalErr(__FILE__,__LINE__,"Unable to allocate HDF5GMCFMissNonLLCVArray. ");
509  }
510 
511 
512  for(it_d = dims.begin(); it_d != dims.end(); ++it_d) {
513  if (""==(*it_d)->getNewName())
514  ar->append_dim((*it_d)->getSize());
515  else
516  ar->append_dim((*it_d)->getSize(), (*it_d)->getNewName());
517  }
518  dds.add_var(ar);
519  delete bt;
520  delete ar;
521  }
522  break;
523 
524 
525  case CV_SPECIAL:
526  {
527  // Currently only handle 1-D special CV.
528  if (cvar->getRank() !=1) {
529  delete bt;
530  throw InternalErr(__FILE__, __LINE__, "The rank of special coordinate variable must be 1");
531  }
532  int nelem = (cvar->getDimensions()[0])->getSize();
533 
535  ar = new HDF5GMCFSpecialCVArray(
536  cvar->getType(),
537  nelem,
538  cvar->getFullPath(),
539  cvar->getPtType(),
540  cvar->getNewName(),
541  bt);
542 
543  for(it_d = dims.begin(); it_d != dims.end(); ++it_d) {
544  if (""==(*it_d)->getNewName())
545  ar->append_dim((*it_d)->getSize());
546  else
547  ar->append_dim((*it_d)->getSize(), (*it_d)->getNewName());
548  }
549 
550  dds.add_var(ar);
551  delete ar;
552 
553  }
554  break;
555  case CV_MODIFY:
556  default:
557  delete bt;
558  throw InternalErr(__FILE__,__LINE__,"Coordinate variable type is not supported.");
559  }
560  }
561 }
562 
563 void gen_dap_onegmspvar_dds(DDS &dds,const HDF5CF::GMSPVar* spvar, const hid_t fileid, const string & filename) {
564 
565  BaseType *bt = NULL;
566 
567  switch(spvar->getType()) {
568 #define HANDLE_CASE(tid,type) \
569  case tid: \
570  bt = new (type)(spvar->getNewName(),spvar->getFullPath()); \
571  break;
572 
581  HANDLE_CASE(H5FSTRING, Str);
582  HANDLE_CASE(H5VSTRING, Str);
583  default:
584  throw InternalErr(__FILE__,__LINE__,"unsupported data type.");
585 #undef HANDLE_CASE
586  }
587 
588  if (bt) {
589 
590  const vector<HDF5CF::Dimension *>& dims = spvar->getDimensions();
591  vector <HDF5CF::Dimension*>:: const_iterator it_d;
592 
593  HDF5GMSPCFArray *ar = NULL;
594 
595  try {
596  ar = new HDF5GMSPCFArray (
597  spvar->getRank(),
598  filename,
599  fileid,
600  spvar->getType(),
601  spvar->getFullPath(),
602  spvar->getOriginalType(),
603  spvar->getStartBit(),
604  spvar->getBitNum(),
605  spvar->getNewName(),
606  bt);
607  }
608  catch(...) {
609  delete bt;
610  throw InternalErr(__FILE__,__LINE__,"Unable to allocate HDF5GMCFMissNonLLCVArray. ");
611  }
612 
613 
614  for(it_d = dims.begin(); it_d != dims.end(); ++it_d) {
615  if (""==(*it_d)->getNewName())
616  ar->append_dim((*it_d)->getSize());
617  else
618  ar->append_dim((*it_d)->getSize(), (*it_d)->getNewName());
619  }
620 
621  dds.add_var(ar);
622  delete bt;
623  delete ar;
624  }
625 
626 }
627 
628 // When we add floating point fill value at HDF5CF.cc, the value will be changed
629 // a little bit when it changes to string representation.
630 // For example, -9999.9 becomes -9999.9000123. To reduce the misunderstanding,we
631 // just add fillvalue in the string type here. KY 2014-04-02
632 void update_GPM_special_attrs(DAS& das, const HDF5CF::Var *var) {
633 
634  if(H5FLOAT64 == var->getType() ||
635  H5FLOAT32 == var->getType() ||
636  H5INT16 == var->getType() ||
637  H5CHAR == var->getType()) {
638 
639  AttrTable *at = das.get_table(var->getNewName());
640  if (NULL == at)
641  at = das.add_table(var->getNewName(), new AttrTable);
642  bool has_fillvalue = false;
643  AttrTable::Attr_iter it = at->attr_begin();
644  while (it!=at->attr_end() && false==has_fillvalue) {
645  if (at->get_name(it) =="_FillValue")
646  {
647  has_fillvalue = true;
648  string fillvalue ="";
649  if(H5FLOAT32 == var->getType()) {
650  const string cor_fill_value = "-9999.9";
651  fillvalue = (*at->get_attr_vector(it)->begin());
652  if((fillvalue.find(cor_fill_value) == 0) && (fillvalue!= cor_fill_value)) {
653  at->del_attr("_FillValue");
654  at->append_attr("_FillValue","Float32",cor_fill_value);
655  }
656  }
657  else if(H5FLOAT64 == var->getType()) {
658  const string cor_fill_value = "-9999.9";
659  const string exist_fill_value_substr = "-9999.8999";
660  fillvalue = (*at->get_attr_vector(it)->begin());
661  if((fillvalue.find(exist_fill_value_substr) == 0) && (fillvalue!= cor_fill_value)) {
662  at->del_attr("_FillValue");
663  at->append_attr("_FillValue","Float64",cor_fill_value);
664  }
665 
666  }
667  }
668  it++;
669  }
670 
671  // Add the fill value
672  if (has_fillvalue != true ) {
673 
674  if(H5FLOAT32 == var->getType())
675  at->append_attr("_FillValue","Float32","-9999.9");
676  else if(H5FLOAT64 == var->getType())
677  at->append_attr("_FillValue","Float64","-9999.9");
678  else if (H5INT16 == var->getType())
679  at->append_attr("_FillValue","Int16","-9999");
680  else if (H5CHAR == var->getType())// H5CHAR maps to DAP int16
681  at->append_attr("_FillValue","Int16","-99");
682 
683  }
684  }
685 }
686 
687 
This class provides a way to map HDF5 Str to DAP Str for the CF option.
Definition: HDF5CF.h:60
void Flatten_Obj_Name(bool include_attr)
Flatten the object name for general NASA HDF5 products.
Definition: HDF5GMCF.cc:1860
This class specifies the retrieval of the missing lat/lon values for general HDF5 products...
void Handle_SpVar()
Handle special variables for general NASA HDF5 products.
Definition: HDF5GMCF.cc:1697
const string & getFullPath() const
Get the full path of this variable.
Definition: HDF5CF.h:279
const vector< GMCVar * > & getCVars() const
Definition: HDF5CF.h:671
This class represents one HDF5 dataset(CF variable)
Definition: HDF5CF.h:251
void Handle_Coor_Attr()
Handle "coordinates" attributes for general HDF5 products.
Definition: HDF5GMCF.cc:2618
void Handle_CVar()
Handle coordinate variables for general NASA HDF5 products.
Definition: HDF5GMCF.cc:1197
int getRank() const
Get the dimension rank of this variable.
Definition: HDF5CF.h:285
void Handle_DimNameClashing()
Handle dimension name clashing. Since COARDS requires the change of cv names, So we need to handle di...
Definition: HDF5GMCF.cc:2011
void map_gmh5_cfdds(DDS &dds, hid_t file_id, const string &filename)
Definition: h5gmcfdap.cc:62
void Add_Dim_Name()
Add dimension name.
Definition: HDF5GMCF.cc:278
int getBitNum() const
Definition: HDF5CF.h:372
This class provides a way to map HDF5 unsigned 16-bit integer to DAP uint16 for the CF option...
void gen_dap_onegmcvar_dds(DDS &dds, const HDF5CF::GMCVar *cvar, const hid_t file_id, const string &filename)
Definition: h5gmcfdap.cc:352
void Handle_Obj_NameClashing(bool)
Handle object name clashing for general NASA HDF5 products.
Definition: HDF5GMCF.cc:1914
GMPattern
Definition: HDF5CF.h:55
This class provides a way to map HDF5 float to DAP float for the CF option.
This class is a derived class of Var. It represents a special general HDF5 product(currently ACOS) ...
Definition: HDF5CF.h:355
void gen_dap_onegmspvar_dds(DDS &dds, const HDF5CF::GMSPVar *spvar, const hid_t fileid, const string &filename)
Definition: h5gmcfdap.cc:563
This class is a derived class of CVar. It represents a coordinate variable for general HDF5 files...
Definition: HDF5CF.h:386
static bool check_beskeys(const string key)
Definition: h5cfdaputil.cc:39
const vector< Attribute * > & getAttributes() const
Public interface to obtain information of all attributes under the root group.
Definition: HDF5CF.h:578
This class specifies the retrieval of the missing lat/lon values for general HDF5 products...
This class provides a way to map HDF5 int16 to DAP int16 for the CF option.
void gen_dap_oneobj_das(AttrTable *at, const HDF5CF::Attribute *attr, const HDF5CF::Var *var)
void update_GPM_special_attrs(DAS &das, const HDF5CF::Var *var)
Definition: h5gmcfdap.cc:632
Map and generate DDS and DAS for the CF option for generic HDF5 products.
This class provides a way to map HDF5 64-bit floating-point(double) to DAP 64-bit floating-point for ...
H5DataType getOriginalType() const
Definition: HDF5CF.h:364
int getStartBit() const
Definition: HDF5CF.h:368
H5GCFProduct
#define NULL
Definition: wcsUtil.h:65
H5DataType getType() const
Get the data type of this variable(Not HDF5 datatype id)
Definition: HDF5CF.h:291
This class is a derived class of File. It includes methods applied to general HDF5 files only...
Definition: HDF5CF.h:662
const vector< GMSPVar * > & getSPVars() const
Definition: HDF5CF.h:675
void map_gmh5_cfdas(DAS &das, hid_t file_id, const string &filename)
Definition: h5gmcfdap.cc:144
void Retrieve_H5_Supported_Attr_Values()
Retrieve attribute values for the supported HDF5 datatypes for general HDF5 products.
Definition: HDF5GMCF.cc:152
void Adjust_Dim_Name()
Adjust dimension name for general NASA HDF5 products.
Definition: HDF5GMCF.cc:2078
This class specifies the retrieval of data values for special HDF5 products Currently this only appli...
void Handle_Unsupported_Dtype(bool)
Handle unsupported HDF5 datatypes for general HDF5 products.
Definition: HDF5GMCF.cc:194
CVType getCVType() const
Get the coordinate variable type of this variable.
Definition: HDF5CF.h:337
const hid_t getFileID() const
Obtain the HDF5 file ID.
Definition: HDF5CF.h:559
H5GCFProduct getPtType() const
Get the data type of this variable.
Definition: HDF5CF.h:393
const string & getNewName() const
Get the new name of this variable.
Definition: HDF5CF.h:273
#define HANDLE_CASE(tid, type)
const string & getPath() const
Obtain the path of the file.
Definition: HDF5CF.h:566
This class provides a way to map HDF5 32-bit integer to DAP Int32 for the CF option.
This class includes the methods to read data array into DAP buffer from an HDF5 dataset for the CF op...
const vector< Dimension * > & getDimensions() const
Get the list of the dimensions.
Definition: HDF5CF.h:302
void Handle_Unsupported_Dspace()
Handle unsupported HDF5 dataspaces for general HDF5 products.
Definition: HDF5GMCF.cc:246
Helper functions for generating DAS attributes and a function to check BES Key.
This class provides a way to map HDF5 unsigned 32-bit integer to DAP uint32 for the CF option...
void gen_gmh5_cfdas(DAS &das, HDF5CF::GMFile *f)
Definition: h5gmcfdap.cc:252
const vector< Var * > & getVars() const
Public interface to obtain information of all variables.
Definition: HDF5CF.h:572
virtual const char * what() const
Definition: HDF5CF.h:79
const vector< Group * > & getGroups() const
Public interface to obtain all the group info.
Definition: HDF5CF.h:584
void Adjust_Obj_Name()
Adjust object names based on different general NASA HDF5 products.
Definition: HDF5GMCF.cc:1777
This class specifies the retrieval of the values of non-lat/lon coordinate variables for general HDF5...
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
Definition: BESDebug.h:64
void gen_dap_onevar_dds(DDS &dds, const HDF5CF::Var *var, const hid_t file_id, const string &filename)
This class provides a way to map HDF5 byte to DAP byte for the CF option.
void gen_gmh5_cfdds(DDS &dds, HDF5CF::GMFile *f)
Definition: h5gmcfdap.cc:220
This class includes the methods to read data array into DAP buffer from an HDF5 dataset for the CF op...
H5GCFProduct check_product(hid_t file_id)
H5GCFProduct getProductType() const
Definition: HDF5CF.h:667
void Add_Supplement_Attrs(bool)
Add supplemental attributes such as fullpath and original name for general NASA HDF5 products...
Definition: HDF5GMCF.cc:2132
void Retrieve_H5_Info(const char *path, hid_t file_id, bool include_attr)
Retrieve DDS information from the HDF5 file; real implementation for general HDF5 products...
Definition: HDF5GMCF.cc:138