icedb
version 0.5.1
Snow particle scattering database API
|
Namespaces | |
ScopedHandles | |
This makes it much easier to automatically close HDF5 handles that are no longer used. | |
Classes | |
struct | ShapeCommonOptionalData |
struct | ShapeDataBasic |
struct | ShapeRequiredData |
Typedefs | |
typedef std::vector< uint64_t > | IntData_t |
typedef std::vector< uint8_t > | Int8Data_t |
typedef std::vector< float > | FloatData_t |
typedef std::vector< std::string > | StringData_t |
typedef hid_t | MatchType_t |
Functions | |
ShapeDataBasic | readTextFile (const std::string &filename) |
void | readHeader (const char *in, std::string &desc, size_t &np, size_t &headerEnd) |
void | readDDSCATtextContents (const char *iin, size_t numExpectedPoints, size_t headerEnd, ShapeDataBasic &p) |
Read ddscat text contents. More... | |
ShapeDataBasic | readDDSCAT (const char *in) |
void | writeDDSCAT (const std::string &filename, const ShapeDataBasic &p) |
ShapeDataBasic | readRawText (const char *iin) |
void | writeTextRaw (const std::string &filename, const ShapeDataBasic &p) |
size_t | strints_array_to_floats (const char *in, const size_t inlen, float *out, const size_t outlen, float &max_element) |
size_t | array_to_floats (const char *in, const size_t inlen, float *out, const size_t outlen) |
template<class T > | |
T | m_atof (const char *x, size_t len) |
template<class T > | |
T | m_atoi (const char *x, size_t len) |
template<class DataType > | |
MatchType_t | MatchType () |
template<> | |
MatchType_t | MatchType< int32_t > () |
template<> | |
MatchType_t | MatchType< float > () |
template<typename T > | |
void | readDataset (hid_t file_id, const char *dataset_name, std::vector< T > &outdata) |
ShapeDataBasic | readPSUfile (const std::string &filename) |
Reads a Penn State-style geometry file. More... | |
typedef std::vector< float > icedb::Examples::Shapes::FloatData_t |
typedef std::vector< uint8_t > icedb::Examples::Shapes::Int8Data_t |
typedef std::vector< uint64_t > icedb::Examples::Shapes::IntData_t |
typedef hid_t icedb::Examples::Shapes::MatchType_t |
Definition at line 75 of file shapeIOpsu.cpp.
typedef std::vector< std::string > icedb::Examples::Shapes::StringData_t |
size_t icedb::Examples::Shapes::array_to_floats | ( | const char * | in, |
const size_t | inlen, | ||
float * | out, | ||
const size_t | outlen | ||
) |
Definition at line 47 of file shapeIOtextParsers2.cpp.
T icedb::Examples::Shapes::m_atof | ( | const char * | x, |
size_t | len | ||
) |
Definition at line 142 of file shapeIOtextParsers2.cpp.
T icedb::Examples::Shapes::m_atoi | ( | const char * | x, |
size_t | len | ||
) |
Definition at line 266 of file shapeIOtextParsers2.cpp.
References icedb::Examples::Shapes::ShapeCommonOptionalData::hint_max_scattering_element_dimension, icedb::Examples::Shapes::ShapeRequiredData::number_of_particle_constituents, icedb::Examples::Shapes::ShapeRequiredData::number_of_particle_scattering_elements, icedb::Examples::Shapes::ShapeDataBasic::optional, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_constituent_number, icedb::Examples::Shapes::ShapeRequiredData::particle_id, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_scattering_element_composition_whole, icedb::Examples::Shapes::ShapeRequiredData::particle_scattering_element_coordinates, icedb::Examples::Shapes::ShapeRequiredData::particle_scattering_element_coordinates_are_integral, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_scattering_element_number, readDDSCAT(), readDDSCATtextContents(), readHeader(), readRawText(), readTextFile(), icedb::Examples::Shapes::ShapeDataBasic::required, and strints_array_to_floats().
MatchType_t icedb::Examples::Shapes::MatchType | ( | ) |
Definition at line 77 of file shapeIOpsu.cpp.
References ICEDB_throw, and icedb::error::xUnimplementedFunction.
MatchType_t icedb::Examples::Shapes::MatchType< float > | ( | ) |
Definition at line 85 of file shapeIOpsu.cpp.
MatchType_t icedb::Examples::Shapes::MatchType< int32_t > | ( | ) |
Definition at line 82 of file shapeIOpsu.cpp.
void icedb::Examples::Shapes::readDataset | ( | hid_t | file_id, |
const char * | dataset_name, | ||
std::vector< T > & | outdata | ||
) |
Definition at line 90 of file shapeIOpsu.cpp.
References icedb::error::xError::add(), icedb::Examples::Shapes::ScopedHandles::ScopedHandle< HandleType, InvalidValueClass, CloseMethod >::h, ICEDB_throw, icedb::Examples::Shapes::ScopedHandles::ScopedHandle< HandleType, InvalidValueClass, CloseMethod >::valid(), and icedb::error::xBadInput.
Referenced by readPSUfile().
ShapeDataBasic icedb::Examples::Shapes::readDDSCAT | ( | const char * | in | ) |
Definition at line 238 of file shapeIOtextParsers.cpp.
References readDDSCATtextContents(), and readHeader().
Referenced by m_atoi(), and readTextFile().
void icedb::Examples::Shapes::readDDSCATtextContents | ( | const char * | iin, |
size_t | numExpectedPoints, | ||
size_t | headerEnd, | ||
ShapeDataBasic & | p | ||
) |
Read ddscat text contents.
Read ddscat text contents - the stuff after the header.
Definition at line 187 of file shapeIOtextParsers.cpp.
References icedb::Examples::Shapes::ShapeRequiredData::number_of_particle_constituents, icedb::Examples::Shapes::ShapeRequiredData::number_of_particle_scattering_elements, icedb::Examples::Shapes::ShapeDataBasic::optional, anonymous_namespace{shapeIOtextParsers.cpp}::parse_shapefile_entries(), icedb::Examples::Shapes::ShapeCommonOptionalData::particle_constituent_number, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_scattering_element_composition_whole, icedb::Examples::Shapes::ShapeRequiredData::particle_scattering_element_coordinates, icedb::Examples::Shapes::ShapeRequiredData::particle_scattering_element_coordinates_are_integral, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_scattering_element_number, and icedb::Examples::Shapes::ShapeDataBasic::required.
Referenced by m_atoi(), and readDDSCAT().
void icedb::Examples::Shapes::readHeader | ( | const char * | in, |
std::string & | desc, | ||
size_t & | np, | ||
size_t & | headerEnd | ||
) |
Definition at line 113 of file shapeIOtextParsers.cpp.
Referenced by m_atoi(), and readDDSCAT().
ShapeDataBasic icedb::Examples::Shapes::readPSUfile | ( | const std::string & | filename | ) |
Reads a Penn State-style geometry file.
VARIABLE: Cartesian coordinates of the center of each scattering element Written in form of x_1, y_1, z_1, x_2, y_2, z_2, ... Dimensions of [number_of_particle_scattering_elements][axis]
Definition at line 137 of file shapeIOpsu.cpp.
References icedb::Examples::Shapes::ScopedHandles::ScopedHandle< HandleType, InvalidValueClass, CloseMethod >::h, ICEDB_throw, icedb::Examples::Shapes::ShapeRequiredData::number_of_particle_constituents, icedb::Examples::Shapes::ShapeRequiredData::number_of_particle_scattering_elements, icedb::Examples::Shapes::ShapeDataBasic::optional, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_constituent_single_name, icedb::Examples::Shapes::ShapeRequiredData::particle_id, icedb::Examples::Shapes::ShapeRequiredData::particle_scattering_element_coordinates, icedb::Examples::Shapes::ShapeRequiredData::particle_scattering_element_coordinates_are_integral, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_scattering_element_radius, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_scattering_element_spacing, readDataset(), icedb::Examples::Shapes::ShapeDataBasic::required, icedb::Examples::Shapes::ScopedHandles::ScopedHandle< HandleType, InvalidValueClass, CloseMethod >::valid(), icedb::error::xAssert, and icedb::error::xBadInput.
Referenced by main().
ShapeDataBasic icedb::Examples::Shapes::readRawText | ( | const char * | iin | ) |
Simple file assuming one substance, with 3-column rows, each representing a single point. ADDA allows comment lines at the beginning of the file. Each line starts with a '#'.
Definition at line 317 of file shapeIOtextParsers.cpp.
References icedb::Examples::Shapes::ShapeRequiredData::number_of_particle_constituents, icedb::Examples::Shapes::ShapeRequiredData::number_of_particle_scattering_elements, icedb::Examples::Shapes::ShapeDataBasic::optional, anonymous_namespace{shapeIOtextParsers.cpp}::parse_shapefile_entries(), icedb::Examples::Shapes::ShapeCommonOptionalData::particle_constituent_number, icedb::Examples::Shapes::ShapeRequiredData::particle_id, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_scattering_element_composition_whole, icedb::Examples::Shapes::ShapeRequiredData::particle_scattering_element_coordinates, icedb::Examples::Shapes::ShapeRequiredData::particle_scattering_element_coordinates_are_integral, and icedb::Examples::Shapes::ShapeDataBasic::required.
Referenced by m_atoi(), and readTextFile().
ShapeDataBasic icedb::Examples::Shapes::readTextFile | ( | const std::string & | filename | ) |
Definition at line 405 of file shapeIOtextParsers.cpp.
References readDDSCAT(), and readRawText().
Referenced by m_atoi(), main(), and readtask().
size_t icedb::Examples::Shapes::strints_array_to_floats | ( | const char * | in, |
const size_t | inlen, | ||
float * | out, | ||
const size_t | outlen, | ||
float & | max_element | ||
) |
Definition at line 18 of file shapeIOtextParsers2.cpp.
Referenced by m_atoi().
void icedb::Examples::Shapes::writeDDSCAT | ( | const std::string & | filename, |
const ShapeDataBasic & | p | ||
) |
Definition at line 255 of file shapeIOtextParsers.cpp.
References icedb::Examples::Shapes::ShapeRequiredData::number_of_particle_constituents, icedb::Examples::Shapes::ShapeRequiredData::number_of_particle_scattering_elements, icedb::Examples::Shapes::ShapeDataBasic::optional, icedb::Examples::Shapes::ShapeRequiredData::particle_id, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_scattering_element_composition_fractional, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_scattering_element_composition_whole, icedb::Examples::Shapes::ShapeRequiredData::particle_scattering_element_coordinates, icedb::Examples::Shapes::ShapeCommonOptionalData::particle_scattering_element_number, anonymous_namespace{shapeIOtextParsers.cpp}::print_shapefile_entries(), and icedb::Examples::Shapes::ShapeDataBasic::required.
void icedb::Examples::Shapes::writeTextRaw | ( | const std::string & | filename, |
const ShapeDataBasic & | p | ||
) |
Definition at line 392 of file shapeIOtextParsers.cpp.
References icedb::Examples::Shapes::ShapeRequiredData::particle_scattering_element_coordinates, anonymous_namespace{shapeIOtextParsers.cpp}::print_shapefile_pts(), and icedb::Examples::Shapes::ShapeDataBasic::required.