bes  Updated for version 3.20.6
HDFSP.h
1 // This file is part of the hdf4 data handler for the OPeNDAP data server.
12 // TRMM version 7 Level2
13 // TRMM version 7 Level3
23 
32 
33 
34 //#include "InternalErr.h"
35 #ifndef _HDFSP_H
36 #define _HDFSP_H
37 
38 #include <iostream>
39 #include <sstream>
40 #include <string>
41 #include <vector>
42 #include <map>
43 #include <set>
44 #include <list>
45 #include "mfhdf.h"
46 #include "hdf.h"
47 
48 #include "HDFSPEnumType.h"
49 
50 #define MAX_FULL_PATH_LEN 1024
51 //#define EOS_DATA_PATH "Data Fields"
52 //#define EOS_GEO_PATH "Geolocation Fields"
53 
54 #define _HDF_CHK_TBL_CLASS "_HDF_CHK_TBL_"
55 #define CERE_META_NAME "CERES_metadata"
56 #define CERE_META_FIELD_NAME "LOCALGRANULEID"
57 #define SENSOR_NAME "Sensor Name"
58 #define PRO_NAME "Product Name"
59 #define CER_AVG_NAME "CER_AVG"
60 #define CER_ES4_NAME "CER_ES4"
61 #define CER_CDAY_NAME "CER_ISCCP-D2like-Day"
62 #define CER_CGEO_NAME "CER_ISCCP-D2like-GEO"
63 #define CER_SRB_NAME "CER_SRBAVG3"
64 #define CER_SYN_NAME "CER_SYN"
65 #define CER_ZAVG_NAME "CER_ZAVG"
66 
67 
82 
83 
84 
85 namespace HDFSP
86 {
89  class File;
90  class SD;
91  class VDATA;
92 
93  class Exception:public std::exception
94  {
95  public:
96 
98  explicit Exception (const std::string & msg)
99  : message (msg)
100  {
101  }
102 
104  virtual ~ Exception () throw ()
105  {
106  }
107 
109  virtual const char *what () const throw ()
110  {
111  return this->message.c_str ();
112  }
113 
115  virtual void setException (std::string exception_message)
116  {
117  this->message = exception_message;
118  }
119 
120 
121  private:
123  std::string message;
124  };
125 
126 
129  class Dimension
130  {
131  public:
132 
134  const std::string & getName () const
135  {
136  return this->name;
137  }
138 
140  int32 getSize () const
141  {
142  return this->dimsize;
143  }
144 
147  int32 getType () const
148  {
149  return this->dimtype;
150  }
151 
152  protected:
153  Dimension (const std::string & dim_name, int32 hdf4_dimsize, int32 hdf4_dimtype)
154  : name (dim_name), dimsize (hdf4_dimsize), dimtype (hdf4_dimtype)
155  {
156  }
157 
158  private:
159  // dimension name
160  std::string name;
161 
162  // dimension size
163  int32 dimsize;
164 
166  int32 dimtype;
167 
168  friend class SD;
169  friend class File;
170  friend class SDField;
171  };
172 
174  class Attribute
175  {
176  public:
177 
179  const std::string & getName () const
180  {
181  return this->name;
182  }
183 
185  const std::string & getNewName () const
186  {
187  return this->newname;
188  }
189 
191  int32 getType () const
192  {
193  return this->type;
194  }
195 
197  int32 getCount () const
198  {
199  return this->count;
200  }
201 
203  const std::vector < char >&getValue () const
204  {
205  return this->value;
206  }
207 
208  private:
209 
211  std::string name;
212 
214  std::string newname;
215 
217  int32 type;
218 
220  int32 count;
221 
223  std::vector < char >value;
224 
225  friend class SD;
226  friend class VDATA;
227  friend class File;
228  friend class Field;
229  friend class VDField;
230  };
231 
237 
238  public:
239  AttrContainer()
240  {
241  name="";
242  }
243  ~AttrContainer();
244 
245 
247  const std::string & getName () const
248  {
249  return this->name;
250  }
251 
254 #if 0
255  // const std::string & getNewName () const
256  //{
257  // return this->newname;
258  //}
259 #endif
260  const std::vector < Attribute * >&getAttributes () const
261  {
262  return this->attrs;
263  }
264 
265  private:
266  // std:: string newname;
267 
268  // The name of this attribute container(an attribute container is a DAP DAS table)
269  std:: string name;
270 
271  // The attributes in this attribute container
272  std::vector < Attribute * >attrs;
273  friend class SD;
274  friend class File;
275 
276  };
277 
278 
279  // This field class describes SDS or Vdata fields.
280  class Field
281  {
282  public:
283  Field ():type (-1), rank (-1)
284  {
285  name="";
286  newname="";
287  }
288  virtual ~ Field ();
289 
291  const std::string & getName () const
292  {
293  return this->name;
294  }
295 
297  const std::string & getNewName () const
298  {
299  return this->newname;
300  }
301 
303  int32 getRank () const
304  {
305  return this->rank;
306  }
307 
309  int32 getType () const
310  {
311  return this->type;
312  }
313 
315  const std::vector < Attribute * >&getAttributes () const
316  {
317  return this->attrs;
318  }
319 
320 
321  protected:
322 
324  std::string newname;
325 
327  std::string name;
328 
330  int32 type;
331 
333  int32 rank;
334 
336  std::vector < Attribute * >attrs;
337 
338  friend class SD;
339  friend class VDATA;
340  friend class File;
341  };
342 
344 
345  class SDField:public Field
346  {
347  public:
348  SDField ()
349  :fieldtype (0), fieldref (-1), condenseddim (false),is_noscale_dim(false),is_dim_scale(false)
350  {
351  coordinates="";
352  units="";
353  special_product_fullpath="";
354  rootfieldname="";
355  }
356  ~SDField ();
357 
358 
360  const std::vector < Dimension * >&getCorrectedDimensions () const
361  {
362  return this->correcteddims;
363  }
364 
366  std::vector < Dimension * >*getCorrectedDimensionsPtr ()
367  {
368  return &(this->correcteddims);
369  }
370 
372  void setCorrectedDimensions (std::vector < Dimension * >cor_dims)
373  {
374  correcteddims = cor_dims;
375  }
376 
378  const std::string getCoordinate () const
379  {
380  return this->coordinates;
381  }
382 
384  void setCoordinates (std::string coor)
385  {
386  coordinates = coor;
387  }
388 
390  const std::string getUnits () const
391  {
392  return this->units;
393  }
394 
395  // Set the "units" attribute
396  void setUnits (std::string uni)
397  {
398  units = uni;
399  }
400 
401  // Get the field type
402  int getFieldType () const
403  {
404  return this->fieldtype;
405  }
406 
407  // Get the SDS reference number
408  int32 getFieldRef () const
409  {
410  return this->fieldref;
411  }
412 
414  const std::vector < Dimension * >&getDimensions () const
415  {
416  return this->dims;
417  }
418 
420  const std::vector < AttrContainer * >&getDimInfo () const
421  {
422  return this->dims_info;
423  }
424 
425 
427  bool IsDimNoScale() const
428  {
429  return is_noscale_dim;
430  }
431 
433  bool IsDimScale() const
434  {
435  return is_dim_scale;
436  }
437 
439  const std::string getSpecFullPath() const
440  {
441  return special_product_fullpath;
442  }
443  private:
444 
446  std::vector < Dimension * >dims;
447 
451  std::vector < Dimension * >correcteddims;
452 
454  std::vector<AttrContainer *>dims_info;
455 
456  std::string coordinates;
457 
464  int fieldtype;
465 
467  std::string units;
468 
479  std::string special_product_fullpath;
480 
482  int32 fieldref;
483 
485  bool condenseddim;
486 
489  bool is_noscale_dim;
490 
492  bool is_dim_scale;
493 
496  std::string rootfieldname;
497 
498  friend class File;
499  friend class SD;
500  };
501 
503  class VDField:public Field
504  {
505  public:
506  VDField ():order (-1), numrec (-1), size (-1)
507  {
508  }
509  ~VDField ();
510 
512  int32 getFieldOrder ()const
513  {
514  return this->order;
515  }
516 
518  int32 getFieldsize () const
519  {
520  return this->size;
521  }
522 
524  int32 getNumRec () const
525  {
526  return this->numrec;
527  }
528 
530  const std::vector < char >&getValue () const
531  {
532  return this->value;
533  }
534 
536  void ReadAttributes (int32 vdata_id, int32 fieldindex) throw (Exception);
537 
538  private:
539 
541  int32 order;
542 
544  int32 numrec;
545 
547  int32 size;
548 
550  std::vector < char >value;
551 
552  friend class File;
553  friend class VDATA;
554  };
555 
557  class SD
558  {
559  public:
560 
562  static SD *Read (int32 sdfileid, int32 hfileid) throw (Exception);
563 
565  static SD *Read_Hybrid (int32 sdfileid, int32 hfileid) throw (Exception);
566 
568 #if 0
569  const std::string & getPath () const
571  {
572  return this->path;
573  }
574 #endif
575 
577  const std::vector < SDField * >&getFields () const
578  {
579  return this->sdfields;
580  }
581 
583  const std::vector < Attribute * >&getAttributes () const
584  {
585  return this->attrs;
586  }
587 
589  void obtain_noneos2_sds_path(int32,char*,int32) throw(Exception);
590 
591 
593  ~SD ();
594 
595  protected:
596  SD (int32 sdfileid, int32 hfileid)
597  : sdfd (sdfileid), fileid (hfileid)
598  {
599  }
600 
602  std::vector < SDField * >sdfields;
603 
605  std::vector < Attribute * >attrs;
606 
608  std::list <int32> sds_ref_list;
609 
611  std::map < int32, int >refindexlist;
612 
615  std::map < std::string, int32 > n1dimnamelist;
616 
618  std::map < std::string, std::string > n2dimnamelist;
619 
621  std::set < std::string > fulldimnamelist;
622 
626  std::set < std::string > nonmisscvdimnamelist;
627 
629  std::map < std::string, std::string > dimcvarlist;
630 
631  private:
632 
634  int32 sdfd;
636  int32 fileid;
637  friend class File;
638  };
639 
641  class VDATA
642  {
643  public:
644 
645  ~VDATA ();
646 
648  static VDATA *Read (int32 vdata_id, int32 obj_ref) throw (Exception);
649 
651  void ReadAttributes (int32 vdata_id) throw (Exception);
652 
654  const std::string & getNewName () const
655  {
656  return this->newname;
657  }
658 
660  const std::string & getName () const
661  {
662  return this->name;
663  }
664 
666  const std::vector < VDField * >&getFields () const
667  {
668  return this->vdfields;
669  }
670 
672  const std::vector < Attribute * >&getAttributes () const
673  {
674  return this->attrs;
675  }
676 
680  bool getTreatAsAttrFlag () const
681  {
682  return TreatAsAttrFlag;
683  }
684 
686  int32 getObjRef () const
687  {
688  return vdref;
689  }
690 
691  protected:
692  VDATA (int32 vdata_myid, int32 obj_ref)
693  :vdref(obj_ref),TreatAsAttrFlag (true),vdata_id (vdata_myid) {
694  newname ="";
695  name ="";
696  }
697 
699  std::string newname;
700 
702  std::string name;
703 
705  std::vector < VDField * >vdfields;
706 
708  std::vector < Attribute * >attrs;
709 
711  int32 vdref;
712 
715 
716  private:
717 
719  int32 vdata_id;
720 
721  friend class File;
722  };
723 
726  class File
727  {
728  public:
729 
731  static File *Read (const char *path, int32 sdid,int32 fileid) throw (Exception);
732 
735  static File *Read_Hybrid (const char *path, int32 sdid,
736  int32 fileid) throw (Exception);
737 
741  void Prepare() throw(Exception);
742 
743  bool Check_update_special(const std::string &gridname) throw(Exception);
744 
745  void Handle_AIRS_L23() throw(Exception);
746 
747 
749  SPType getSPType () const
750  {
751  return this->sptype;
752  }
753 
755 
757  {
758  return this->OTHERHDF_Has_Dim_NoScale_Field;
759  }
760 
761  // Destructor
762  ~File ();
763 
765  const std::string & getPath () const
766  {
767  return this->path;
768  }
769 
771  SD *getSD () const
772  {
773  return this->sd;
774  }
775 
777  const std::vector < VDATA * >&getVDATAs () const
778  {
779  return this->vds;
780  }
781 
783  const std::vector<AttrContainer *> &getVgattrs () const
784  {
785  return this->vg_attrs;
786  }
787 
788 
789 
790  protected:
791  explicit File (const char *hdf4file_path)
792  : path (hdf4file_path), sd(NULL),sdfd (-1), fileid (-1), sptype (OTHERHDF),OTHERHDF_Has_Dim_NoScale_Field(false),EOS2Swathflag(false)
793  {
794  }
795 
796 
798  std::string path;
799 
801  SD *sd;
802 
804  std::vector < VDATA * >vds;
805 
807  std::vector<AttrContainer *>vg_attrs;
808 
811  void handle_sds_fakedim_names() throw(Exception);
812 
815 
818 
821 
823  void handle_sds_names(bool & COARDFLAG , std::string & lldimname1, std::string &lldimname2) throw(Exception);
824 
826  void handle_sds_coords(bool & COARDFLAG, std::string &lldimname1,std::string &lldimname2) throw(Exception);
827 
829  void handle_vdata() throw(Exception);
830 
832  void CheckSDType () throw (Exception);
833 
835  void PrepareTRMML2_V6 () throw (Exception);
836 
838  void PrepareTRMML3A_V6 () throw (Exception);
839 
841  void PrepareTRMML3B_V6 () throw (Exception);
842 
844  void PrepareTRMML3C_V6 () throw (Exception);
845 
847  void Obtain_TRMML3S_V7_latlon_size(int &latsize, int&lonsize);
848 
849  bool Obtain_TRMM_V7_latlon_name(const SDField* sdfield, const int latsize, const int lonsize, std::string& latname, std::string& lonname) throw(Exception);
850 
852  void PrepareTRMML2_V7 () throw (Exception);
853 
855  void PrepareTRMML3S_V7 () throw (Exception);
856 
858  void PrepareTRMML3M_V7 () ;
859 
860 
863  void PrepareCERAVGSYN () throw (Exception);
864 
867  void PrepareCERES4IG () throw (Exception);
868 
872  void PrepareCERSAVGID () throw (Exception);
873 
875  void PrepareCERZAVG () throw (Exception);
876 
878  void PrepareOBPGL2 () throw (Exception);
879 
881  void PrepareOBPGL3 () throw (Exception);
882 
885  void PrepareMODISARNSS () throw (Exception);
886 
888  void PrepareOTHERHDF () throw (Exception);
889 
891  void ReadLoneVdatas(File*) throw(Exception);
892 
895  void ReadHybridNonLoneVdatas(File*) throw(Exception);
896 
898  void ReadVgattrs(int32 vgroup_id, char *fullpath) throw(Exception);
899 
902 
904  void obtain_path (int32 file_id, int32 sd_id, char *full_path, int32 pobj_ref) throw (Exception);
905 
907  void obtain_vdata_path(int32 file_id, char *full_path, int32 pobj_ref) throw (Exception);
908 
909 
910  private:
911 
913  int32 sdfd;
914 
916  int32 fileid;
917 
919  SPType sptype;
920 
922  bool OTHERHDF_Has_Dim_NoScale_Field;
923 
926  bool EOS2Swathflag;
927  };
928 
929 }
930 
931 
932 #endif
HDFSP::SD::getAttributes
const std::vector< Attribute * > & getAttributes() const
Public interface to obtain the SD(file) attributes.
Definition: HDFSP.h:583
HDFSP::File::getVDATAs
const std::vector< VDATA * > & getVDATAs() const
Public interface to Obtain Vdata.
Definition: HDFSP.h:777
HDFSP::VDATA::vdfields
std::vector< VDField * > vdfields
Vdata field vectors.
Definition: HDFSP.h:705
HDFSP::VDField::getFieldsize
int32 getFieldsize() const
Get the field size.
Definition: HDFSP.h:518
HDFSP::File::PrepareTRMML3C_V6
void PrepareTRMML3C_V6()
Special method to prepare TRMM Level 3 CSH latitude,longitude and Height information.
Definition: HDFSP.cc:5427
HDFSP::SD::getFields
const std::vector< SDField * > & getFields() const
Redundant member function.
Definition: HDFSP.h:577
HDFSP::VDField::getNumRec
int32 getNumRec() const
Get the number of record.
Definition: HDFSP.h:524
HDFSP::File::PrepareOBPGL2
void PrepareOBPGL2()
Special method to prepare OBPG Level 2 latitude and longitude information. The latitude and longitude...
Definition: HDFSP.cc:5586
HDFSP::SD::dimcvarlist
std::map< std::string, std::string > dimcvarlist
dimension name to coordinate variable name list: the key list to generate CF "coordinates" attributes...
Definition: HDFSP.h:629
HDFSP::File::sd
SD * sd
Pointer to the SD instance. There is only one SD instance in an HDF4 file.
Definition: HDFSP.h:801
HDFSP::VDATA::getAttributes
const std::vector< Attribute * > & getAttributes() const
Obtain Vdata attributes.
Definition: HDFSP.h:672
HDFSP::AttrContainer::getAttributes
const std::vector< Attribute * > & getAttributes() const
Definition: HDFSP.h:260
HDFSP::SD
This class retrieves all SDS objects and SD file attributes.
Definition: HDFSP.h:557
HDFSP::SDField
One instance of this class represents one SDS object.
Definition: HDFSP.h:345
HDFSP::SDField::getCorrectedDimensionsPtr
std::vector< Dimension * > * getCorrectedDimensionsPtr()
Get the list of the corrected dimension ptrs.
Definition: HDFSP.h:366
HDFSP::SDField::setCorrectedDimensions
void setCorrectedDimensions(std::vector< Dimension * >cor_dims)
Set the list of the corrected dimensions.
Definition: HDFSP.h:372
HDFSP::File::Obtain_TRMML3S_V7_latlon_size
void Obtain_TRMML3S_V7_latlon_size(int &latsize, int &lonsize)
void Obtain_TRMML3S_V7_latlon_size(int &latsize, int&lonsize) throw(Exception);
Definition: HDFSP.cc:4304
HDFSP::SD::Read_Hybrid
static SD * Read_Hybrid(int32 sdfileid, int32 hfileid)
Read the information of all hybrid SDS objects from the HDF4 file.
Definition: HDFSP.cc:1948
HDFSP::File::getSPType
SPType getSPType() const
Obtain special HDF4 product type.
Definition: HDFSP.h:749
HDFSP::File::InsertOrigFieldPath_ReadVgVdata
void InsertOrigFieldPath_ReadVgVdata()
The full path of SDS and Vdata will be obtained.
Definition: HDFSP.cc:2747
HDFSP::Attribute::getName
const std::string & getName() const
Get the attribute name.
Definition: HDFSP.h:179
HDFSP::VDATA::vdref
int32 vdref
Vdata reference number.
Definition: HDFSP.h:711
HDFSP::File::ReadVgattrs
void ReadVgattrs(int32 vgroup_id, char *fullpath)
Obtain vgroup attributes.
Definition: HDFSP.cc:2693
HDFSP::SDField::getCoordinate
const std::string getCoordinate() const
Get the "coordinates" attribute.
Definition: HDFSP.h:378
HDFSP::VDATA::TreatAsAttrFlag
bool TreatAsAttrFlag
Flag to map vdata fields to DAP variables or DAP attributes.
Definition: HDFSP.h:714
HDFSP::VDATA::ReadAttributes
void ReadAttributes(int32 vdata_id)
Retrieve all attributes of this Vdata.
Definition: HDFSP.cc:2568
HDFSP::File::vg_attrs
std::vector< AttrContainer * > vg_attrs
Vgroup attribute information. See the description of the class AttrContainer.
Definition: HDFSP.h:807
HDFSP::File::PrepareTRMML3A_V6
void PrepareTRMML3A_V6()
Special method to prepare TRMM Level 3A46 latitude and longitude information.
Definition: HDFSP.cc:5257
HDFSP::File::getSD
SD * getSD() const
Public interface to Obtain SD.
Definition: HDFSP.h:771
HDFSP::Dimension::getType
int32 getType() const
Definition: HDFSP.h:147
HDFSP::VDATA::getNewName
const std::string & getNewName() const
Obtain new names(with the path and special characters and name clashing handlings)
Definition: HDFSP.h:654
HDFSP::Exception::~ Exception
virtual ~ Exception()
Destructor.
Definition: HDFSP.h:104
HDFSP::SD::fulldimnamelist
std::set< std::string > fulldimnamelist
Full dimension name list set.
Definition: HDFSP.h:621
HDFSP::Field
Definition: HDFSP.h:280
HDFSP::Attribute::getNewName
const std::string & getNewName() const
Get the CF attribute name(special characters are replaced by underscores)
Definition: HDFSP.h:185
HDFSP::File::PrepareCERSAVGID
void PrepareCERSAVGID()
Definition: HDFSP.cc:6057
HDFSP::File::CheckSDType
void CheckSDType()
This method will check if the HDF4 file is one of TRMM or OBPG products we supported.
Definition: HDFSP.cc:1290
HDFSP::VDATA::newname
std::string newname
New name with path and CF compliant(no special characters and name clashing).
Definition: HDFSP.h:699
HDFSP::Field::getNewName
const std::string & getNewName() const
Get the CF name(special characters replaced by underscores) of this field.
Definition: HDFSP.h:297
HDFSP::File::handle_sds_fakedim_names
void handle_sds_fakedim_names()
Definition: HDFSP.cc:3641
HDFSP::File::handle_sds_final_dim_names
void handle_sds_final_dim_names()
Create the final CF-compliant dimension name list for each field.
Definition: HDFSP.cc:3775
HDFSP::Exception::what
virtual const char * what() const
Return exception message.
Definition: HDFSP.h:109
HDFSP::File::path
std::string path
The absolute path of the file.
Definition: HDFSP.h:798
HDFSP::Field::attrs
std::vector< Attribute * > attrs
The attributes of this field.
Definition: HDFSP.h:336
HDFSP::File::PrepareTRMML3M_V7
void PrepareTRMML3M_V7()
Special method to prepare TRMM multiple grid Level 3 geolocation fields(latitude,longitude,...
Definition: HDFSP.cc:4840
HDFSP::Field::getType
int32 getType() const
Get the data type of this field.
Definition: HDFSP.h:309
HDFSP::File::handle_sds_missing_fields
void handle_sds_missing_fields()
Add the missing coordinate variables based on the corrected dimension name list.
Definition: HDFSP.cc:3739
HDFSP::File::PrepareOBPGL3
void PrepareOBPGL3()
Special method to prepare OBPG Level 3 latitude and longitude information. The latitude and longitude...
Definition: HDFSP.cc:5671
HDFSP::VDATA::attrs
std::vector< Attribute * > attrs
Vdata attribute vectors.
Definition: HDFSP.h:708
HDFSP::File::PrepareMODISARNSS
void PrepareMODISARNSS()
Definition: HDFSP.cc:6253
HDFSP::Dimension::getName
const std::string & getName() const
Get dimension name.
Definition: HDFSP.h:134
HDFSP::SD::sds_ref_list
std::list< int32 > sds_ref_list
SDS reference number list.
Definition: HDFSP.h:608
HDFSP::VDATA::getName
const std::string & getName() const
Obtain the original vdata name.
Definition: HDFSP.h:660
HDFSP::SDField::setCoordinates
void setCoordinates(std::string coor)
Set the coordinate attribute.
Definition: HDFSP.h:384
HDFSP::SD::Read
static SD * Read(int32 sdfileid, int32 hfileid)
Read the information of all SDS objects from the HDF4 file.
Definition: HDFSP.cc:1599
HDFSP::AttrContainer::getName
const std::string & getName() const
Get the name of this attribute container.
Definition: HDFSP.h:247
HDFSP::File::PrepareCERAVGSYN
void PrepareCERAVGSYN()
Definition: HDFSP.cc:5830
HDFSP::VDField::getValue
const std::vector< char > & getValue() const
Get the vdata field values.
Definition: HDFSP.h:530
HDFSP::File::PrepareOTHERHDF
void PrepareOTHERHDF()
We still provide a hook for other HDF data product although no CF compliant is followed.
Definition: HDFSP.cc:6305
HDFSP::SDField::getDimInfo
const std::vector< AttrContainer * > & getDimInfo() const
Get the list of OHTERHDF dimension attribute container information.
Definition: HDFSP.h:420
HDFSP::SDField::getCorrectedDimensions
const std::vector< Dimension * > & getCorrectedDimensions() const
Get the list of the corrected dimensions.
Definition: HDFSP.h:360
HDFSP::File
Definition: HDFSP.h:726
HDFSP::File::handle_vdata
void handle_vdata()
Handle Vdata.
Definition: HDFSP.cc:4092
HDFSP::File::PrepareTRMML2_V6
void PrepareTRMML2_V6()
Latitude and longitude are stored in one array(geolocation). Need to separate.
Definition: HDFSP.cc:4992
HDFSP::Dimension
Definition: HDFSP.h:129
HDFSP::File::getVgattrs
const std::vector< AttrContainer * > & getVgattrs() const
Get attributes for all vgroups.
Definition: HDFSP.h:783
HDFSP::VDATA::getTreatAsAttrFlag
bool getTreatAsAttrFlag() const
Definition: HDFSP.h:680
HDFSP::Exception::setException
virtual void setException(std::string exception_message)
Set exception message.
Definition: HDFSP.h:115
HDFSP::SD::~SD
~SD()
Destructor.
Definition: HDFSP.cc:152
HDFSP::Field::newname
std::string newname
The CF full path(special characters replaced by underscores) of this field.
Definition: HDFSP.h:324
HDFSP::VDATA::getFields
const std::vector< VDField * > & getFields() const
Obtain Vdata fields.
Definition: HDFSP.h:666
HDFSP::SD::obtain_noneos2_sds_path
void obtain_noneos2_sds_path(int32, char *, int32)
Obtain SDS path, this is like a clone of obtain_path in File class, except the Vdata and some minor p...
Definition: HDFSP.cc:3316
HDFSP::File::ReadLoneVdatas
void ReadLoneVdatas(File *)
Handle non-attribute lone vdatas.
Definition: HDFSP.cc:314
HDFSP::Field::getRank
int32 getRank() const
Get the dimension rank of this field.
Definition: HDFSP.h:303
HDFSP::Field::getAttributes
const std::vector< Attribute * > & getAttributes() const
Get the attributes of this field.
Definition: HDFSP.h:315
HDFSP::Field::type
int32 type
The datatype of this field.
Definition: HDFSP.h:330
HDFSP::File::Prepare
void Prepare()
Definition: HDFSP.cc:4144
HDFSP::SDField::getSpecFullPath
const std::string getSpecFullPath() const
This function returns the full path of some special products that have a very long path.
Definition: HDFSP.h:439
HDFSP::SD::nonmisscvdimnamelist
std::set< std::string > nonmisscvdimnamelist
Definition: HDFSP.h:626
HDFSP::File::ReadHybridNonLoneVdatas
void ReadHybridNonLoneVdatas(File *)
Definition: HDFSP.cc:553
HDFSP::Field::getName
const std::string & getName() const
Get the name of this field.
Definition: HDFSP.h:291
HDFSP::VDATA::name
std::string name
Original vdata name.
Definition: HDFSP.h:702
HDFSP::SD::n2dimnamelist
std::map< std::string, std::string > n2dimnamelist
Original dimension name to corrected dimension name map.
Definition: HDFSP.h:618
HDFSP::Attribute::getCount
int32 getCount() const
Get the number of elements of this attribute.
Definition: HDFSP.h:197
HDFSP
Definition: HDFSP.h:85
HDFSP::File::handle_sds_coords
void handle_sds_coords(bool &COARDFLAG, std::string &lldimname1, std::string &lldimname2)
Create "coordinates", "units" CF attributes.
Definition: HDFSP.cc:4008
HDFSP::Field::rank
int32 rank
The rank of this field.
Definition: HDFSP.h:333
HDFSP::File::Read
static File * Read(const char *path, int32 sdid, int32 fileid)
Retrieve SDS and Vdata information from the HDF4 file.
Definition: HDFSP.cc:202
HDFSP::File::obtain_vdata_path
void obtain_vdata_path(int32 file_id, char *full_path, int32 pobj_ref)
The internal function used to obtain the path for hybrid non-lone vdata.
Definition: HDFSP.cc:3422
HDFSP::SD::refindexlist
std::map< int32, int > refindexlist
SDS reference number to index map, use to quickly obtain the SDS id.
Definition: HDFSP.h:611
HDFSP::File::handle_sds_names
void handle_sds_names(bool &COARDFLAG, std::string &lldimname1, std::string &lldimname2)
Create the final CF-compliant field name list.
Definition: HDFSP.cc:3823
HDFSP::File::PrepareTRMML3B_V6
void PrepareTRMML3B_V6()
Special method to prepare TRMM Level 3B latitude and longitude information.
Definition: HDFSP.cc:5149
HDFSP::File::vds
std::vector< VDATA * > vds
Vdata objects in this file.
Definition: HDFSP.h:804
HDFSP::VDATA::Read
static VDATA * Read(int32 vdata_id, int32 obj_ref)
Retrieve all information of this Vdata.
Definition: HDFSP.cc:2380
HDFSP::File::PrepareCERES4IG
void PrepareCERES4IG()
Definition: HDFSP.cc:5917
HDFSP::File::create_sds_dim_name_list
void create_sds_dim_name_list()
Create the new dimension name set and the dimension name to size map.
Definition: HDFSP.cc:3716
HDFSP::SDField::getDimensions
const std::vector< Dimension * > & getDimensions() const
Get the list of dimensions.
Definition: HDFSP.h:414
HDFSP::VDATA::getObjRef
int32 getObjRef() const
Obtain Vdata reference number, this is necessary for retrieving Vdata information from HDF4.
Definition: HDFSP.h:686
HDFSP::Field::name
std::string name
The original name of this field.
Definition: HDFSP.h:327
HDFSP::File::Read_Hybrid
static File * Read_Hybrid(const char *path, int32 sdid, int32 fileid)
Definition: HDFSP.cc:257
HDFSP::File::PrepareTRMML3S_V7
void PrepareTRMML3S_V7()
Special method to prepare TRMM single grid Level 3 geolocation fields(latitude,longitude,...
Definition: HDFSP.cc:4504
HDFSP::SD::sdfields
std::vector< SDField * > sdfields
SDS objects stored in vectors.
Definition: HDFSP.h:602
HDFSP::Exception
Definition: HDFSP.h:93
HDFSP::File::PrepareTRMML2_V7
void PrepareTRMML2_V7()
Latitude and longitude are stored in different fields. Need to separate.
Definition: HDFSP.cc:4354
HDFSP::Attribute::getValue
const std::vector< char > & getValue() const
Get the attribute value.
Definition: HDFSP.h:203
HDFSP::File::PrepareCERZAVG
void PrepareCERZAVG()
Special method to prepare CERES Zonal Average latitude and longitude information.
Definition: HDFSP.cc:6202
HDFSP::SD::attrs
std::vector< Attribute * > attrs
SD attributes stored in vectors.
Definition: HDFSP.h:605
HDFSP::Dimension::getSize
int32 getSize() const
Get dimension size.
Definition: HDFSP.h:140
HDFSP::SDField::IsDimNoScale
bool IsDimNoScale() const
Is this field a dimension without dimension scale(or empty[no data]dimension variable)
Definition: HDFSP.h:427
HDFSP::File::getPath
const std::string & getPath() const
Obtain the path of the file.
Definition: HDFSP.h:765
HDFSP::File::Has_Dim_NoScale_Field
bool Has_Dim_NoScale_Field() const
This file has a field that is a SDS dimension but no dimension scale.
Definition: HDFSP.h:756
HDFSP::VDField
One instance of this class represents one Vdata field.
Definition: HDFSP.h:503
HDFSP::File::obtain_path
void obtain_path(int32 file_id, int32 sd_id, char *full_path, int32 pobj_ref)
The internal function used by InsertOrigFieldPath_ReadVgVdata.
Definition: HDFSP.cc:3085
HDFSP::Attribute
Representing one attribute in grid or swath.
Definition: HDFSP.h:174
HDFSP::Exception::Exception
Exception(const std::string &msg)
Constructor.
Definition: HDFSP.h:98
HDFSP::SDField::IsDimScale
bool IsDimScale() const
Is this field a dimension scale field?
Definition: HDFSP.h:433
HDFSP::VDField::getFieldOrder
int32 getFieldOrder() const
Get the order of this field.
Definition: HDFSP.h:512
HDFSP::SDField::getUnits
const std::string getUnits() const
Get the "units" attribute.
Definition: HDFSP.h:390
HDFSP::Attribute::getType
int32 getType() const
Get the attribute datatype.
Definition: HDFSP.h:191
HDFSP::VDField::ReadAttributes
void ReadAttributes(int32 vdata_id, int32 fieldindex)
Read vdata field attributes.
Definition: HDFSP.cc:2630
HDFSP::VDATA
This class retrieves all information of one Vdata.
Definition: HDFSP.h:641
HDFSP::AttrContainer
Definition: HDFSP.h:236
HDFSP::SD::n1dimnamelist
std::map< std::string, int32 > n1dimnamelist
Definition: HDFSP.h:615