hdfview
(v2.9)存储字符串和标量值,如本示例所示(这些值映射到h5py
/ numpy
中大小为1的数组):
ATTRIBUTE "title" {
DATATYPE H5T_STRING {
STRSIZE 256;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_ASCII;
CTYPE H5T_C_S1;
}
DATASPACE SIMPLE { ( 1 ) / ( 1 ) }
DATA {
(0): "Storm 4231"
}
}
通过h5py
创建的相同属性存储如下,这似乎更符合逻辑:
ATTRIBUTE "title" {
DATATYPE H5T_STRING {
STRSIZE 10;
STRPAD H5T_STR_NULLPAD;
CSET H5T_CSET_ASCII;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
DATA {
(0): "Storm 4231"
}
}