Skip to content

How to get attribute value from a group? #279

Answered by flappah
haziq-zur asked this question in Q&A
Discussion options

You must be logged in to vote

BTW, I managed to bypass the issue by just going to the underlying HDF-Group C wrapper. In my specific example I needed to retrieve the byte value (unsigned int 8 bit) which is the actual storage of the enumerated attribute type. The following code does this without a problem:

        public override int GetDataCodingFormat(string fileName)
        {
            var fileId = H5F.open(fileName, H5F.ACC_RDONLY, H5P.DEFAULT);
            var groupId = H5G.open(fileId, Encoding.ASCII.GetBytes("/SurfaceCurrent"), H5P.DEFAULT);
            var attribId = H5A.open(groupId, Encoding.ASCII.GetBytes("dataCodingFormat"), H5P.DEFAULT);
 
            var value = new byte[2];
            var handle = G…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@LiorBanai
Comment options

@flappah
Comment options

@flappah
Comment options

@haziq-zur
Comment options

Comment options

You must be logged in to vote
1 reply
@haziq-zur
Comment options

Answer selected by haziq-zur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants