Closed wlwatkins closed 6 months ago
I am not familiar with the nexusformat so I am unsure what the mapping of hdf5
primitives to the nexusformat is. What is the output of h5dump --header C:\Users\USER\Documents\Coding\nexus-rs\assets\empty.nxs
?
Here is the output
h5dump --header .\empty.nxs
HDF5 ".\empty.nxs" {
GROUP "/" {
GROUP "entry" {
DATASET "definition" {
DATATYPE H5T_STRING {
STRSIZE H5T_VARIABLE;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_ASCII;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
ATTRIBUTE "url" {
DATATYPE H5T_STRING {
STRSIZE H5T_VARIABLE;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
}
ATTRIBUTE "version" {
DATATYPE H5T_STRING {
STRSIZE H5T_VARIABLE;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
}
}
and here is the output of a reference file that does show NX_CHAR
with punx
h5dump --header .\ellips_nx_opt.test.nxs
HDF5 ".\ellips_nx_opt.test.nxs" {
GROUP "/" {
GROUP "entry" {
ATTRIBUTE "NX_class" {
DATATYPE H5T_STRING {
STRSIZE H5T_VARIABLE;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
}
DATASET "definition" {
DATATYPE H5T_STRING {
STRSIZE H5T_VARIABLE;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
ATTRIBUTE "url" {
DATATYPE H5T_STRING {
STRSIZE H5T_VARIABLE;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
}
ATTRIBUTE "version" {
DATATYPE H5T_STRING {
STRSIZE H5T_VARIABLE;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
}
}
I have truncated the file so that it only shows the attributes of interest, hence why some missing {
. I see that I might have played between utf-8 and ascii, but the result is the same
hum. I got it, the nexus format adds the attribute NX_class
to define the type. i must have missed this in the docs.thanks anyway
Hi, I'm trying to implement a nexusformat using your crate. everything is going quite smoothly, however, I have an isue regarding the label of hte string types (and most types for that matter). Indeed the nexusformat uses NX_CHAR, whilst save to h5 file with your crate leads to CHAR.
This is my output using punx
This is te code I use to create this dateset.
where
key = "definition"
, and the attributes are fields of self.
Is there a type I can use to make a custom tape based on your premitives?
The output I am looking for is