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

Static Public Member Functions

static void add_missing_cf_attrs (const HDFSP::File *f, libdap::DAS &das)
 
static void add_obpg_special_attrs (const HDFSP::File *f, libdap::DAS &das, const HDFSP::SDField *spsds, const std::string &scaling, float &slope, const bool &global_slope_flag, float &intercept, const 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.
 
static std::string get_CF_string (std::string s)
 Change special characters to "_".
 
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 (const 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.
 
static void Handle_NameClashing (std::vector< std::string > &newobjnamelist, std::set< std::string > &objnameset)
 
static void handle_otherhdf_special_attrs (const HDFSP::File *f, libdap::DAS &das)
 
static void handle_vdata_attrs_with_desc_key (const 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, const int32 *offset, const int32 *count, const 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 (const HDFSP::File *)
 
static short obtain_type_size (int32)
 Obtain datatype size.
 
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.
 
static std::string print_type (int32)
 Print datatype in string.
 
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.
 
static void write_sp_sds_dds_cache (const HDFSP::File *, FILE *, size_t, const std::string &fname)
 

Detailed Description

Definition at line 65 of file HDFCFUtil.h.

Member Function Documentation

◆ add_missing_cf_attrs()

void HDFCFUtil::add_missing_cf_attrs ( const HDFSP::File f,
libdap::DAS &  das 
)
static

Definition at line 2190 of file HDFCFUtil.cc.

◆ add_obpg_special_attrs()

void HDFCFUtil::add_obpg_special_attrs ( const HDFSP::File f,
libdap::DAS &  das,
const HDFSP::SDField spsds,
const std::string &  scaling,
float &  slope,
const bool global_slope_flag,
float &  intercept,
const bool global_intercept_flag 
)
static

Definition at line 1958 of file HDFCFUtil.cc.

◆ check_obpg_global_attrs()

void HDFCFUtil::check_obpg_global_attrs ( HDFSP::File f,
std::string &  scaling,
float &  slope,
bool global_slope_flag,
float &  intercept,
bool global_intercept_flag 
)
static

Definition at line 1882 of file HDFCFUtil.cc.

◆ 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 3650 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 549 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 616 of file HDFCFUtil.cc.

◆ dtoa()

void HDFCFUtil::dtoa ( double  n,
char *  res,
int  afterpoint 
)
static

Definition at line 3544 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 3309 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 196 of file HDFCFUtil.cc.

◆ get_CF_string()

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

Change special characters to "_".

Definition at line 166 of file HDFCFUtil.cc.

◆ get_double_str()

string HDFCFUtil::get_double_str ( double  x,
int  total_digit,
int  after_point 
)
static

Definition at line 3575 of file HDFCFUtil.cc.

◆ get_int_str()

string HDFCFUtil::get_int_str ( int  x)
static

Definition at line 3607 of file HDFCFUtil.cc.

◆ handle_merra_ceres_attrs_with_bes_keys()

void HDFCFUtil::handle_merra_ceres_attrs_with_bes_keys ( const HDFSP::File f,
libdap::DAS &  das,
const std::string &  filename 
)
static

Definition at line 2761 of file HDFCFUtil.cc.

◆ Handle_NameClashing() [1/2]

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

General routines to handle name clashings.

Definition at line 260 of file HDFCFUtil.cc.

◆ Handle_NameClashing() [2/2]

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

Definition at line 218 of file HDFCFUtil.cc.

◆ handle_otherhdf_special_attrs()

void HDFCFUtil::handle_otherhdf_special_attrs ( const HDFSP::File f,
libdap::DAS &  das 
)
static

Definition at line 2097 of file HDFCFUtil.cc.

◆ handle_vdata_attrs_with_desc_key()

void HDFCFUtil::handle_vdata_attrs_with_desc_key ( const HDFSP::File f,
libdap::DAS &  das 
)
static

Definition at line 2814 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 150 of file HDFCFUtil.cc.

◆ int_to_str()

int HDFCFUtil::int_to_str ( int  x,
char  str[],
int  d 
)
static

Definition at line 3524 of file HDFCFUtil.cc.

◆ LatLon2DSubset()

template<typename T >
void HDFCFUtil::LatLon2DSubset ( T *  outlatlon,
int  ydim,
int  xdim,
T *  latlon,
const int32 *  offset,
const int32 *  count,
const int32 *  step 
)
static

Definition at line 500 of file HDFCFUtil.cc.

◆ map_eos2_objects_attrs()

void HDFCFUtil::map_eos2_objects_attrs ( libdap::DAS &  das,
const string &  filename 
)
static

Definition at line 3023 of file HDFCFUtil.cc.

◆ map_eos2_one_object_attrs()

void HDFCFUtil::map_eos2_one_object_attrs ( libdap::DAS &  das,
int32  file_id,
int32  obj_attr_group_id,
const string &  vgroup_name 
)
static

Definition at line 3206 of file HDFCFUtil.cc.

◆ map_eos2_one_object_attrs_wrapper()

void HDFCFUtil::map_eos2_one_object_attrs_wrapper ( libdap::DAS &  das,
int32  file_id,
int32  vgroup_id,
const string &  vgroup_name,
bool  is_grid 
)
static

Definition at line 3147 of file HDFCFUtil.cc.

◆ obtain_cache_fname()

string HDFCFUtil::obtain_cache_fname ( const std::string &  fprefix,
const std::string &  fname,
const std::string &  vname 
)
static

Definition at line 3670 of file HDFCFUtil.cc.

◆ obtain_dds_cache_size()

size_t HDFCFUtil::obtain_dds_cache_size ( const HDFSP::File spf)
static

Definition at line 3689 of file HDFCFUtil.cc.

◆ obtain_type_size()

short HDFCFUtil::obtain_type_size ( int32  type)
static

Obtain datatype size.

Definition at line 450 of file HDFCFUtil.cc.

◆ parser_trmm_v7_gridheader()

void HDFCFUtil::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

Definition at line 3343 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 268 of file HDFCFUtil.cc.

◆ print_type()

string HDFCFUtil::print_type ( int32  type)
static

Print datatype in string.

Definition at line 389 of file HDFCFUtil.cc.

◆ read_buffer_from_file()

ssize_t HDFCFUtil::read_buffer_from_file ( int  fd,
void *  buf,
size_t  total_read 
)
static

Definition at line 3643 of file HDFCFUtil.cc.

◆ read_sp_sds_dds_cache()

void HDFCFUtil::read_sp_sds_dds_cache ( FILE *  dds_file,
libdap::DDS *  dds_ptr,
const std::string &  filename,
const std::string &  hdf_filename 
)
static

Definition at line 3844 of file HDFCFUtil.cc.

◆ read_vector_from_file()

ssize_t HDFCFUtil::read_vector_from_file ( int  fd,
vector< double > &  val,
size_t  dtypesize 
)
static

Definition at line 3635 of file HDFCFUtil.cc.

◆ rev_str()

void HDFCFUtil::rev_str ( char *  str,
int  len 
)
static

Definition at line 3506 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 82 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 102 of file HDFCFUtil.cc.

◆ write_sp_sds_dds_cache()

void HDFCFUtil::write_sp_sds_dds_cache ( const HDFSP::File spf,
FILE *  dds_file,
size_t  total_bytes_dds_cache,
const std::string &  fname 
)
static

Definition at line 3728 of file HDFCFUtil.cc.


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