|
OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
|
#include <HDFCFUtil.h>

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 bool | check_beskeys (const std::string &key) |
| Check the BES key. This function will check a BES key specified at the file h4.conf.in. If the key's value is either true or yes. The handler claims to find a key and will do some operations. Otherwise, will do different operations. For example, One may find a line H4.EnableCF=true at h4.conf.in. That means, the HDF4 handler will handle the HDF4 files by following CF conventions. More... | |
| 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) |
| 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. More... | |
| static void | correct_fvalue_type (libdap::AttrTable *at, int32 dtype) |
| 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. More... | |
| static void | correct_scale_offset_type (libdap::AttrTable *at) |
| 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. More... | |
| static void | dtoa (double, char *, int) |
| static std::string | escattr (std::string s) |
| 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),(tab),(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. More... | |
| 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) |
| 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. More... | |
| 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 | 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_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) |
| From a string separated by a separator to a list of string, for example, split "ab,c" to {"ab","c"}. More... | |
| static void | Split (const char *sz, char sep, std::vector< std::string > &names) |
| Assume sz is Null terminated string. More... | |
Definition at line 62 of file HDFCFUtil.h.
|
static |
Definition at line 1671 of file HDFCFUtil.cc.
References comment, HDFSP::SD::getFields(), HDFSP::File::getPath(), HDFSP::File::getSD(), HDFSP::File::getSPType(), NULL, print_attr(), print_type(), TRMML2_V7, TRMML3A_V6, TRMML3C_V6, TRMML3M_V7, and TRMML3S_V7.
Referenced by read_das_hdfsp().

|
static |
Definition at line 1452 of file HDFCFUtil.cc.
References GET_INTERCEPT, GET_SLOPE, HDFSP::Field::getAttributes(), HDFSP::SDField::getFieldType(), HDFSP::Field::getNewName(), HDFSP::File::getSPType(), HDFSP::Field::getType(), OBPGL2, OBPGL3, print_attr(), and print_type().
Referenced by read_das_hdfsp().

|
static |
Check the BES key. This function will check a BES key specified at the file h4.conf.in. If the key's value is either true or yes. The handler claims to find a key and will do some operations. Otherwise, will do different operations. For example, One may find a line H4.EnableCF=true at h4.conf.in. That means, the HDF4 handler will handle the HDF4 files by following CF conventions.
Definition at line 17 of file HDFCFUtil.cc.
References BESKeys::get_value(), BESUtil::lowercase(), and TheBESKeys::TheKeys().
Referenced by handle_merra_ceres_attrs_with_bes_keys(), HDFSP::File::handle_sds_names(), HDFSP::File::handle_vdata(), handle_vdata_attrs_with_desc_key(), HDF4RequestHandler::hdf4_build_das(), HDF4RequestHandler::hdf4_build_data(), HDF4RequestHandler::hdf4_build_data_with_IDs(), HDF4RequestHandler::hdf4_build_dds(), HDFSPArray_RealField::read(), HDFSPArray_VDField::read(), HDFCFStr::read(), HDFCFStrField::read(), HDFSP::VDATA::Read(), read_das_hdfsp(), and read_dds_hdfsp().

|
static |
Definition at line 1384 of file HDFCFUtil.cc.
References GET_INTERCEPT, GET_SLOPE, HDFSP::SD::getAttributes(), HDFSP::File::getSD(), HDFSP::File::getSPType(), OBPGL2, and OBPGL3.
Referenced by read_das_hdfsp().

|
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 2881 of file HDFCFUtil.cc.
Referenced by HDFSPArray_RealField::read(), HDFSPArray_VDField::read(), HDFCFStr::read(), and HDFCFStrField::read().
|
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 395 of file HDFCFUtil.cc.
References print_type().
Referenced by read_das_hdfsp().

|
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 462 of file HDFCFUtil.cc.
Referenced by read_das_hdfsp().
|
static |
Definition at line 2739 of file HDFCFUtil.cc.
|
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),(tab),(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 2502 of file HDFCFUtil.cc.
Referenced by handle_vdata_attrs_with_desc_key(), read_das_hdfsp(), read_das_special_eos2_core(), and HE2CF::set_non_ecsmetadata_attrs().
|
static |
Obtain the unique name for the clashed names and save it to set namelist.
Definition at line 110 of file HDFCFUtil.cc.
Referenced by Handle_NameClashing().
|
static |
Change special characters to "_".
Definition at line 80 of file HDFCFUtil.cc.
Referenced by HDFSP::File::handle_sds_final_dim_names(), HDFSP::File::handle_sds_names(), HDFSP::File::InsertOrigFieldPath_ReadVgVdata(), HDFSP::File::obtain_path(), HDFSP::File::obtain_vdata_path(), HDFSP::SD::Read(), HDFSP::VDATA::Read(), HDFSP::SD::Read_Hybrid(), HDFSP::VDField::ReadAttributes(), HDFSP::VDATA::ReadAttributes(), HDFSP::File::ReadHybridNonLoneVdatas(), HDFSP::File::ReadLoneVdatas(), HDFSP::File::ReadVgattrs(), and HE2CF::set_non_ecsmetadata_attrs().
|
static |
Definition at line 2770 of file HDFCFUtil.cc.
|
static |
Definition at line 2803 of file HDFCFUtil.cc.
|
static |
Definition at line 2246 of file HDFCFUtil.cc.
References CER_AVG, CER_CDAY, CER_CGEO, CER_ES4, CER_SRB, CER_SYN, CER_ZAVG, check_beskeys(), HDFSP::SD::getAttributes(), HDFSP::SD::getFields(), HDFSP::File::getSD(), and HDFSP::File::getSPType().
Referenced by read_das_hdfsp().

|
static |
General routines to handle name clashings.
Definition at line 176 of file HDFCFUtil.cc.
Referenced by HDFSP::File::handle_sds_final_dim_names(), HDFSP::File::handle_sds_names(), and HDFSP::File::handle_vdata().
|
static |
Definition at line 132 of file HDFCFUtil.cc.
References gen_unique_name().

|
static |
Definition at line 1577 of file HDFCFUtil.cc.
References HDFSP::SD::getFields(), HDFSP::File::getSD(), HDFSP::File::getSPType(), HDFSP::File::Has_Dim_NoScale_Field(), and OTHERHDF.
Referenced by read_das_hdfsp().

|
static |
Definition at line 2295 of file HDFCFUtil.cc.
References CER_AVG, CER_ES4, CER_SRB, CER_ZAVG, check_beskeys(), escattr(), HDFSP::File::getSPType(), HDFSP::File::getVDATAs(), print_attr(), and print_type().
Referenced by read_das_hdfsp().

|
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 64 of file HDFCFUtil.cc.
References BESDEBUG.
Referenced by HDFSP::File::handle_sds_final_dim_names(), HDFSP::File::handle_sds_names(), and HDFSP::File::PrepareOTHERHDF().
|
static |
Definition at line 2719 of file HDFCFUtil.cc.
|
static |
Definition at line 353 of file HDFCFUtil.cc.
|
static |
Definition at line 2534 of file HDFCFUtil.cc.
Referenced by HDFSP::File::Obtain_TRMML3S_V7_latlon_size(), and HDFSP::File::PrepareTRMML3M_V7().

|
static |
Print attribute values in string.
Definition at line 184 of file HDFCFUtil.cc.
Referenced by add_missing_cf_attrs(), add_obpg_special_attrs(), change_das_mod08_scale_offset(), handle_vdata_attrs_with_desc_key(), read_das_hdfsp(), read_das_special_eos2_core(), HE2CF::set_non_ecsmetadata_attrs(), and HE2CF::write_attribute_FillValue().
|
static |
Print datatype in string.
Definition at line 290 of file HDFCFUtil.cc.
Referenced by add_missing_cf_attrs(), add_obpg_special_attrs(), change_das_mod08_scale_offset(), correct_fvalue_type(), handle_vdata_attrs_with_desc_key(), read_das_hdfsp(), read_das_special_eos2_core(), HE2CF::set_non_ecsmetadata_attrs(), and HE2CF::write_attribute_FillValue().
|
static |
Definition at line 2863 of file HDFCFUtil.cc.
|
static |
Definition at line 2701 of file HDFCFUtil.cc.
|
static |
From a string separated by a separator to a list of string, for example, split "ab,c" to {"ab","c"}.
Definition at line 38 of file HDFCFUtil.cc.
Referenced by parser_trmm_v7_gridheader().
|
static |
Assume sz is Null terminated string.
Definition at line 53 of file HDFCFUtil.cc.