bes  Updated for version 3.20.6
HDFCFUtil Struct Reference
Collaboration diagram for HDFCFUtil:
Collaboration graph

Static Public Member Functions

static void add_missing_cf_attrs (HDFSP::File *f, libdap::DAS &das)
 
static void add_obpg_special_attrs (HDFSP::File *f, libdap::DAS &das, HDFSP::SDField *spsds, std::string &scaling, float &slope, bool &global_slope_flag, float &intercept, bool &global_intercept_flag)
 
static void check_obpg_global_attrs (HDFSP::File *f, std::string &scaling, float &slope, bool &global_slope_flag, float &intercept, bool &global_intercept_flag)
 
static void close_fileid (int32 sdfd, int32 file_id, int32 gridfd, int32 swathfd, bool pass_fileid_key)
 
static void correct_fvalue_type (libdap::AttrTable *at, int32 dtype)
 
static void correct_scale_offset_type (libdap::AttrTable *at)
 
static void dtoa (double, char *, int)
 
static std::string escattr (std::string s)
 
static void gen_unique_name (std::string &str, std::set< std::string > &namelist, int &clash_index)
 Obtain the unique name for the clashed names and save it to set namelist. More...
 
static std::string get_CF_string (std::string s)
 Change special characters to "_". More...
 
static std::string get_double_str (double, int, int)
 
static std::string get_int_str (int)
 
static void handle_merra_ceres_attrs_with_bes_keys (HDFSP::File *f, libdap::DAS &das, const std::string &filename)
 
static void Handle_NameClashing (std::vector< std::string > &newobjnamelist)
 General routines to handle name clashings. More...
 
static void Handle_NameClashing (std::vector< std::string > &newobjnamelist, std::set< std::string > &objnameset)
 
static void handle_otherhdf_special_attrs (HDFSP::File *f, libdap::DAS &das)
 
static void handle_vdata_attrs_with_desc_key (HDFSP::File *f, libdap::DAS &das)
 
static bool insert_map (std::map< std::string, std::string > &m, std::string key, std::string val)
 
static int int_to_str (int, char str[], int)
 
template<typename T >
static void LatLon2DSubset (T *outlatlon, int ydim, int xdim, T *latlon, int32 *offset, int32 *count, int32 *step)
 
static void map_eos2_objects_attrs (libdap::DAS &das, const string &filename)
 
static void map_eos2_one_object_attrs (libdap::DAS &das, int32 file_id, int32 obj_attr_group_id, const string &vgroup_name)
 
static void map_eos2_one_object_attrs_wrapper (libdap::DAS &das, int32 file_id, int32 vgroup_id, const string &vgroup_name, bool is_grid)
 
static std::string obtain_cache_fname (const std::string &fprefix, const std::string &fname, const std::string &vname)
 
static size_t obtain_dds_cache_size (HDFSP::File *)
 
static short obtain_type_size (int32)
 Obtain datatype size. More...
 
static void parser_trmm_v7_gridheader (const std::vector< char > &value, int &latsize, int &lonsize, float &lat_start, float &lon_start, float &lat_res, float &lon_res, bool check_reg_orig)
 
static std::string print_attr (int32, int, void *)
 Print attribute values in string. More...
 
static std::string print_type (int32)
 Print datatype in string. More...
 
static ssize_t read_buffer_from_file (int fd, void *buf, size_t)
 
static void read_sp_sds_dds_cache (FILE *, libdap::DDS *dds_ptr, const std::string &filename, const std::string &hdf_filename)
 
static ssize_t read_vector_from_file (int fd, vector< double > &, size_t)
 
static void rev_str (char *str, int len)
 
static void Split (const char *s, int len, char sep, std::vector< std::string > &names)
 
static void Split (const char *sz, char sep, std::vector< std::string > &names)
 Assume sz is Null terminated string. More...
 
static void write_sp_sds_dds_cache (HDFSP::File *, FILE *, size_t, const std::string &fname)
 

Detailed Description

Definition at line 64 of file HDFCFUtil.h.

Member Function Documentation

◆ close_fileid()

void HDFCFUtil::close_fileid ( int32  sdfd,
int32  file_id,
int32  gridfd,
int32  swathfd,
bool  pass_fileid_key 
)
static

Close HDF4 and HDF-EOS2 file IDs. For performance reasons, we want to keep HDF-EOS2/HDF4 IDs open for one operation(DDS,DAS or DATA). In case of exceptions, these IDs need to be closed.

Definition at line 3685 of file HDFCFUtil.cc.

◆ correct_fvalue_type()

void HDFCFUtil::correct_fvalue_type ( libdap::AttrTable *  at,
int32  dtype 
)
static

CF requires the _FillValue attribute datatype is the same as the corresponding field datatype. For some NASA files, this is not true. So we need to check if the _FillValue's datatype is the same as the attribute's. If not, we need to correct them.

Definition at line 544 of file HDFCFUtil.cc.

◆ correct_scale_offset_type()

void HDFCFUtil::correct_scale_offset_type ( libdap::AttrTable *  at)
static

CF requires the scale_factor and add_offset attribute datatypes hold the same datatype. So far we haven't found that scale_factor and add_offset attributes hold different datatypes in NASA files. But just in case, we implement a BES key to give users a chance to check this. By default, the key is always off.

Definition at line 611 of file HDFCFUtil.cc.

◆ escattr()

string HDFCFUtil::escattr ( std::string  s)
static

A customized escaping function to escape special characters following OPeNDAP's escattr function that can be found at escaping.cc and escaping.h. i Note: the customized version will not treat
(new line),\t(tab),\r(Carriage return) as special characters since NASA HDF files use this characters to make the attribute easy to read. Escaping these characters in the attributes will use \012 etc to replace
etc. in these attributes and make attributes hard to read.

Definition at line 3275 of file HDFCFUtil.cc.

◆ gen_unique_name()

void HDFCFUtil::gen_unique_name ( std::string &  str,
std::set< std::string > &  namelist,
int &  clash_index 
)
static

Obtain the unique name for the clashed names and save it to set namelist.

Definition at line 191 of file HDFCFUtil.cc.

◆ get_CF_string()

string HDFCFUtil::get_CF_string ( std::string  s)
static

Change special characters to "_".

Definition at line 161 of file HDFCFUtil.cc.

◆ Handle_NameClashing()

void HDFCFUtil::Handle_NameClashing ( std::vector< std::string > &  newobjnamelist)
static

General routines to handle name clashings.

Definition at line 257 of file HDFCFUtil.cc.

◆ insert_map()

bool HDFCFUtil::insert_map ( std::map< std::string, std::string > &  m,
std::string  key,
std::string  val 
)
static

This is a safer way to insert and update a c++ map value. Otherwise, the local testsuite at The HDF Group will fail for HDF-EOS2 data under iMac machine platform.

Definition at line 145 of file HDFCFUtil.cc.

◆ obtain_type_size()

short HDFCFUtil::obtain_type_size ( int32  type)
static

Obtain datatype size.

Definition at line 447 of file HDFCFUtil.cc.

◆ print_attr()

string HDFCFUtil::print_attr ( int32  type,
int  loc,
void *  vals 
)
static

Print attribute values in string.

Definition at line 265 of file HDFCFUtil.cc.

◆ print_type()

string HDFCFUtil::print_type ( int32  type)
static

Print datatype in string.

Definition at line 386 of file HDFCFUtil.cc.

◆ Split() [1/2]

void HDFCFUtil::Split ( const char *  s,
int  len,
char  sep,
std::vector< std::string > &  names 
)
static

From a string separated by a separator to a list of string, for example, split "ab,c" to {"ab","c"}

Definition at line 77 of file HDFCFUtil.cc.

◆ Split() [2/2]

void HDFCFUtil::Split ( const char *  sz,
char  sep,
std::vector< std::string > &  names 
)
static

Assume sz is Null terminated string.

Definition at line 97 of file HDFCFUtil.cc.


The documentation for this struct was generated from the following files: