50 for (vector<Attribute*>::iterator ira = var->
attrs.begin();
51 ira!=var->
attrs.end(); ++ira) {
53 attr->
name = (*ira)->name;
54 attr->
newname = (*ira)->newname;
55 attr->
dtype =(*ira)->dtype;
56 attr->
count =(*ira)->count;
57 attr->
strsize = (*ira)->strsize;
59 attr->
value =(*ira)->value;
60 attrs.push_back(attr);
63 for (vector<Dimension*>::iterator ird = var->
dims.begin();
64 ird!=var->
dims.end(); ++ird) {
68 dim->
name = (*ird)->name;
82 for (vector<Attribute*>::iterator ira = var->
attrs.begin();
83 ira!=var->
attrs.end(); ++ira) {
85 attr->
name = (*ira)->name;
86 attr->
newname = (*ira)->newname;
87 attr->
dtype =(*ira)->dtype;
88 attr->
count =(*ira)->count;
89 attr->
strsize = (*ira)->strsize;
91 attr->
value =(*ira)->value;
92 attrs.push_back(attr);
95 for (vector<Dimension*>::iterator ird = var->
dims.begin();
96 ird!=var->
dims.end(); ++ird) {
98 dim->
name = (*ird)->name;
106 File(path,file_id), product_type(product_type),gproduct_pattern(gproduct_pattern),iscoard(false)
114 if (!this->cvars.empty()){
115 for (vector<GMCVar *>:: const_iterator i= this->cvars.begin(); i!=this->cvars.end(); ++i) {
120 if (!this->spvars.empty()){
121 for (vector<GMSPVar *>:: const_iterator i= this->spvars.begin(); i!=this->spvars.end(); ++i) {
139 hid_t file_id,
bool include_attr)
throw (
Exception) {
155 for (vector<GMCVar *>::iterator ircv = this->cvars.begin();
156 ircv != this->cvars.end(); ++ircv) {
161 for (vector<Attribute *>::iterator ira = (*ircv)->attrs.begin();
162 ira != (*ircv)->attrs.end(); ++ira) {
167 for (vector<GMSPVar *>::iterator irspv = this->spvars.begin();
168 irspv != this->spvars.end(); ++irspv) {
170 for (vector<Attribute *>::iterator ira = (*irspv)->attrs.begin();
171 ira != (*irspv)->attrs.end(); ++ira) {
181 if ((
"Type" == attr->name) && (
H5VSTRING == attr->dtype)) {
182 string orig_attrvalues(attr->value.begin(),attr->value.end());
183 if (orig_attrvalues !=
"Signed64")
return;
184 string new_attrvalues =
"Signed32";
188 attr->value.resize(new_attrvalues.size());
189 copy(new_attrvalues.begin(),new_attrvalues.end(),attr->value.begin());
197 for (vector<GMCVar *>::iterator ircv = this->cvars.begin();
198 ircv != this->cvars.end(); ++ircv) {
199 if (
true == include_attr) {
200 for (vector<Attribute *>::iterator ira = (*ircv)->attrs.begin();
201 ira != (*ircv)->attrs.end(); ++ira) {
205 (*ircv)->attrs.erase(ira);
219 this->cvars.erase(ircv);
223 for (vector<GMSPVar *>::iterator ircv = this->spvars.begin();
224 ircv != this->spvars.end(); ++ircv) {
226 if (
true == include_attr) {
227 for (vector<Attribute *>::iterator ira = (*ircv)->attrs.begin();
228 ira != (*ircv)->attrs.end(); ++ira) {
232 (*ircv)->attrs.erase(ira);
240 this->spvars.erase(ircv);
251 for (vector<GMCVar *>::iterator ircv = this->cvars.begin();
252 ircv != this->cvars.end(); ++ircv) {
253 if (
true == (*ircv)->unsupported_dspace ) {
261 this->cvars.erase(ircv);
266 for (vector<GMSPVar *>::iterator ircv = this->spvars.begin();
267 ircv != this->spvars.end(); ++ircv) {
269 if (
true == (*ircv)->unsupported_dspace) {
271 this->spvars.erase(ircv);
280 switch(product_type) {
307 throw1(
"Cannot generate dim. names for unsupported datatype");
312 for (vector<Var*>::iterator irv2 = this->
vars.begin();
313 irv2 != this->
vars.end(); irv2++) {
314 for (vector<Dimension *>::iterator ird = (*irv2)->dims.begin();
315 ird !=(*irv2)->dims.end(); ird++) {
316 cerr<<
"Dimension name afet Add_Dim_Name "<<(*ird)->newname <<endl;
332 pair<set<string>::iterator,
bool> setret;
335 for (vector<Var *>::iterator irv = this->
vars.begin();
336 irv != this->
vars.end(); ++irv) {
338 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
339 ird !=(*irv)->dims.end();++ird) {
341 if (
true == setret.second)
347 throw1(
"This product should have the dimension names, but no dimension names are found");
355 bool has_dimlist =
false;
356 bool has_class =
false;
357 bool has_reflist =
false;
359 for(vector<Attribute *>::iterator ira = var->attrs.begin();
360 ira != var->attrs.end();ira++) {
361 if (
"DIMENSION_LIST" == (*ira)->name) {
365 if (
"CLASS" == (*ira)->name)
367 if (
"REFERENCE_LIST" == (*ira)->name)
370 if (
true == has_dimlist)
372 if (
true == has_class &&
true == has_reflist)
376 if (
true == has_dimlist)
377 Add_UseDimscale_Var_Dim_Names_Mea_SeaWiFS_Ozone(var,dimlistattr);
380 else if(
true == has_class &&
true == has_reflist) {
381 if (var->dims.size() !=1)
382 throw2(
"dimension scale dataset must be 1 dimension, this is not true for variable ",
387 (var->dims)[0]->name = var->fullpath;
388 (var->dims)[0]->newname = var->fullpath;
389 pair<set<string>::iterator,
bool> setret;
390 setret = dimnamelist.insert((var->dims)[0]->name);
391 if (
true == setret.second)
392 Insert_One_NameSizeMap_Element((var->dims)[0]->name,(var->dims)[0]->size);
400 set<hsize_t> fakedimsize;
401 pair<set<hsize_t>::iterator,
bool> setsizeret;
402 for (vector<Dimension *>::iterator ird= var->dims.begin();
403 ird != var->dims.end(); ++ird) {
404 Add_One_FakeDim_Name(*ird);
405 setsizeret = fakedimsize.insert((*ird)->size);
406 if (
false == setsizeret.second)
407 Adjust_Duplicate_FakeDim_Name(*ird);
411 for (
int i = 0; i < var->dims.size(); ++i) {
412 Add_One_FakeDim_Name((var->dims)[i]);
413 bool gotoMainLoop =
false;
414 for (
int j =i-1; j>=0 && !gotoMainLoop; --j) {
415 if (((var->dims)[i])->size == ((var->dims)[j])->size){
416 Adjust_Duplicate_FakeDim_Name((var->dims)[i]);
429 ssize_t objnamelen = -1;
437 hid_t amemtype_id = -1;
438 hid_t aspace_id = -1;
442 if(
NULL == dimlistattr)
443 throw2(
"Cannot obtain the dimension list attribute for variable ",var->name);
446 throw2(
"The number of dimension should NOT be 0 for the variable ",var->name);
451 vlbuf.resize(var->rank);
453 hid_t dset_id = H5Dopen(this->fileid,(var->fullpath).c_str(),H5P_DEFAULT);
455 throw2(
"Cannot open the dataset ",var->fullpath);
457 attr_id = H5Aopen(dset_id,(dimlistattr->name).c_str(),H5P_DEFAULT);
459 throw4(
"Cannot open the attribute ",dimlistattr->name,
" of HDF5 dataset ",var->fullpath);
461 atype_id = H5Aget_type(attr_id);
463 throw4(
"Cannot obtain the datatype of the attribute ",dimlistattr->name,
" of HDF5 dataset ",var->fullpath);
465 amemtype_id = H5Tget_native_type(atype_id, H5T_DIR_ASCEND);
468 throw2(
"Cannot obtain the memory datatype for the attribute ",dimlistattr->name);
471 if (H5Aread(attr_id,amemtype_id,&vlbuf[0]) <0)
472 throw2(
"Cannot obtain the referenced object for the variable ",var->name);
475 vector<char> objname;
479 for (vector<Dimension *>::iterator ird = var->dims.begin();
480 ird != var->dims.end(); ++ird) {
482 rbuf =((hobj_ref_t*)vlbuf[vlbuf_index].p)[0];
483 if ((ref_dset = H5Rdereference(attr_id, H5R_OBJECT, &rbuf)) < 0)
484 throw2(
"Cannot dereference from the DIMENSION_LIST attribute for the variable ",var->name);
486 if ((objnamelen= H5Iget_name(ref_dset,
NULL,0))<=0)
487 throw2(
"Cannot obtain the dataset name dereferenced from the DIMENSION_LIST attribute for the variable ",var->name);
488 objname.resize(objnamelen+1);
489 if ((objnamelen= H5Iget_name(ref_dset,&objname[0],objnamelen+1))<=0)
490 throw2(
"Cannot obtain the dataset name dereferenced from the DIMENSION_LIST attribute for the variable ",var->name);
492 string objname_str = string(objname.begin(),objname.end());
493 string trim_objname = objname_str.substr(0,objnamelen);
494 (*ird)->name = string(trim_objname.begin(),trim_objname.end());
496 pair<set<string>::iterator,
bool> setret;
497 setret = dimnamelist.insert((*ird)->name);
498 if (
true == setret.second)
499 Insert_One_NameSizeMap_Element((*ird)->name,(*ird)->size);
500 (*ird)->newname = (*ird)->name;
506 if(vlbuf.size()!= 0) {
508 if ((aspace_id = H5Aget_space(attr_id)) < 0)
509 throw2(
"Cannot get hdf5 dataspace id for the attribute ",dimlistattr->name);
511 if (H5Dvlen_reclaim(amemtype_id,aspace_id,H5P_DEFAULT,(
void*)&vlbuf[0])<0)
512 throw2(
"Cannot successfully clean up the variable length memory for the variable ",var->name);
519 H5Tclose(amemtype_id);
532 if(amemtype_id != -1)
533 H5Tclose(amemtype_id);
556 bool use_dimscale =
false;
558 for (vector<Group *>::iterator irg = this->
groups.begin();
559 irg != this->
groups.end(); ++ irg) {
560 if (
"/Dimensions" == (*irg)->path) {
566 if (
false == use_dimscale) {
568 bool has_dimlist =
false;
569 bool has_class =
false;
570 bool has_reflist =
false;
572 for (vector<Var *>::iterator irv = this->
vars.begin();
573 irv != this->
vars.end(); irv++) {
575 for(vector<Attribute *>::iterator ira = (*irv)->attrs.begin();
576 ira != (*irv)->attrs.end();ira++) {
577 if (
"DIMENSION_LIST" == (*ira)->name)
580 if (
true == has_dimlist)
584 if (
true == has_dimlist) {
585 for (vector<Var *>::iterator irv = this->
vars.begin();
586 irv != this->
vars.end(); irv++) {
588 for(vector<Attribute *>::iterator ira = (*irv)->attrs.begin();
589 ira != (*irv)->attrs.end();ira++) {
590 if (
"CLASS" == (*ira)->name)
592 if (
"REFERENCE_LIST" == (*ira)->name)
594 if (
true == has_class &&
true == has_reflist)
598 if (
true == has_class &&
603 if (
true == has_class &&
true == has_reflist)
608 if (
true == use_dimscale) {
610 pair<set<string>::iterator,
bool> setret;
611 for (vector<Var *>::iterator irv = this->
vars.begin();
612 irv != this->
vars.end(); ++irv) {
614 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
615 ird !=(*irv)->dims.end();++ird) {
617 if(
true == setret.second)
623 throw1(
"This product should have the dimension names, but no dimension names are found");
629 multimap<hsize_t,string> ozonedimsize_to_dimname;
630 pair<multimap<hsize_t,string>::iterator,multimap<hsize_t,string>::iterator> mm_er_ret;
631 multimap<hsize_t,string>::iterator irmm;
633 for (vector<Var *>::iterator irv = this->
vars.begin();
634 irv != this->
vars.end(); ++irv) {
635 bool is_cv =
check_cv((*irv)->name);
637 if ((*irv)->dims.size() != 1)
638 throw3(
"The coordinate variable", (*irv)->name,
" must be one dimension for the zonal average product");
639 ozonedimsize_to_dimname.insert(pair<hsize_t,string>(((*irv)->dims)[0]->size,(*irv)->fullpath));
641 ((*irv)->dims[0])->name = (*irv)->name;
642 ((*irv)->dims[0])->newname = (*irv)->name;
643 pair<set<string>::iterator,
bool> setret;
644 setret =
dimnamelist.insert(((*irv)->dims[0])->name);
651 set<hsize_t> fakedimsize;
652 pair<set<hsize_t>::iterator,
bool> setsizeret;
653 pair<set<string>::iterator,
bool> setret;
654 pair<set<string>::iterator,
bool> tempsetret;
655 set<string> tempdimnamelist;
656 bool fakedimflag =
false;
658 for (vector<Var *>::iterator irv = this->
vars.begin();
659 irv != this->
vars.end(); ++irv) {
661 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
662 ird != (*irv)->dims.end(); ++ird) {
665 mm_er_ret = ozonedimsize_to_dimname.equal_range((*ird)->size);
666 for (irmm = mm_er_ret.first; irmm!=mm_er_ret.second;irmm++) {
667 setret = tempdimnamelist.insert(irmm->second);
668 if (
true == setret.second) {
669 (*ird)->name = irmm->second;
670 (*ird)->newname = (*ird)->name;
678 if (
true == fakedimflag) {
680 setsizeret = fakedimsize.insert((*ird)->size);
681 if (
false == setsizeret.second)
686 tempdimnamelist.clear();
694 const string lat_name =
"Latitude";
695 const string time_name =
"Time";
696 const string ratio_pressure_name =
"MixingRatioPressureLevels";
697 const string profile_pressure_name =
"ProfilePressureLevels";
698 const string wave_length_name =
"Wavelength";
700 if (lat_name == varname)
702 else if (time_name == varname)
704 else if (ratio_pressure_name == varname)
706 else if (profile_pressure_name == varname)
708 else if (wave_length_name == varname)
718 pair<set<string>::iterator,
bool> setret;
728 for (vector<Var *>::iterator irv = this->
vars.begin();
729 irv != this->
vars.end(); irv++) {
731 bool has_dim_name_attr =
false;
733 for (vector<Attribute *>::iterator ira = (*irv)->attrs.begin();
734 ira != (*irv)->attrs.end(); ++ira) {
736 if(
"DimensionNames" == (*ira)->name) {
739 string dimname_value((*ira)->value.begin(),(*ira)->value.end());
741 vector<string> ind_elems;
745 if(ind_elems.size() != (size_t)((*irv)->getRank())) {
746 throw2(
"The number of dims obtained from the <DimensionNames> attribute is not equal to the rank ",
750 for(
unsigned int i = 0; i<ind_elems.size(); ++i) {
752 ((*irv)->dims)[i]->name = ind_elems[i];
755 if(((*irv)->dims)[i]->name==
""){
759 string fakedim =
"FakeDim";
760 stringstream sdim_count;
761 sdim_count << dim_count;
762 fakedim = fakedim + sdim_count.str();
764 ((*irv)->dims)[i]->name = fakedim;
765 ((*irv)->dims)[i]->newname = fakedim;
766 ind_elems[i] = fakedim;
771 ((*irv)->dims)[i]->newname = ind_elems[i];
772 setret =
dimnamelist.insert(((*irv)->dims)[i]->name);
774 if (
true == setret.second) {
776 ((*irv)->dims)[i]->size);
780 throw5(
"Dimension ",((*irv)->dims)[i]->name,
"has two sizes",
787 has_dim_name_attr =
true;
794 if(
false == has_dim_name_attr) {
796 throw4(
"The variable ", (*irv)->name,
" doesn't have the DimensionNames attribute.",
797 "We currently don't support this case. Please report to the NASA data center.");
807 for (vector<Var *>::iterator irv = this->
vars.begin();
808 irv != this->
vars.end(); irv++) {
809 if (
"l3m_data" == (*irv)->name) {
810 ((*irv)->dims)[0]->name =
"lat";
811 ((*irv)->dims)[0]->newname =
"lat";
812 ((*irv)->dims)[1]->name =
"lon";
813 ((*irv)->dims)[1]->newname =
"lon";
820 if (
"palette" == (*irv)->name) {
822 ((*irv)->dims)[0]->name =
"paldim0";
823 ((*irv)->dims)[0]->newname =
"paldim0";
824 ((*irv)->dims)[1]->name =
"paldim1";
825 ((*irv)->dims)[1]->newname =
"paldim1";
833 string tempvarname =
"";
835 string smapdim0 =
"YDim";
836 string smapdim1 =
"XDim";
839 multimap<hsize_t,string> smapdimsize_to_dimname;
840 pair<multimap<hsize_t,string>::iterator,multimap<hsize_t,string>::iterator> mm_er_ret;
841 multimap<hsize_t,string>::iterator irmm;
844 for (vector<Var *>::iterator irv = this->
vars.begin();
845 irv != this->
vars.end(); ++irv) {
846 tempvarname = (*irv)->name;
847 if ((tempvarname.size() > key.size())&&
848 (key == tempvarname.substr(tempvarname.size()-key.size(),key.size()))){
850 if ((*irv)->dims.size() !=2)
851 throw1(
"Currently only 2D lat/lon is supported for SMAP");
852 smapdimsize_to_dimname.insert(pair<hsize_t,string>(((*irv)->dims)[0]->size,smapdim0));
853 smapdimsize_to_dimname.insert(pair<hsize_t,string>(((*irv)->dims)[1]->size,smapdim1));
858 set<hsize_t> fakedimsize;
859 pair<set<hsize_t>::iterator,
bool> setsizeret;
860 pair<set<string>::iterator,
bool> setret;
861 pair<set<string>::iterator,
bool> tempsetret;
862 set<string> tempdimnamelist;
863 bool fakedimflag =
false;
866 for (vector<Var *>::iterator irv = this->
vars.begin();
867 irv != this->
vars.end(); ++irv) {
869 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
870 ird != (*irv)->dims.end(); ++ird) {
873 mm_er_ret = smapdimsize_to_dimname.equal_range((*ird)->size);
874 for (irmm = mm_er_ret.first; irmm!=mm_er_ret.second;irmm++) {
875 setret = tempdimnamelist.insert(irmm->second);
877 (*ird)->name = irmm->second;
878 (*ird)->newname = (*ird)->name;
886 if (
true == fakedimflag) {
888 setsizeret = fakedimsize.insert((*ird)->size);
889 if (!setsizeret.second)
893 tempdimnamelist.clear();
900 for (vector<Var *>::iterator irv = this->
vars.begin();
901 irv != this->
vars.end(); ++irv) {
903 set<hsize_t> fakedimsize;
904 pair<set<hsize_t>::iterator,
bool> setsizeret;
905 for (vector<Dimension *>::iterator ird= (*irv)->dims.begin();
906 ird != (*irv)->dims.end(); ++ird) {
908 setsizeret = fakedimsize.insert((*ird)->size);
909 if (
false == setsizeret.second)
927 bool has_dimlist =
false;
928 bool has_dimscalelist =
false;
931 for (vector<Var *>::iterator irv = this->
vars.begin();
932 irv != this->
vars.end(); ++irv) {
933 for(vector<Attribute *>::iterator ira = (*irv)->attrs.begin();
934 ira != (*irv)->attrs.end();ira++) {
935 if (
"DIMENSION_LIST" == (*ira)->name) {
940 if (
true == has_dimlist)
949 for (vector<Var *>::iterator irv = this->
vars.begin();
950 irv != this->
vars.end(); ++irv) {
953 for(vector<Attribute *>::iterator ira = (*irv)->attrs.begin();
954 ira != (*irv)->attrs.end();ira++) {
955 if (
"CLASS" == (*ira)->name) {
959 class_value.resize((*ira)->value.size());
960 copy((*ira)->value.begin(),(*ira)->value.end(),class_value.begin());
964 if (0 == class_value.compare(0,15,
"DIMENSION_SCALE")) {
965 has_dimscalelist =
true;
971 if (
true == has_dimscalelist)
976 if (
true == has_dimlist &&
true == has_dimscalelist)
984 pair<set<string>::iterator,
bool> setret;
985 this->iscoard =
true;
987 for (vector<Var *>::iterator irv = this->
vars.begin();
988 irv != this->
vars.end(); ++irv) {
990 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
991 ird !=(*irv)->dims.end();++ird) {
993 if (
true == setret.second)
999 throw1(
"This product should have the dimension names, but no dimension names are found");
1006 bool has_dimlist =
false;
1007 bool has_dimclass =
false;
1009 for(vector<Attribute *>::iterator ira = var->attrs.begin();
1010 ira != var->attrs.end();ira++) {
1011 if (
"DIMENSION_LIST" == (*ira)->name) {
1015 if (
"CLASS" == (*ira)->name) {
1017 Retrieve_H5_Attr_Value(*ira,var->fullpath);
1019 class_value.resize((*ira)->value.size());
1020 copy((*ira)->value.begin(),(*ira)->value.end(),class_value.begin());
1024 if (0 == class_value.compare(0,15,
"DIMENSION_SCALE")) {
1025 has_dimclass =
true;
1033 if (
true == has_dimlist)
1034 Add_UseDimscale_Var_Dim_Names_General_Product(var,dimlistattr);
1037 else if(
true == has_dimclass) {
1038 if (var->dims.size() !=1)
1039 throw2(
"Currently dimension scale dataset must be 1 dimension, this is not true for the dataset ",
1044 (var->dims)[0]->name = var->fullpath;
1045 (var->dims)[0]->newname = var->fullpath;
1046 pair<set<string>::iterator,
bool> setret;
1047 setret = dimnamelist.insert((var->dims)[0]->name);
1048 if (
true == setret.second)
1049 Insert_One_NameSizeMap_Element((var->dims)[0]->name,(var->dims)[0]->size);
1055 set<hsize_t> fakedimsize;
1056 pair<set<hsize_t>::iterator,
bool> setsizeret;
1057 for (vector<Dimension *>::iterator ird= var->dims.begin();
1058 ird != var->dims.end(); ++ird) {
1059 Add_One_FakeDim_Name(*ird);
1060 setsizeret = fakedimsize.insert((*ird)->size);
1062 if (
false == setsizeret.second)
1063 Adjust_Duplicate_FakeDim_Name(*ird);
1072 ssize_t objnamelen = -1;
1075 vector<hvl_t> vlbuf;
1079 hid_t atype_id = -1;
1080 hid_t amemtype_id = -1;
1081 hid_t aspace_id = -1;
1082 hid_t ref_dset = -1;
1085 if(
NULL == dimlistattr)
1086 throw2(
"Cannot obtain the dimension list attribute for variable ",var->name);
1089 throw2(
"The number of dimension should NOT be 0 for the variable ",var->name);
1094 vlbuf.resize(var->rank);
1096 hid_t dset_id = H5Dopen(this->fileid,(var->fullpath).c_str(),H5P_DEFAULT);
1098 throw2(
"Cannot open the dataset ",var->fullpath);
1100 attr_id = H5Aopen(dset_id,(dimlistattr->name).c_str(),H5P_DEFAULT);
1102 throw4(
"Cannot open the attribute ",dimlistattr->name,
" of HDF5 dataset ",var->fullpath);
1104 atype_id = H5Aget_type(attr_id);
1106 throw4(
"Cannot obtain the datatype of the attribute ",dimlistattr->name,
" of HDF5 dataset ",var->fullpath);
1108 amemtype_id = H5Tget_native_type(atype_id, H5T_DIR_ASCEND);
1110 if (amemtype_id < 0)
1111 throw2(
"Cannot obtain the memory datatype for the attribute ",dimlistattr->name);
1114 if (H5Aread(attr_id,amemtype_id,&vlbuf[0]) <0)
1115 throw2(
"Cannot obtain the referenced object for the variable ",var->name);
1118 vector<char> objname;
1119 int vlbuf_index = 0;
1122 for (vector<Dimension *>::iterator ird = var->dims.begin();
1123 ird != var->dims.end(); ++ird) {
1125 rbuf =((hobj_ref_t*)vlbuf[vlbuf_index].p)[0];
1126 if ((ref_dset = H5Rdereference(attr_id, H5R_OBJECT, &rbuf)) < 0)
1127 throw2(
"Cannot dereference from the DIMENSION_LIST attribute for the variable ",var->name);
1129 if ((objnamelen= H5Iget_name(ref_dset,
NULL,0))<=0)
1130 throw2(
"Cannot obtain the dataset name dereferenced from the DIMENSION_LIST attribute for the variable ",var->name);
1131 objname.resize(objnamelen+1);
1132 if ((objnamelen= H5Iget_name(ref_dset,&objname[0],objnamelen+1))<=0)
1133 throw2(
"Cannot obtain the dataset name dereferenced from the DIMENSION_LIST attribute for the variable ",var->name);
1135 string objname_str = string(objname.begin(),objname.end());
1136 string trim_objname = objname_str.substr(0,objnamelen);
1137 (*ird)->name = string(trim_objname.begin(),trim_objname.end());
1139 pair<set<string>::iterator,
bool> setret;
1140 setret = dimnamelist.insert((*ird)->name);
1141 if (
true == setret.second)
1142 Insert_One_NameSizeMap_Element((*ird)->name,(*ird)->size);
1143 (*ird)->newname = (*ird)->name;
1149 if(vlbuf.size()!= 0) {
1151 if ((aspace_id = H5Aget_space(attr_id)) < 0)
1152 throw2(
"Cannot get hdf5 dataspace id for the attribute ",dimlistattr->name);
1154 if (H5Dvlen_reclaim(amemtype_id,aspace_id,H5P_DEFAULT,(
void*)&vlbuf[0])<0)
1155 throw2(
"Cannot successfully clean up the variable length memory for the variable ",var->name);
1157 H5Sclose(aspace_id);
1162 H5Tclose(amemtype_id);
1175 if(amemtype_id != -1)
1176 H5Tclose(amemtype_id);
1179 H5Sclose(aspace_id);
1213 else if (
Aqu_L3 == this->product_type)
1215 else if (
OBPG_L3 == this->product_type)
1217 else if (
SMAP == this->product_type)
1219 else if (
Mea_Ozone == this->product_type)
1221 else if (
GPMS_L3 == this->product_type ||
GPMM_L3 == this->product_type)
1223 else if (
GPM_L1 == this->product_type)
1231 for (vector<Var *>::iterator irv = this->
vars.begin();
1232 irv != this->
vars.end(); ++irv) {
1233 if((*irv)->name==
"AlgorithmRuntimeInfo") {
1235 this->
vars.erase(irv);
1248 string ll_dim0,ll_dim1;
1249 for (vector<Var *>::iterator irv = this->
vars.begin();
1250 irv != this->
vars.end(); ++irv) {
1251 if((*irv)->rank == 2 && (*irv)->name ==
"Latitude") {
1253 size_t lat_pos = (*irv)->fullpath.rfind(
"Latitude");
1254 string lat_path = (*irv)->fullpath.substr(0,lat_pos);
1255 GMcvar->cfdimname = lat_path + ((*irv)->dims)[0]->name;
1256 ll_dim0 = ((*irv)->dims)[0]->name;
1258 GMcvar->product_type = product_type;
1259 this->cvars.push_back(GMcvar);
1261 this->
vars.erase(irv);
1264 if((*irv)->rank == 2 && (*irv)->name ==
"Longitude") {
1266 size_t lon_pos = (*irv)->fullpath.rfind(
"Longitude");
1267 string lon_path = (*irv)->fullpath.substr(0,lon_pos);
1268 GMcvar->cfdimname = lon_path + ((*irv)->dims)[1]->name;
1269 ll_dim1 = ((*irv)->dims)[1]->name;
1271 GMcvar->product_type = product_type;
1272 this->cvars.push_back(GMcvar);
1274 this->
vars.erase(irv);
1281 set<string> cvdimset;
1282 pair<set<string>::iterator,
bool> setret;
1283 for (vector<Var *>::iterator irv = this->
vars.begin();
1284 irv != this->
vars.end(); ++irv) {
1285 for(vector<Dimension *>::iterator ird = (*irv)->dims.begin();
1286 ird != (*irv)->dims.end(); ++ird) {
1287 setret = cvdimset.insert((*ird)->name);
1288 cerr<<
"var name is "<<(*irv)->fullpath <<endl;
1289 if (
true == setret.second) {
1290 cerr<<
"dim name is "<<(*ird)->name <<endl;
1302 if((itd->first) != ll_dim0 && (itd->first) != ll_dim1) {
1305 this->cvars.push_back(GMcvar);
1324 if(
"nlon" == itd->first ||
"nlat" == itd->first
1325 ||
"lnH" == itd->first ||
"ltH" == itd->first
1326 ||
"lnL" == itd->first ||
"ltL" == itd->first) {
1327 GMcvar->
name = itd->first;
1335 GMcvar->
dims.push_back(gmcvar_dim);
1336 GMcvar->cfdimname = gmcvar_dim->
name;
1337 if (
"nlat" ==GMcvar->
name ||
"ltH" == GMcvar->
name
1338 ||
"ltL" == GMcvar->
name)
1340 else if (
"nlon" == GMcvar->
name ||
"lnH" == GMcvar->
name
1341 ||
"lnL" == GMcvar->
name)
1343 GMcvar->product_type = product_type;
1345 else if ((
"nlayer" == itd->first && 28 == itd->second) ||
1346 (
"hgt" == itd->first && 5 == itd->second) ||
1347 (
"nalt" == itd->first && 5 == itd->second)){
1348 GMcvar->
name = itd->first;
1356 GMcvar->
dims.push_back(gmcvar_dim);
1357 GMcvar->cfdimname = gmcvar_dim->
name;
1359 GMcvar->product_type = product_type;
1363 this->cvars.push_back(GMcvar);
1370 pair<set<string>::iterator,
bool> setret;
1373 for (set<string>::iterator irs =
dimnamelist.begin();
1375 for (vector<Var *>::iterator irv = this->
vars.begin();
1376 irv != this->
vars.end(); ++irv) {
1377 if ((*irs)== (*irv)->fullpath) {
1379 if (!iscoard && ((
"/natrack" == (*irs))
1380 ||
"/nxtrack" == (*irs)))
1383 if((*irv)->dims.size()!=1)
1384 throw3(
"Coard coordinate variable",(*irv)->name,
"is not 1D");
1386 tempdimnamelist.erase(*irs);
1388 GMcvar->cfdimname = *irs;
1390 GMcvar->product_type = product_type;
1391 this->cvars.push_back(GMcvar);
1393 this->
vars.erase(irv);
1396 else if(
false == iscoard) {
1399 if ((((*irs) ==
"/natrack") && ((*irv)->fullpath ==
"/latitude"))
1400 ||(((*irs) ==
"/nxtrack") && ((*irv)->fullpath ==
"/longitude"))) {
1401 tempdimnamelist.erase(*irs);
1403 GMcvar->cfdimname = *irs;
1405 GMcvar->product_type = product_type;
1406 this->cvars.push_back(GMcvar);
1408 this->
vars.erase(irv);
1418 for (set<string>::iterator irs = tempdimnamelist.begin();
1419 irs != tempdimnamelist.end();++irs) {
1422 this->cvars.push_back(GMcvar);
1428 pair<set<string>::iterator,
bool> setret;
1431 string key0 =
"_lat";
1432 string key1 =
"_lon";
1433 string smapdim0 =
"YDim";
1434 string smapdim1 =
"XDim";
1436 bool foundkey0 =
false;
1437 bool foundkey1 =
false;
1441 for (vector<Var *>::iterator irv = this->
vars.begin();
1442 irv != this->
vars.end(); ++irv) {
1444 tempvarname = (*irv)->name;
1446 if ((tempvarname.size() > key0.size())&&
1447 (key0 == tempvarname.substr(tempvarname.size()-key0.size(),key0.size()))){
1450 throw5(
"variable ",tempvarname,
" must have dimension ",smapdim0,
" , but not found ");
1452 tempdimnamelist.erase(smapdim0);
1455 GMcvar->cfdimname = smapdim0;
1457 GMcvar->product_type = product_type;
1458 this->cvars.push_back(GMcvar);
1460 this->
vars.erase(irv);
1464 else if ((tempvarname.size() > key1.size())&&
1465 (key1 == tempvarname.substr(tempvarname.size()-key1.size(),key1.size()))){
1468 throw5(
"variable ",tempvarname,
" must have dimension ",smapdim1,
" , but not found ");
1470 tempdimnamelist.erase(smapdim1);
1474 GMcvar->cfdimname = smapdim1;
1476 GMcvar->product_type = product_type;
1477 this->cvars.push_back(GMcvar);
1479 this->
vars.erase(irv);
1482 if (
true == foundkey0 &&
true == foundkey1)
1487 for (set<string>::iterator irs = tempdimnamelist.begin();
1488 irs != tempdimnamelist.end();++irs) {
1492 this->cvars.push_back(GMcvar);
1500 for (vector<Var *>::iterator irv = this->
vars.begin();
1501 irv != this->
vars.end(); ++irv) {
1503 if (
"l3m_data" == (*irv)->name) {
1504 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
1505 ird != (*irv)->dims.end(); ++ird) {
1507 GMcvar->
name = (*ird)->name;
1515 GMcvar->
dims.push_back(gmcvar_dim);
1516 GMcvar->cfdimname = gmcvar_dim->
name;
1519 GMcvar->product_type = product_type;
1520 this->cvars.push_back(GMcvar);
1529 pair<set<string>::iterator,
bool> setret;
1532 if(
false == iscoard)
1533 throw1(
"Measure Ozone level 3 zonal average product must follow COARDS conventions");
1535 for (set<string>::iterator irs =
dimnamelist.begin();
1537 for (vector<Var *>::iterator irv = this->
vars.begin();
1538 irv != this->
vars.end(); ++irv) {
1539 if ((*irs)== (*irv)->fullpath) {
1541 if((*irv)->dims.size()!=1)
1542 throw3(
"Coard coordinate variable",(*irv)->name,
"is not 1D");
1545 tempdimnamelist.erase(*irs);
1547 GMcvar->cfdimname = *irs;
1549 GMcvar->product_type = product_type;
1550 this->cvars.push_back(GMcvar);
1552 this->
vars.erase(irv);
1560 for (set<string>::iterator irs = tempdimnamelist.begin();
1561 irs != tempdimnamelist.end();irs++) {
1565 this->cvars.push_back(GMcvar);
1571 pair<set<string>::iterator,
bool> setret;
1574 if(
false == iscoard)
1575 throw1(
"Currently products that use HDF5 dimension scales must follow COARDS conventions");
1577 for (set<string>::iterator irs =
dimnamelist.begin();
1579 for (vector<Var *>::iterator irv = this->
vars.begin();
1580 irv != this->
vars.end(); ++irv) {
1583 if ((*irs)== (*irv)->fullpath) {
1585 if((*irv)->dims.size()!=1)
1586 throw3(
"COARDS coordinate variable",(*irv)->name,
"is not 1D");
1589 tempdimnamelist.erase(*irs);
1591 GMcvar->cfdimname = *irs;
1595 if (
true == is_netcdf_dimension)
1600 GMcvar->product_type = product_type;
1601 this->cvars.push_back(GMcvar);
1603 this->
vars.erase(irv);
1611 for (set<string>::iterator irs = tempdimnamelist.begin();
1612 irs != tempdimnamelist.end();irs++) {
1616 this->cvars.push_back(GMcvar);
1626 for (vector<Var *>::iterator irv = this->
vars.begin();
1627 irv != this->
vars.end(); ++irv) {
1634 if((*irv)->rank == 2) {
1636 if(((*irv)->fullpath.find(
"/geophsical_data") == 0) || ((*irv)->dtype ==
H5FLOAT32)) {
1638 size_t lat_size = (*irv)->getDimensions()[0]->size;
1639 string lat_name = (*irv)->getDimensions()[0]->name;
1640 size_t lon_size = (*irv)->getDimensions()[1]->size;
1641 string lon_name = (*irv)->getDimensions()[1]->name;
1642 size_t temp_size = 0;
1649 if(lat_size >lon_size) {
1650 temp_size = lon_size;
1651 temp_name = lon_name;
1652 lon_size = lat_size;
1653 lon_name = lat_name;
1654 lat_size = temp_size;
1655 lat_name = temp_name;
1657 for (vector<GMCVar *>::iterator ircv = this->cvars.begin();
1658 ircv != this->cvars.end(); ++ircv) {
1660 if((*ircv)->getDimensions()[0]->size == lat_size &&
1661 (*ircv)->getDimensions()[0]->name == lat_name) {
1663 (*ircv)->dtype = ll_dtype;
1664 for (vector<Attribute *>::iterator ira = (*ircv)->attrs.begin();
1665 ira != (*ircv)->attrs.end(); ++ira) {
1666 if ((*ira)->name ==
"NAME") {
1668 (*ircv)->attrs.erase(ira);
1673 else if((*ircv)->getDimensions()[0]->size == lon_size &&
1674 (*ircv)->getDimensions()[0]->name == lon_name) {
1676 (*ircv)->dtype = ll_dtype;
1677 for (vector<Attribute *>::iterator ira = (*ircv)->attrs.begin();
1678 ira != (*ircv)->attrs.end(); ++ira) {
1679 if ((*ira)->name ==
"NAME") {
1681 (*ircv)->attrs.erase(ira);
1700 else if(
GPM_L1 == product_type) {
1702 for (vector<Var *>::iterator irv = this->
vars.begin();
1703 irv != this->
vars.end(); ++irv) {
1704 if((*irv)->name==
"AlgorithmRuntimeInfo") {
1706 this->
vars.erase(irv);
1714 for (vector<Var *>::iterator irv = this->
vars.begin();
1715 irv != this->
vars.end(); ++irv) {
1716 if((*irv)->name==
"InputFileNames") {
1718 this->
vars.erase(irv);
1721 else if((*irv)->name==
"InputAlgorithmVersions") {
1723 this->
vars.erase(irv);
1726 else if((*irv)->name==
"InputGenerationDateTimes") {
1728 this->
vars.erase(irv);
1741 for (vector<Var *>::iterator irv = this->
vars.begin();
1742 irv != this->
vars.end(); ++irv) {
1743 if (
H5INT64 == (*irv)->getType()) {
1747 spvar->
name = (*irv)->name +
"_Time";
1748 spvar->
newname = (*irv)->newname+
"_Time";
1750 spvar->otype = (*irv)->getType();
1754 spvar->numofdbits = 6;
1755 this->spvars.push_back(spvar);
1759 spvar2->
name = (*irv)->name +
"_Date";
1760 spvar2->
newname = (*irv)->newname+
"_Date";
1762 spvar2->otype = (*irv)->getType();
1766 spvar2->numofdbits = 8;
1767 this->spvars.push_back(spvar2);
1770 this->
vars.erase(irv);
1787 for (vector<Var*>::iterator irv2 = this->
vars.begin();
1788 irv2 != this->
vars.end(); irv2++) {
1789 for (vector<Dimension *>::iterator ird = (*irv2)->dims.begin();
1790 ird !=(*irv2)->dims.end(); ird++) {
1791 cerr<<
"Dimension name afet Adjust_Obj_Name "<<(*ird)->newname <<endl;
1804 if(this->
groups.size() <= 1) {
1805 for (vector<Var *>::iterator irv = this->
vars.begin();
1806 irv != this->
vars.end(); ++irv) {
1808 if (objnewname !=
"")
1809 (*irv)->newname = objnewname;
1813 for (vector<Var *>::iterator irv = this->
vars.begin();
1814 irv != this->
vars.end(); ++irv) {
1816 size_t grid_group_path_pos = ((*irv)->newname.substr(1)).find_first_of(
"/");
1817 objnewname = ((*irv)->newname).substr(grid_group_path_pos+2);
1818 (*irv)->newname = objnewname;
1828 for (vector<Var *>::iterator irv = this->
vars.begin();
1829 irv != this->
vars.end(); ++irv) {
1831 if (objnewname !=
"")
1832 (*irv)->newname = objnewname;
1836 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
1837 ird !=(*irv)->dims.end();++ird) {
1838 cerr<<
"Ozone dim. name "<<(*ird)->name <<endl;
1839 cerr<<
"Ozone dim. new name "<<(*ird)->newname <<endl;
1845 for (vector<GMCVar *>::iterator irv = this->cvars.begin();
1846 irv != this->cvars.end(); ++irv) {
1848 if (objnewname !=
"")
1849 (*irv)->newname = objnewname;
1852 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
1853 ird !=(*irv)->dims.end();++ird) {
1854 cerr<<
"Ozone CV dim. name "<<(*ird)->name <<endl;
1855 cerr<<
"Ozone CV dim. new name "<<(*ird)->newname <<endl;
1864 for (vector<GMCVar *>::iterator irv = this->cvars.begin();
1865 irv != this->cvars.end(); ++irv) {
1866 (*irv)->newname = get_CF_string((*irv)->newname);
1868 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
1869 ird != (*irv)->dims.end(); ++ird) {
1870 (*ird)->newname = get_CF_string((*ird)->newname);
1875 if (
true == include_attr) {
1876 for (vector<Attribute *>::iterator ira = (*irv)->attrs.begin();
1877 ira != (*irv)->attrs.end(); ++ira)
1878 (*ira)->newname = get_CF_string((*ira)->newname);
1884 for (vector<GMSPVar *>::iterator irv = this->spvars.begin();
1885 irv != this->spvars.end(); ++irv) {
1886 (*irv)->newname = get_CF_string((*irv)->newname);
1888 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
1889 ird != (*irv)->dims.end(); ++ird)
1890 (*ird)->newname = get_CF_string((*ird)->newname);
1892 if (
true == include_attr) {
1893 for (vector<Attribute *>::iterator ira = (*irv)->attrs.begin();
1894 ira != (*irv)->attrs.end(); ++ira)
1895 (*ira)->newname = get_CF_string((*ira)->newname);
1902 for (vector<Var*>::iterator irv2 = this->vars.begin();
1903 irv2 != this->vars.end(); irv2++) {
1904 for (vector<Dimension *>::iterator ird = (*irv2)->dims.begin();
1905 ird !=(*irv2)->dims.end(); ird++) {
1906 cerr<<
"Dimension name afet Flatten_Obj_Name "<<(*ird)->newname <<endl;
1920 set<string>objnameset;
1921 Handle_GMCVar_NameClashing(objnameset);
1922 Handle_GMSPVar_NameClashing(objnameset);
1924 if (
true == include_attr) {
1925 Handle_GMCVar_AttrNameClashing();
1926 Handle_GMSPVar_AttrNameClashing();
1934 GMHandle_General_NameClashing(objnameset,this->cvars);
1939 GMHandle_General_NameClashing(objnameset,this->spvars);
1945 set<string> objnameset;
1947 for (vector<GMCVar *>::iterator irv = this->cvars.begin();
1948 irv != this->cvars.end(); ++irv) {
1955 set<string> objnameset;
1957 for (vector<GMSPVar *>::iterator irv = this->spvars.begin();
1958 irv != this->spvars.end(); ++irv) {
1965 template<
class T>
void
1968 pair<set<string>::iterator,
bool> setret;
1969 set<string>::iterator iss;
1971 vector<string> clashnamelist;
1972 vector<string>::iterator ivs;
1974 map<int,int> cl_to_ol;
1978 typename vector<T*>::iterator irv;
1981 for (irv = objvec.begin();
1982 irv != objvec.end(); ++irv) {
1984 setret = objnameset.insert((*irv)->newname);
1985 if (
false == setret.second ) {
1986 clashnamelist.insert(clashnamelist.end(),(*irv)->newname);
1987 cl_to_ol[cl_index] = ol_index;
1997 for (ivs=clashnamelist.begin(); ivs!=clashnamelist.end(); ++ivs) {
1998 int clash_index = 1;
1999 string temp_clashname = *ivs +
'_';
2001 *ivs = temp_clashname;
2006 for (
unsigned int i =0; i <clashnamelist.size(); i++)
2007 objvec[cl_to_ol[i]]->newname = clashnamelist[i];
2016 if (
ACOS_L2S == product_type)
return;
2018 map<string,string>dimname_to_dimnewname;
2019 pair<map<string,string>::iterator,
bool>mapret;
2020 set<string> dimnameset;
2021 vector<Dimension*>vdims;
2022 set<string> dimnewnameset;
2023 pair<set<string>::iterator,
bool> setret;
2026 for (vector<GMCVar *>::iterator irv = this->cvars.begin();
2027 irv !=this->cvars.end(); ++irv) {
2028 for (vector <Dimension *>:: iterator ird = (*irv)->dims.begin();
2029 ird !=(*irv)->dims.end();++ird) {
2031 setret = dimnameset.insert((*ird)->name);
2032 if (
true == setret.second)
2033 vdims.push_back(*ird);
2040 for(vector<Var *>::iterator irv= this->
vars.begin();
2041 irv != this->
vars.end();++irv) {
2042 for (vector <Dimension *>:: iterator ird = (*irv)->dims.begin();
2043 ird !=(*irv)->dims.end();++ird) {
2045 setret = dimnameset.insert((*ird)->name);
2046 if (setret.second) vdims.push_back(*ird);
2055 for (vector<Dimension*>::iterator ird = vdims.begin();ird!=vdims.end();++ird) {
2056 mapret = dimname_to_dimnewname.insert(pair<string,string>((*ird)->name,(*ird)->newname));
2057 if (
false == mapret.second)
2058 throw4(
"The dimension name ",(*ird)->name,
" should map to ",
2063 for (vector<GMCVar *>::iterator irv = this->cvars.begin();
2064 irv !=this->cvars.end(); ++irv)
2065 for (vector <Dimension *>:: iterator ird = (*irv)->dims.begin();
2066 ird!=(*irv)->dims.end();++ird)
2067 (*ird)->newname = dimname_to_dimnewname[(*ird)->name];
2069 for (vector<Var *>::iterator irv = this->
vars.begin();
2070 irv != this->
vars.end(); ++irv)
2071 for (vector <Dimension *>:: iterator ird = (*irv)->dims.begin();
2072 ird !=(*irv)->dims.end();++ird)
2073 (*ird)->newname = dimname_to_dimnewname[(*ird)->name];
2082 for (vector<Var*>::iterator irv2 = this->
vars.begin();
2083 irv2 != this->
vars.end(); irv2++) {
2084 for (vector<Dimension *>::iterator ird = (*irv2)->dims.begin();
2085 ird !=(*irv2)->dims.end(); ird++) {
2086 cerr<<
"Dimension new name "<<(*ird)->newname <<endl;
2092 if(
true == iscoard) {
2093 for (vector<GMCVar *>::iterator irv = this->cvars.begin();
2094 irv !=this->cvars.end(); ++irv) {
2095 if ((*irv)->dims.size()!=1)
2096 throw3(
"Coard coordinate variable ",(*irv)->name,
"is not 1D");
2097 if ((*irv)->newname != (((*irv)->dims)[0]->newname)) {
2098 ((*irv)->dims)[0]->newname = (*irv)->newname;
2101 for (vector<Var*>::iterator irv2 = this->
vars.begin();
2102 irv2 != this->
vars.end(); ++irv2) {
2103 for (vector<Dimension *>::iterator ird = (*irv2)->dims.begin();
2104 ird !=(*irv2)->dims.end(); ++ird) {
2109 if ((*ird)->name == ((*irv)->dims)[0]->name)
2110 (*ird)->newname = ((*irv)->dims)[0]->newname;
2119 for (vector<Var*>::iterator irv2 = this->
vars.begin();
2120 irv2 != this->
vars.end(); irv2++) {
2121 for (vector<Dimension *>::iterator ird = (*irv2)->dims.begin();
2122 ird !=(*irv2)->dims.end(); ird++) {
2123 cerr<<
"Dimension name afet Adjust_Dim_Name "<<(*ird)->newname <<endl;
2138 for (vector<GMCVar *>::iterator irv = this->cvars.begin();
2139 irv != this->cvars.end(); ++irv) {
2142 const string varname = (*irv)->name;
2143 const string attrname =
"origname";
2144 Add_Str_Attr(attr,attrname,varname);
2145 (*irv)->attrs.push_back(attr);
2149 for (vector<GMCVar *>::iterator irv = this->cvars.begin();
2150 irv != this->cvars.end(); ++irv) {
2153 const string varname = (*irv)->fullpath;
2154 const string attrname =
"fullnamepath";
2155 Add_Str_Attr(attr,attrname,varname);
2156 (*irv)->attrs.push_back(attr);
2160 for (vector<GMSPVar *>::iterator irv = this->spvars.begin();
2161 irv != this->spvars.end(); ++irv) {
2163 const string varname = (*irv)->name;
2164 const string attrname =
"origname";
2165 Add_Str_Attr(attr,attrname,varname);
2166 (*irv)->attrs.push_back(attr);
2169 for (vector<GMSPVar *>::iterator irv = this->spvars.begin();
2170 irv != this->spvars.end(); ++irv) {
2172 const string varname = (*irv)->fullpath;
2173 const string attrname =
"fullnamepath";
2174 Add_Str_Attr(attr,attrname,varname);
2175 (*irv)->attrs.push_back(attr);
2181 else if (
Aqu_L3 == product_type)
2184 Add_SeaWiFS_Attrs();
2191 vector<HDF5CF::Var *>::const_iterator it_v;
2192 vector<HDF5CF::Attribute *>::const_iterator ira;
2193 const string attr_name_be_replaced =
"CodeMissingValue";
2194 const string attr_new_name =
"_FillValue";
2195 const string attr_cor_fill_value =
"-9999.9";
2196 const string attr2_name_be_replaced =
"Units";
2197 const string attr2_new_name =
"units";
2202 for (it_v =
vars.begin(); it_v !=
vars.end(); ++it_v) {
2203 for(ira = (*it_v)->attrs.begin(); ira!= (*it_v)->attrs.end();ira++) {
2204 if((attr_name_be_replaced == (*ira)->name)) {
2207 (*ira)->name = attr_new_name;
2208 (*ira)->newname = attr_new_name;
2215 for (vector<GMCVar *>::iterator irv = this->cvars.begin();
2216 irv != this->cvars.end(); ++irv) {
2218 for(ira = (*irv)->attrs.begin(); ira!= (*irv)->attrs.end();ira++) {
2220 if(attr_name_be_replaced == (*ira)->name) {
2223 (*ira)->name = attr_new_name;
2224 (*ira)->newname = attr_new_name;
2229 if(product_type ==
GPM_L1) {
2230 if ((*irv)->cvartype ==
CV_EXIST) {
2232 for(ira = (*irv)->attrs.begin(); ira!= (*irv)->attrs.end();ira++) {
2234 if(attr2_name_be_replaced == (*ira)->name) {
2236 if((*irv)->name.find(
"Latitude") !=string::npos) {
2238 string unit_value =
"degrees_north";
2239 (*ira)->value.clear();
2245 else if((*irv)->name.find(
"Longitude") !=string::npos) {
2247 string unit_value =
"degrees_east";
2248 (*ira)->value.clear();
2260 const string attrname =
"comment";
2264 if((*irv)->name ==
"nchannel1")
2265 comment =
"Number of Swath S1 channels (10V 10H 19V 19H 23V 37V 37H 89V 89H).";
2266 else if((*irv)->name ==
"nchannel2")
2267 comment =
"Number of Swath S2 channels (166V 166H 183+/-3V 183+/-8V).";
2268 else if((*irv)->name ==
"nchan1")
2269 comment =
"Number of channels in Swath 1.";
2270 else if((*irv)->name ==
"nchan2")
2271 comment =
"Number of channels in Swath 2.";
2272 else if((*irv)->name ==
"VH")
2273 comment =
"Number of polarizations.";
2274 else if((*irv)->name ==
"GMIxyz")
2275 comment =
"x, y, z components in GMI instrument coordinate system.";
2276 else if((*irv)->name ==
"LNL")
2277 comment =
"Linear and non-linear.";
2278 else if((*irv)->name ==
"nscan")
2279 comment =
"Number of scans in the granule.";
2280 else if((*irv)->name ==
"nscan1")
2281 comment =
"Typical number of Swath S1 scans in the granule.";
2282 else if((*irv)->name ==
"nscan2")
2283 comment =
"Typical number of Swath S2 scans in the granule.";
2284 else if((*irv)->name ==
"npixelev")
2285 comment =
"Number of earth view pixels in one scan.";
2286 else if((*irv)->name ==
"npixelht")
2287 comment =
"Number of hot load pixels in one scan.";
2288 else if((*irv)->name ==
"npixelcs")
2289 comment =
"Number of cold sky pixels in one scan.";
2290 else if((*irv)->name ==
"npixelfr")
2291 comment =
"Number of full rotation earth view pixels in one scan.";
2292 else if((*irv)->name ==
"nfreq1")
2293 comment =
"Number of frequencies in Swath 1.";
2294 else if((*irv)->name ==
"nfreq2")
2295 comment =
"Number of frequencies in Swath 2.";
2296 else if((*irv)->name ==
"npix1")
2297 comment =
"Number of pixels in Swath 1.";
2298 else if((*irv)->name ==
"npix2")
2299 comment =
"Number of pixels in Swath 2.";
2300 else if((*irv)->name ==
"npix3")
2301 comment =
"Number of pixels in Swath 3.";
2302 else if((*irv)->name ==
"npix4")
2303 comment =
"Number of pixels in Swath 4.";
2304 else if((*irv)->name ==
"ncolds1")
2305 comment =
"Maximum number of cold samples in Swath 1.";
2306 else if((*irv)->name ==
"ncolds2")
2307 comment =
"Maximum number of cold samples in Swath 2.";
2308 else if((*irv)->name ==
"nhots1")
2309 comment =
"Maximum number of hot samples in Swath 1.";
2310 else if((*irv)->name ==
"nhots2")
2311 comment =
"Maximum number of hot samples in Swath 2.";
2312 else if((*irv)->name ==
"ntherm")
2313 comment =
"Number of hot load thermisters.";
2314 else if((*irv)->name ==
"ntach")
2315 comment =
"Number of tachometer readings.";
2316 else if((*irv)->name ==
"nsamt"){
2317 comment =
"Number of sample types. ";
2318 comment = +
"The types are: total science GSDR, earthview,hot load, cold sky.";
2320 else if((*irv)->name ==
"nndiode")
2321 comment =
"Number of noise diodes.";
2322 else if((*irv)->name ==
"n7")
2323 comment =
"Number seven.";
2324 else if((*irv)->name ==
"nray")
2325 comment =
"Number of angle bins in each NS scan.";
2326 else if((*irv)->name ==
"nrayMS")
2327 comment =
"Number of angle bins in each MS scan.";
2328 else if((*irv)->name ==
"nrayHS")
2329 comment =
"Number of angle bins in each HS scan.";
2330 else if((*irv)->name ==
"nbin")
2331 comment =
"Number of range bins in each NS and MS ray. Bin interval is 125m.";
2332 else if((*irv)->name ==
"nbinHS")
2333 comment =
"Number of range bins in each HS ray. Bin interval is 250m.";
2334 else if((*irv)->name ==
"nbinSZP")
2335 comment =
"Number of range bins for sigmaZeroProfile.";
2336 else if((*irv)->name ==
"nbinSZPHS")
2337 comment =
"Number of range bins for sigmaZeroProfile in each HS scan.";
2338 else if((*irv)->name ==
"nNP")
2339 comment =
"Number of NP kinds.";
2340 else if((*irv)->name ==
"nearFar")
2341 comment =
"Near reference, Far reference.";
2342 else if((*irv)->name ==
"foreBack")
2343 comment =
"Forward, Backward.";
2344 else if((*irv)->name ==
"method")
2345 comment =
"Number of SRT methods.";
2346 else if((*irv)->name ==
"nNode")
2347 comment =
"Number of binNode.";
2348 else if((*irv)->name ==
"nDSD")
2349 comment =
"Number of DSD parameters. Parameters are N0 and D0";
2350 else if((*irv)->name ==
"LS")
2351 comment =
"Liquid, solid.";
2358 (*irv)->attrs.push_back(attr);
2368 const string attrname =
"comment";
2372 if((*irv)->name ==
"chn")
2373 comment =
"Number of channels:Ku,Ka,KaHS,DPR.";
2374 else if((*irv)->name ==
"inst")
2375 comment =
"Number of instruments:Ku,Ka,KaHS.";
2376 else if((*irv)->name ==
"tim")
2377 comment =
"Number of hours(local time).";
2378 else if((*irv)->name ==
"ang"){
2379 comment =
"Number of angles.The meaning of ang is different for each channel.";
2381 "For Ku channel all indices are used with the meaning 0,1,2,..6 =angle bins 24,";
2383 "(20,28),(16,32),(12,36),(8,40),(3,44),and (0,48).";
2385 "For Ka channel 4 indices are used with the meaning 0,1,2,3 = angle bins 12,(8,16),";
2387 "(4,20),and (0,24). For KaHS channel 4 indices are used with the meaning 0,1,2,3 =";
2388 comment +=
"angle bins(11,2),(7,16),(3,20),and (0.23).";
2391 else if((*irv)->name ==
"rt")
2392 comment =
"Number of rain types: stratiform, convective,all.";
2393 else if((*irv)->name ==
"st")
2394 comment =
"Number of surface types:ocean,land,all.";
2395 else if((*irv)->name ==
"bin"){
2396 comment =
"Number of bins in histogram. The thresholds are different for different";
2397 comment +=
" variables. see the file specification for this algorithm.";
2399 else if((*irv)->name ==
"nvar") {
2400 comment =
"Number of phase bins. Bins are counts of phase less than 100, ";
2401 comment +=
"counts of phase greater than or equal to 100 and less than 200, ";
2402 comment +=
"counts of phase greater than or equal to 200.";
2404 else if((*irv)->name ==
"AD")
2405 comment =
"Ascending or descending half of the orbit.";
2412 (*irv)->attrs.push_back(attr);
2420 if((*irv)->name ==
"nlayer" || (*irv)->name ==
"hgt"
2421 || (*irv)->name ==
"nalt") {
2423 string unit_value =
"km";
2425 (*irv)->attrs.push_back(attr);
2428 string attr1_axis=
"axis";
2429 string attr1_value =
"Z";
2431 (*irv)->attrs.push_back(attr1);
2434 string attr2_positive=
"positive";
2435 string attr2_value =
"up";
2437 (*irv)->attrs.push_back(attr2);
2440 if((*irv)->name ==
"hgt" || (*irv)->name ==
"nalt"){
2442 string comment =
"Number of heights above the earth ellipsoid";
2444 (*irv)->attrs.push_back(attr1);
2456 const string fill_value_attr_name =
"_FillValue";
2457 vector<HDF5CF::Var *>::const_iterator it_v;
2458 vector<HDF5CF::Attribute *>::const_iterator ira;
2460 for (it_v =
vars.begin();
2461 it_v !=
vars.end(); ++it_v) {
2463 bool has_fillvalue =
false;
2464 for(ira = (*it_v)->attrs.begin(); ira!= (*it_v)->attrs.end();ira++) {
2465 if (fill_value_attr_name == (*ira)->name){
2466 has_fillvalue =
true;
2473 if (has_fillvalue !=
true ) {
2477 float _FillValue = -9999.9;
2479 (*it_v)->attrs.push_back(attr);
2490 vector<HDF5CF::Var *>::const_iterator it_v;
2491 vector<HDF5CF::Attribute *>::const_iterator ira;
2493 const string orig_longname_attr_name =
"Parameter";
2494 const string longname_attr_name =
"long_name";
2495 string longname_value;
2498 const string orig_units_attr_name =
"Units";
2499 const string units_attr_name =
"units";
2503 const string orig_valid_min_attr_name =
"Data Minimum";
2504 const string valid_min_attr_name =
"valid_min";
2505 float valid_min_value;
2507 const string orig_valid_max_attr_name =
"Data Maximum";
2508 const string valid_max_attr_name =
"valid_max";
2509 float valid_max_value;
2514 const string fill_value_attr_name =
"_FillValue";
2515 float _FillValue = -32767.0;
2520 if (orig_longname_attr_name == (*ira)->name) {
2522 longname_value.resize((*ira)->value.size());
2523 copy((*ira)->value.begin(),(*ira)->value.end(),longname_value.begin());
2526 else if (orig_units_attr_name == (*ira)->name) {
2528 units_value.resize((*ira)->value.size());
2529 copy((*ira)->value.begin(),(*ira)->value.end(),units_value.begin());
2532 else if (orig_valid_min_attr_name == (*ira)->name) {
2534 memcpy(&valid_min_value,(
void*)(&((*ira)->value[0])),(*ira)->value.size());
2537 else if (orig_valid_max_attr_name == (*ira)->name) {
2539 memcpy(&valid_max_value,(
void*)(&((*ira)->value[0])),(*ira)->value.size());
2545 for (it_v =
vars.begin();
2546 it_v !=
vars.end(); ++it_v) {
2547 if (
"l3m_data" == (*it_v)->name) {
2552 (*it_v)->attrs.push_back(attr);
2557 (*it_v)->attrs.push_back(attr);
2562 (*it_v)->attrs.push_back(attr);
2567 (*it_v)->attrs.push_back(attr);
2572 (*it_v)->attrs.push_back(attr);
2584 const string fill_value_attr_name =
"_FillValue";
2585 float _FillValue = -999.0;
2586 const string valid_range_attr_name =
"valid_range";
2587 vector<HDF5CF::Var *>::const_iterator it_v;
2588 vector<HDF5CF::Attribute *>::const_iterator ira;
2591 for (it_v =
vars.begin();
2592 it_v !=
vars.end(); ++it_v) {
2594 bool has_fillvalue =
false;
2595 bool has_validrange =
false;
2596 for(ira = (*it_v)->attrs.begin(); ira!= (*it_v)->attrs.end();ira++) {
2597 if (fill_value_attr_name == (*ira)->name){
2598 has_fillvalue =
true;
2602 else if(valid_range_attr_name == (*ira)->name) {
2603 has_validrange =
true;
2609 if (has_fillvalue !=
true && has_validrange !=
true ) {
2612 (*it_v)->attrs.push_back(attr);
2620 string co_attrname =
"coordinates";
2621 string co_attrvalue=
"";
2622 string unit_attrname =
"units";
2623 string nonll_unit_attrvalue =
"level";
2624 string lat_unit_attrvalue =
"degrees_north";
2625 string lon_unit_attrvalue =
"degrees_east";
2627 for (vector<GMCVar *>::iterator ircv = this->cvars.begin();
2628 ircv != this->cvars.end(); ++ircv) {
2634 (*ircv)->attrs.push_back(attr);
2643 (*ircv)->attrs.push_back(attr);
2650 (*ircv)->attrs.push_back(attr);
2657 else if(product_type ==
GPM_L1) {
2661 else if (
true == iscoard)
2664 for (vector<Var *>::iterator irv = this->
vars.begin();
2665 irv != this->
vars.end(); ++irv) {
2666 bool coor_attr_keep_exist =
false;
2668 for (vector<Attribute *>:: iterator ira =(*irv)->attrs.begin();
2669 ira !=(*irv)->attrs.end();++ira) {
2670 if (((*ira)->newname ==
"coordinates")) {
2671 if (product_type ==
SMAP) {
2672 coor_attr_keep_exist =
true;
2677 (*irv)->attrs.erase(ira);
2683 if (
true == coor_attr_keep_exist)
2686 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
2687 ird != (*irv)->dims.end(); ++ ird) {
2688 for (vector<GMCVar *>::iterator ircv = this->cvars.begin();
2689 ircv != this->cvars.end(); ++ircv) {
2690 if ((*ird)->name == (*ircv)->cfdimname)
2691 co_attrvalue = (co_attrvalue.empty())
2692 ?(*ircv)->newname:co_attrvalue +
" "+(*ircv)->newname;
2696 if (
false == co_attrvalue.empty()) {
2699 (*irv)->attrs.push_back(attr);
2702 co_attrvalue.clear();
2722 string co_attrname =
"coordinates";
2723 string co_attrvalue=
"";
2726 set<string> cvar_2d_dimset;
2728 pair<map<string,string>::iterator,
bool>mapret;
2731 map<string,string>cfdimname_to_cvar2dname;
2734 for (vector<GMCVar *>::iterator irv = this->cvars.begin();
2735 irv != this->cvars.end(); ++irv) {
2737 if((*irv)->rank == 2) {
2741 for(vector<Dimension *>::iterator ird = (*irv)->dims.begin();
2742 ird != (*irv)->dims.end(); ++ird) {
2743 cvar_2d_dimset.insert((*ird)->name);
2745 mapret = cfdimname_to_cvar2dname.insert(pair<string,string>((*irv)->cfdimname,(*irv)->newname));
2746 if (
false == mapret.second)
2747 throw4(
"The cf dimension name ",(*irv)->cfdimname,
" should map to 2-D coordinate variable",
2754 for (vector<Var *>::iterator irv = this->
vars.begin();
2755 irv != this->
vars.end(); ++irv) {
2758 if((*irv)->rank >=2) {
2762 short have_2d_dimnames_flag = 0;
2763 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
2764 ird !=(*irv)->dims.end();++ird) {
2765 if (cvar_2d_dimset.find((*ird)->name)!=cvar_2d_dimset.end())
2766 have_2d_dimnames_flag++;
2770 if(have_2d_dimnames_flag >=2) {
2775 if((*irv)->fullpath.size() > (*irv)->name.size())
2776 var_path=(*irv)->fullpath.substr(0,(*irv)->fullpath.size()-(*irv)->name.size());
2778 throw4(
"The variable full path ",(*irv)->fullpath,
" doesn't contain the variable name ",
2782 short cv_2d_flag = 0;
2785 vector<string> cv_2d_names;
2788 set<string> cv_2d_dimnames;
2791 for(map<string,string>::const_iterator itm = cfdimname_to_cvar2dname.begin();
2792 itm != cfdimname_to_cvar2dname.end();++itm) {
2797 if(itm->first.size() <= reduced_dimname.size())
2798 throw2(
"The cf dim. name of this dimension is not right.",itm->first);
2800 cfdim_path= itm->first.substr(0,itm->first.size() - reduced_dimname.size());
2811 if(var_path == cfdim_path) {
2812 for (vector<Dimension*>::iterator ird = (*irv)->dims.begin();
2813 ird!=(*irv)->dims.end();++ird) {
2814 if(reduced_dimname == (*ird)->name) {
2816 cv_2d_names.push_back(itm->second);
2817 cv_2d_dimnames.insert((*ird)->name);
2830 if(cv_2d_flag !=2) {
2833 for(map<string,string>::const_iterator itm = cfdimname_to_cvar2dname.begin();
2834 itm != cfdimname_to_cvar2dname.end();++itm) {
2838 if(itm->first.size() <= reduced_dimname.size())
2839 throw2(
"The cf dim. name of this dimension is not right.",itm->first);
2841 cfdim_path= itm->first.substr(0,itm->first.size() - reduced_dimname.size());
2850 if(var_path.find(cfdim_path)!=string::npos) {
2851 for (vector<Dimension*>::iterator ird = (*irv)->dims.begin();
2852 ird!=(*irv)->dims.end();++ird) {
2853 if(reduced_dimname == (*ird)->name) {
2855 cv_2d_names.push_back(itm->second);
2856 cv_2d_dimnames.insert((*ird)->name);
2863 if(2 == cv_2d_flag) {
2866 co_attrvalue = cv_2d_names[0] +
" " + cv_2d_names[1];
2867 if((*irv)->rank >2) {
2868 for (vector<Dimension *>::iterator ird = (*irv)->dims.begin();
2869 ird !=(*irv)->dims.end();++ird) {
2872 if(cv_2d_dimnames.find((*ird)->name) == cv_2d_dimnames.end())
2873 co_attrvalue = co_attrvalue +
" " +(*ird)->newname;
2878 (*irv)->attrs.push_back(attr);
2891 GMcvar->name = dimname;
2892 GMcvar->newname = GMcvar->name;
2893 GMcvar->fullpath = GMcvar->name;
2896 hsize_t gmcvar_dimsize = dimname_to_dimsize[dimname];
2898 gmcvar_dim->
name = dimname;
2899 gmcvar_dim->
newname = dimname;
2900 GMcvar->dims.push_back(gmcvar_dim);
2901 GMcvar->cfdimname = dimname;
2903 GMcvar->product_type = product_type;
2910 string netcdf_dim_mark =
"This is a netCDF dimension but not a netCDF variable";
2912 bool is_only_dimension =
false;
2914 for(vector<Attribute *>::iterator ira = var->attrs.begin();
2915 ira != var->attrs.end();ira++) {
2917 if (
"NAME" == (*ira)->name) {
2919 Retrieve_H5_Attr_Value(*ira,var->fullpath);
2921 name_value.resize((*ira)->value.size());
2922 copy((*ira)->value.begin(),(*ira)->value.end(),name_value.begin());
2925 if (0 == name_value.compare(0,netcdf_dim_mark.size(),netcdf_dim_mark))
2926 is_only_dimension =
true;
2932 return is_only_dimension;
void Adjust_H5_Attr_Value(Attribute *attr)
Adjust attribute values for general HDF5 products.
void Flatten_Obj_Name(bool include_attr)
Flatten the object name for general NASA HDF5 products.
void Retrieve_H5_Attr_Value(Attribute *attr, string)
#define throw5(a1, a2, a3, a4, a5)
void Handle_GMSPVar_AttrNameClashing()
vector< Dimension * > dims
void Handle_SpVar()
Handle special variables for general NASA HDF5 products.
void Create_Missing_CV(GMCVar *, const string &)
This class represents one HDF5 dataset(CF variable)
void Handle_Coor_Attr()
Handle "coordinates" attributes for general HDF5 products.
void Handle_CVar()
Handle coordinate variables for general NASA HDF5 products.
void Adjust_GPM_L3_Obj_Name()
void Handle_DimNameClashing()
Handle dimension name clashing. Since COARDS requires the change of cv names, So we need to handle di...
void Handle_GPM_l1_Coor_Attr()
void Add_Dim_Name()
Add dimension name.
void Handle_GeneralObj_NameClashing(bool, set< string > &objnameset)
void Add_Dim_Name_Dimscale_General_Product()
void Add_UseDimscale_Var_Dim_Names_Mea_SeaWiFS_Ozone(Var *, Attribute *)
bool check_cv(string &varname)
virtual void Retrieve_H5_Info(const char *path, hid_t file_id, bool include_attr)
Retrieve DDS information from the HDF5 file. The reason to separate reading DDS from DAS is: DAP need...
void Handle_CVar_Dimscale_General_Product()
void Handle_Obj_NameClashing(bool)
Handle object name clashing for general NASA HDF5 products.
void GMHandle_General_NameClashing(set< string > &objnameset, vector< T * > &objvec)
This class is a derived class of Var. It represents a special general HDF5 product(currently ACOS) ...
void Add_Dim_Name_ACOS_L2S()
void Handle_CVar_Aqu_L3()
void Add_One_FakeDim_Name(Dimension *dim)
This class is a derived class of CVar. It represents a coordinate variable for general HDF5 files...
virtual void Handle_Unsupported_Dtype(bool)
Handle unsupported HDF5 datatypes.
set< string > dimnamelist
void Handle_SpVar_Attr()
Handle special variable attributes for general NASA HDF5 products.
void Add_Dim_Name_Mea_SeaWiFS()
virtual void Retrieve_H5_Supported_Attr_Values()
Retrieve attribute values for the supported HDF5 datatypes.
static void gen_unique_name(std::string &str, std::set< std::string > &namelist, int &clash_index)
void Handle_CVar_OBPG_L3()
virtual void Add_Supplement_Attrs(bool)
Add supplemental attributes such as fullpath and original name.
This class retrieves all information from an HDF5 file.
vector< Var * > vars
Var vectors.
virtual string get_CF_string(string)
void Add_Str_Attr(Attribute *attr, const string &attrname, const string &strvalue)
void Adjust_Duplicate_FakeDim_Name(Dimension *dim)
virtual void Handle_Unsupported_Dspace()
Handle unsupported HDF5 dataspaces for datasets.
void Adjust_Mea_Ozone_Obj_Name()
void Handle_CVar_GPM_L3()
void Handle_CVar_GPM_L1()
void Retrieve_H5_Supported_Attr_Values()
Retrieve attribute values for the supported HDF5 datatypes for general HDF5 products.
#define throw1(a1)
The followings are convenient functions to throw exceptions with different.
void Adjust_Dim_Name()
Adjust dimension name for general NASA HDF5 products.
void Change_Attr_One_Str_to_Others(Attribute *attr, Var *var)
void Add_Dim_Name_Aqu_L3()
void Handle_Unsupported_Dtype(bool)
Handle unsupported HDF5 datatypes for general HDF5 products.
void Handle_UseDimscale_Var_Dim_Names_Mea_SeaWiFS_Ozone(Var *)
GMFile(const char *path, hid_t file_id, H5GCFProduct product, GMPattern gproduct_pattern)
static std::string obtain_string_after_lastslash(const std::string s)
void Add_Dim_Name_Mea_Ozonel3z()
map< string, hsize_t > dimname_to_dimsize
vector< Attribute * > attrs
This class represents one attribute.
static void Split(const char *s, int len, char sep, std::vector< std::string > &names)
From a string separated by a separator to a list of string, for example, split "ab,c" to {"ab","c"}.
void Handle_Unsupported_Dspace()
Handle unsupported HDF5 dataspaces for general HDF5 products.
bool Is_netCDF_Dimension(Var *var)
void Check_General_Product_Pattern()
void Add_One_Float_Attr(Attribute *attr, const string &attrname, float float_value)
#define throw3(a1, a2, a3)
void Handle_CVar_Mea_Ozone()
void Handle_GMCVar_NameClashing(set< string > &)
void Handle_GMSPVar_NameClashing(set< string > &)
void Handle_UseDimscale_Var_Dim_Names_General_Product(Var *)
bool unsupported_attr_dtype
void Adjust_Obj_Name()
Adjust object names based on different general NASA HDF5 products.
This class repersents one dimension of an HDF5 dataset(variable).
void Handle_CVar_Mea_SeaWiFS()
void Add_Dim_Name_General_Product()
void Insert_One_NameSizeMap_Element(string name, hsize_t size)
void Handle_GMCVar_AttrNameClashing()
bool unsupported_var_dspace
static bool cf_strict_support_type(H5DataType dtype)
string get_CF_string(string s)
void Add_UseDimscale_Var_Dim_Names_General_Product(Var *, Attribute *)
#define throw4(a1, a2, a3, a4)
virtual void Flatten_Obj_Name(bool)
Flatten the object name.
void Add_Supplement_Attrs(bool)
Add supplemental attributes such as fullpath and original name for general NASA HDF5 products...
vector< Group * > groups
Non-root group vectors.
This class specifies the core engineering of mapping HDF5 to DAP by following CF. ...
void Handle_General_NameClashing(set< string > &objnameset, vector< T * > &objvec)
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...
vector< Attribute * > root_attrs
Root attribute vectors.
void Add_Dim_Name_OBPG_L3()