-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read dataset with 2d array stored fails on reading chunks #103
Comments
probably need to set the start, stride and count to two rank hyperslab;
start, stride and count are arrays the size of rank for choosing the subset/hyperslab |
or reading your description further to be by column of row values
where you vary yCount to get each column(all the rows values at that column) |
Hi, Thank you for the answer. But the options that you offer don't work. They all read the whole 2d array. Attached one of these files, if you want to test it. Regards, oriol |
Ah ok, I'll try |
h5lt.readDatasetAsBuffer works while h5lt.readDataset doesn't. In later node js versions the javascript object returned by h5lt.readDatasetAsBuffer is ArrayBufferView with constructor name Buffer and has the functionality of https://nodejs.org/docs/latest/api/buffer.html. I'll work hyperslabs into h5lt.readDataset to catch it up to the documentation ad return a Float32Array. Until I commit changes the following should work for you to get to the hyperslab
|
I've committed so h5lt.readDataset should work as well and return a Float32Array for your case. travis build passed. Yet I do want to add more tests |
Hi, How can I get the latest version to test it? I used npm to install hdf5 package. oriol |
should pull from the github master branch I got some other things going on before another publish |
Hi, I tested it and it looks good. oriol |
I will. I think in about two week ends |
Hello,
We have several h5 files that were created in python with the h5py package. These files contain a dataset called "V", which contains a 2D array. I'm trying to read only parts of this dataset by using the following method:
var file = new hdf5.File(/data_signatures/signA1.h5", Access.ACC_RDONLY);
var data = h5lt.readDataset(file.id, "V",{start: [0], stride: [1], count: [128]});
In the above case, I'm trying to read the first 128 rows but what I get it is the whole 2d array but transformed to 1D array. The prove of that is that I do:
data.length
And the output it is the multiplication of the number of rows and the number of columns of this 2d array.
Am I doing anything wrong? Or maybe there is an issue reading this kind of data?
If I do the same thing on a dataset that contains a 1D array then it works fine and I only get the chunk of the data that I want.
Thanks,
oriol
The text was updated successfully, but these errors were encountered: