Git Product home page Git Product logo

Comments (10)

rimmartin avatar rimmartin commented on August 11, 2024

probably need to set the start, stride and count to two rank hyperslab;
like http://hdf-ni.github.io/hdf5.node/tut/subset_tutorial.html

var data = h5lt.readDataset(file.id, "V",{start: [0,0], stride: [1,1], count: [1,128]});

start, stride and count are arrays the size of rank for choosing the subset/hyperslab

from hdf5.node.

rimmartin avatar rimmartin commented on August 11, 2024

or reading your description further to be by column of row values

var yCount=0;
var data = h5lt.readDataset(file.id, "V",{start: [0,yCount], stride: [1,1], count: [128, 1]});

where you vary yCount to get each column(all the rows values at that column)

from hdf5.node.

oguitart avatar oguitart commented on August 11, 2024

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

signD3.h5.tar.gz

from hdf5.node.

rimmartin avatar rimmartin commented on August 11, 2024

Ah ok, I'll try

from hdf5.node.

rimmartin avatar rimmartin commented on August 11, 2024

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

try
{
    var file = new hdf5.File("/home/roger/Downloads/signD3.h5", Access.ACC_RDONLY);
    var data = h5lt.readDatasetAsBuffer(file.id, "V",{start: [0,0], stride: [1,1], count: [1,128]});
    console.log("length"+data.length);
    file.close();
}
catch(err) {
    console.dir(err.message);
}

from hdf5.node.

rimmartin avatar rimmartin commented on August 11, 2024

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

from hdf5.node.

oguitart avatar oguitart commented on August 11, 2024

Hi,

How can I get the latest version to test it? I used npm to install hdf5 package.
Thanks,

oriol

from hdf5.node.

rimmartin avatar rimmartin commented on August 11, 2024
npm install HDF-NI/hdf5.node 

should pull from the github master branch

I got some other things going on before another publish

from hdf5.node.

oguitart avatar oguitart commented on August 11, 2024

Hi,

I tested it and it looks good.
Please let me know when it will be available as a new release.
Thanks,

oriol

from hdf5.node.

rimmartin avatar rimmartin commented on August 11, 2024

I will. I think in about two week ends

from hdf5.node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.