0

(我是 HDF5 的新手)

我的问题是它没有在组“XY”中找到对象数据集“xyz”,尽管它找到了对象组“XY”。

Windows 10 64 位上的 C# .NET。

代码…………</p>

            static ObjectInfo info;
        static H5FileId fileId;
        static long[] dims ;
        static H5GroupId groupId;

public static void test_read( string HDF5_path)
{
        const int RANK = 2;

    try
    {

         dims = new long[RANK];


        // Open everything:
            var HDF5_filename = "heatmapB.h5";
            var test_pathname = HDF5_path + HDF5_filename;
            fileId = H5F.open( test_pathname,   H5F.OpenMode.ACC_RDONLY);          // OPEN HDF5 FILE.  WORKS OK.

            // Open the group...
                groupId = H5G.open( fileId, "/XY");                     // SELECT GROUP "XY".  WORKS OK.
                // Show datasets:
                    dump_HDF5_file(  "xyz" );

                    . . .



public static void dump_HDF5_file(  string object_name )
{
    try
    {


            info = H5G.getObjectInfo( fileId, object_name, true);   // Generates ERROR :  "Failed to get info for name "xyz" in object 1000001"  <<<<<<<<<<<<<<
        Console.WriteLine("cSharpGroup header size is {0}", info.headerSize);
        Console.WriteLine("cSharpGroup nlinks is {0}", info.nHardLinks);
        Console.WriteLine("cSharpGroup fileno is {0} {1}",                  info.fileNumber[0], info.fileNumber[1]);
        Console.WriteLine("cSharpGroup objno is {0} {1}",                   info.objectNumber[0], info.objectNumber[1]);
        Console.WriteLine("cSharpGroup type is {0}", info.objectType);
        Console.WriteLine("cSharpGroup modificationTime  is {0}", info.modificationTime );
    }
    catch (HDFException e)
    {
        Console.WriteLine(e.Message);   //////////////    ERROR IS:  "Failed to get info for name "xyz" in object 1000001"  <<<<<<<<<<<<<<
    }
}       
4

1 回答 1

0

问题是未正确写入 HDF5 文件。解决方案是让使用 Julia(一种编程语言)编写文件的人使用 Python 读取它来验证它,以确保它是预期的 HDF5 结构。

现在我可以用 HDF5DotNot OK 来阅读了。

于 2019-01-15T18:32:27.510 回答