Hi everyone,
I've been trying without success to read a table that I've created with
hdfview. The field that I can't read is an string of length = 1. The
table has the following fields:
a -> unsigned int
b -> char[1]
c -> float32
d -> float32
I'm trying with:
···
------------------------------------------------------------------
CompType mtype2( sizeof(s2_t) );
mtype2.insertMember("timestamp", HOFFSET(s2_t, timestamp),
PredType::NATIVE_UINT);
mtype2.insertMember("exchange", HOFFSET(s2_t, exchange),
PredType::NATIVE_CHAR);
mtype2.insertMember("bidPrice", HOFFSET(s2_t, bidPrice),
PredType::NATIVE_FLOAT);
mtype2.insertMember("askPrice", HOFFSET(s2_t, askPrice),
PredType::NATIVE_FLOAT);
------------------------------------------------------------------
But I got this error:
------------------------------------------------------------------
HDF5-DIAG: Error detected in HDF5 (1.8.4) thread 140433079310112:
#000: ../../../src/H5Dio.c line 174 in H5Dread(): can't read data
major: Dataset
minor: Read failed
#001: ../../../src/H5Dio.c line 324 in H5D_read(): unable to set up
type info
major: Dataset
minor: Unable to initialize object
#002: ../../../src/H5Dio.c line 735 in H5D_typeinfo_init(): unable to
convert between src and dest datatype
major: Dataset
minor: Feature is unsupported
#003: ../../../src/H5T.c line 4425 in H5T_path_find(): no appropriate
function for conversion path
major: Datatype
minor: Unable to initialize object
------------------------------------------------------------------
I'm sure that it's the char/string because it works without it.
Here is the dump with h5dump:
------------------------------------------------------------------
GROUP "/" {
DATASET "quotes" {
DATATYPE H5T_COMPOUND {
H5T_STD_U32LE "timestamp";
H5T_STRING {
STRSIZE 1;
STRPAD H5T_STR_NULLPAD;
CSET H5T_CSET_ASCII;
CTYPE H5T_C_S1;
} "exchange";
H5T_IEEE_F32LE "bidPrice";
H5T_IEEE_F32LE "askPrice";
}
DATASPACE SIMPLE { ( 1 ) / ( 1 ) }
DATA {
(0): {
123,
"e",
22.77,
666.666
}
}
}
}
}
------------------------------------------------------------------
Thanks and sorry about the size of the email,
Regards,
--
Felipe Barriga Richards