Comments (9)
native hdf5 1.10?
hdf5.node 0.3.1?
They are wrapped in an Int64 object in the latest versions. If you continue you would see it gets the next child members
const members2 = group.getMemberNames();
console.dir(members2);
yields [ 'OSBS' ]
I'll look into adding to the toString of Int64 to display the value yet the user should never need to operate on these values without the wrapper. I did this because hdf5 1.10 went to 64 bit id's and javascript doesn't support such a large bit field for integers
from hdf5.node.
Now
console.log(file.id.toString());
console.log(group.id.toString());
does display the id as a string since there is no javascript 64 bit integer
from hdf5.node.
I tried to npm install the 0.3.2 package straight from Github, but the install threw an error in node-gyp, so I tried again with the 0.3.1 package.
Running on Node
~ » node -v
v7.5.0
brew formula for natives
~ » brew info hdf5
homebrew/science/hdf5: stable 1.10.0-patch1 (bottled)
0.3.1 of hdf5.node
~ » npm view hdf5 version
0.3.1
When I run the following to open a dataset
const file = new hdf5.File('NEONDSTowerTemperatureData.hdf5', Access.ACC_RDONLY);
const boom_3 = file.openGroup(`Domain_10/STER/min_30/boom_3/`);
const ds = h5lt.readDataset(boom_3.id, 'temperature');
I get
const ds = h5lt.readDataset(boom_3.id, 'temperature');
SyntaxError: unsupported data type
at Object.<anonymous> (<path to js file omitted>)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:418:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:533:3
from hdf5.node.
You'll need the table interface: http://hdf-ni.github.io/hdf5.node/ref/tables.html. Nice set of data in tabular form.
const h5tb = require('hdf5').h5tb;
....
var boom_3 = file.openGroup(`Domain_10/STER/min_30/boom_3/`);
var temperatureTable=h5tb.readTable(boom_3.id, "temperature");
console.dir(temperatureTable);
If you are working with an unknown hierarchy you can find out what it is with
var HLType = require('hdf5/lib/globals.js').HLType;
...
var hlType=boom_3.getDatasetType("temperature");
switch(hlType){
case HLType.HL_TYPE_LITE:
break;
case HLType.HL_TYPE_IMAGE:
break;
case HLType.HL_TYPE_TABLE:
console.dir("I'm a table.");
break;
case HLType.HL_TYPE_PACKET_TABLE:
break;
case HLType.HL_TYPE_DIMENSION_SCALES:
break;
case HLType.HL_TYPE_OPTIMIZED_FUNCTIONS:
break;
case HLType.HL_TYPE_EXTENSIONS:
break;
default: //HL_TYPE_UNKNOWN
break;
}
yields
'I'm a table.'
http://hdf-ni.github.io/hdf5.node/ref/globals.html#hltype
from hdf5.node.
for(var column in temperatureTable){
console.dir(temperatureTable[column].name);
}
yields
'date'
'numPts'
'mean'
'min'
'max'
'variance'
'stdErr'
'uncertainty'
from hdf5.node.
Thank you for the quick responses. I was able to retrieve the datasets from the sample file using h5tb.readTable, however, I'm getting a node abort when trying to read datasets from the following file:
const h5lt = require('hdf5').h5lt;
const H5OType = require('hdf5/lib/globals.js').H5OType;
const HLType = require('hdf5/lib/globals.js').HLType;
const Access = require('hdf5/lib/globals').Access;
const hdf5 = require('hdf5').hdf5;
const h5tb = require('hdf5').h5tb;
const file = new hdf5.File('20170331.h5', Access.ACC_RDONLY);
const group = file.openGroup('ROOT/PARAMS/A1/');
const data = h5tb.readTable(group.id, 'Values');
console.dir(data);
Node:
[1] 67409 abort node <filename>.js
from hdf5.node.
I tested with nodejs v7.5.0 & hdf5 native hdf5-1.10.0-patch1
Reading it successfully. Not sure what the error means.
try a try catch
try{
const file = new hdf5.File('20170331.h5', Access.ACC_RDONLY);
const group = file.openGroup('ROOT/PARAMS/A1/');
const data = h5tb.readTable(group.id, 'Values');
catch(err) {
console.dir(err.message);
}
from hdf5.node.
when pulling directly from github in your package json's dependencies have
"hdf5" : "HDF-NI/hdf5.node"
then your npm line needs to tell it where hdf5 native is
npm install –hdf5_home_mac=<your hdf5 base directory>
where this is your dependent project's install
from hdf5.node.
Thanks for looking into it. Looks like it's specific to my system. I'm running macOS Sierra 10.12.3 with the brew version of the natives. I'll try it on a windows machine.
from hdf5.node.
Related Issues (20)
- Support for Single Writer Multiple Reader (SWMR)? HOT 7
- Getting dataset attribute (getDatasetAttribute) on a 32 bit floating point in NODE/javascript returns a totally different value HOT 6
- hdf5_home_win does not get set HOT 2
- Read dataset with 2d array stored fails on reading chunks HOT 10
- issues reading 4 dimensional dataset HOT 2
- SyntaxError: unsupported data type on compound datasets HOT 5
- Node 12? HOT 32
- Delete attribute HOT 6
- Tutorial: "Writing & Reading subsets" is not working. HOT 3
- Segfault reading HOT 4
- issue with appending to tables on windows 10
- Error: The specified procedure could not be found. (process.dlopen) HOT 1
- `hdf5.File is not a constructor` when bundled with webpack HOT 2
- cannot install HOT 3
- Win10+Node v14.15.5 Compilation errors HOT 6
- Getting data from Buffer
- Compile Error HOT 12
- install with yarn? HOT 2
- windows-build-tools / vs2017? HOT 37
- Error with handling variable length data (H5T_VLEN) HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hdf5.node.