0

(I am a newbie to HDF5)

My problem is that it isn't finding object dataset "xyz" within group "XY", though it finds object group "XY".

C# .NET on Windows 10 64-bit.

The code...………

            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"  <<<<<<<<<<<<<<
    }
}       
Doug Null
  • 7,989
  • 15
  • 69
  • 148

1 Answers1

0

The problem was that the HDF5 file was not written correctly. The solution was for the guy writing the file with Julia (a programming lang) to verify it using Python reading it back, to insure it is the HDF5 structure expected.

Now I can read it with HDF5DotNot OK.

Doug Null
  • 7,989
  • 15
  • 69
  • 148