osPlanning / omx

Open Matrix (OMX)
https://github.com/osPlanning/omx/wiki
Apache License 2.0
49 stars 18 forks source link

Unable to load attribute info from object header #12

Closed gregmacfarlane closed 10 years ago

gregmacfarlane commented 10 years ago

I am using the R API to load a .omx file I exported from Cube with the cube2omx.exe tool. I can see the resulting tables from my matrix files in AMPKHWY16.omx using HDFView for Ubuntu, so I think that step worked, which is why I'm filing this issue here.

hdview

But I cannot read these tables into R, using Ubuntu or OSX. For example,

library(rhdf5)
source("omx.r")
listOMX("AMPK16HWY.omx")
HDF5-DIAG: Error detected in HDF5 (1.8.7) thread 0:
  #000: H5A.c line 550 in H5Aopen(): unable to load attribute info from object header
    major: Attribute
    minor: Unable to initialize object
  #001: H5Oattribute.c line 530 in H5O_attr_open_by_name(): can't locate attribute
    major: Attribute
    minor: Object not found
HDF5: unable to open attribute
Error: Error in h5checktype(). Argument not of class H5IdComponent.

I filed this here because I can look into the tables with HDFView. On the other hand, I can run through the examples in text_omx.r with no difficulty, so the problem might be in cube2omx.exe or my use of it.

e-lo commented 10 years ago

@gregmacfarlane , can you post your omx file somewhere so that we can fiddle?

gregmacfarlane commented 10 years ago

Here's a link to the omx file. I can also provide the cube matrix if that will be helpful. https://www.dropbox.com/s/o0sud05zqqcd6zo/AMPK16HWY.omx?dl=0

bstabler commented 10 years ago

Hi Greg,

The problem is the assumption that the NA and Description attributes are required…

for( i in 1:length(Names) ) { H5Data <- H5Dopen( H5Group, Names[i] ) H5Attr <- H5Aopen( H5Data, "NA" ) Attr$navalue <- H5Aread( H5Attr ) H5Attr <- H5Aopen( H5Data, "Description" ) Attr$description <- H5Aread( H5Attr ) }

But the specification says these are optional…

https://sites.google.com/site/openmodeldata/draft-omx-spec

I’ll correct the R code now.

Ben Stabler, GISP Senior Supervising Planner, Systems Analysis Parsons Brinckerhoff 400 SW Sixth Avenue, Suite 802 Portland, OR 97204 503-478-2859 (office) 503-360-5798 (cell) stabler@pbworld.commailto:stabler@pbworld.com www.pbworld.comhttp://www.pbworld.com/

From: Greg Macfarlane [mailto:notifications@github.com] Sent: Tuesday, August 26, 2014 5:43 AM To: osPlanning/omx Subject: Re: [omx] Unable to load attribute info from object header (#12)

Here's a link to the omx file. I can also provide the cube matrix if that will be helpful. https://www.dropbox.com/s/o0sud05zqqcd6zo/AMPK16HWY.omx?dl=0

— Reply to this email directly or view it on GitHubhttps://github.com/osPlanning/omx/issues/12#issuecomment-53414266.


NOTICE: This communication and any attachments ("this message") may contain confidential information for the sole use of the intended recipient(s). Any unauthorized use, disclosure, viewing, copying, alteration, dissemination or distribution of, or reliance on this message is strictly prohibited. If you have received this message in error, or you are not an authorized recipient, please notify the sender immediately by replying to this message, delete this message and all copies from your e-mail system and destroy any printed copies.

gregmacfarlane commented 10 years ago

Awesome; confirmed that the new commit works.

billyc commented 10 years ago

You guys are amazing.