我正在尝试阅读我的Unity项目的H5文件,并从文件中阅读数据并以Unity使用。我打开了第一个迄今为止python和h5py的文件,该文件包含多个数组和数据:
现在,当我尝试读取C#(Unity)中的文件时,我将获得此值单个条目:
有人对如何正确读取文件的任何建议(或示例代码),以使该值从H5PY输出中匹配它们。我的猜测是,数据类型是相同的,因为C#中的INT为32位,但我只需要16位。我尝试转换UINT16中的数字,但是我得到了一个异常异常。我使用了HDFPinVoke和其他库,但无法解决错误。我只是直接使用带有Ironpython的Python脚本来获取运行时的数据?
I am trying to read a h5 file for my Unity project and read the data from the file and use it in Unity. I opened the file first hith Python and h5py and the file contains of multiple arrays and data like this:

Now when I am trying to read the file in C# (Unity) I am getting this value for a single entry:

Has someone any recommendations (or sample code) on how to read the file properly so that the values match these from the h5py output. My guess is that the datatypes arent the same because an int in C# is presented as 32bit but I only need 16 Bits. I tried to convert the number in UInt16 but I got an outofrange exception. I used HDFPinvoke and other libraries but I couldnt fix the error.Couldnt I just directly use the Python Script with IronPython to get the data in runtime ?
发布评论
评论(1)
我不熟悉HDFPINVOKE和朋友,但是您可以尝试 hdfql 读取C#中的HDF5数据集。根据提供的信息,可以按以下方式完成读取:
有关其他信息,请参见HDFQL参考手册以及如何在C#
I'm not familiar with HDFPinvoke and friends but you could try HDFql to read an HDF5 dataset in C#. Based on the info provided, the reading could be done as follows:
For additional information, see HDFql reference manual here and examples on how to use it in C# here.