title: Compound datatypes with h5py: datatype inside an attribute
body: <p>I'm using <a href="https://wci.llnl.gov/codes/silo/index.html" rel="nofollow">Silo</a> with HDF5, and I'm having trouble accessing some of the metadata with h5py. It spits out some rather unusual HDF5 structuring, where it puts a <code>DATATYPE</code> inside a <code>DATATYPE</code>. Here's an excerpt of the output from <code>h5dump</code>:</p>
  
  <pre><code>DATATYPE "sigma_t" H5T_STD_I32LE;
     ATTRIBUTE "silo" {
        DATATYPE  H5T_COMPOUND {
           H5T_STRING {
              STRSIZE 5;
              STRPAD H5T_STR_NULLTERM;
              CSET H5T_CSET_ASCII;
              CTYPE H5T_C_S1;
           } "meshid";
           H5T_STRING {
              STRSIZE 15;
              STRPAD H5T_STR_NULLTERM;
              CSET H5T_CSET_ASCII;
              CTYPE H5T_C_S1;
           } "value0";
           H5T_STD_I32LE "ndims";
           H5T_STD_I32LE "nvals";
           H5T_STD_I32LE "nels";
           H5T_IEEE_F32LE "time";
           H5T_STD_I32LE "use_specmf";
           H5T_STD_I32LE "centering";
           H5T_ARRAY { [3] H5T_STD_I32LE } "dims";
           H5T_ARRAY { [3] H5T_STD_I32LE } "zones";
           H5T_ARRAY { [3] H5T_STD_I32LE } "min_index";
           H5T_ARRAY { [3] H5T_STD_I32LE } "max_index";
           H5T_ARRAY { [3] H5T_IEEE_F32LE } "align";
        }
        DATASPACE  SCALAR
        DATA {
        (0): {
              "mesh",
              "/.silo/#000004",
              2,
              1,
              100,
              0,
              -1000,
              111,
              [ 10, 10, 0 ],
              [ 9, 9, 0 ],
              [ 0, 0, 0 ],
              [ 9, 9, 0 ],
              [ 0.5, 0.5, 0 ]
           }
        }
     }
     ATTRIBUTE "silo_type" {
        DATATYPE  H5T_STD_I32LE
        DATASPACE  SCALAR
        DATA {
        (0): 501
        }
     }
  </code></pre>
  
  <p>Basically, <code>f['sigma_t'].attrs['silo']</code> returns a <code>tuple</code> with all of the correctly formatted data but without any of the associated labels for the data types. (I need to know the names <code>meshid</code>, <code>value0</code>, etc.) Is there a way to get this? I'm at a loss.</p>
  
  <h2>Example file and script</h2>
  
  <p><a href="http://umich.edu/~sethrj/xsn.silo" rel="nofollow">HDF5 file</a> contains the "sigma_t" field, and the actual data is stored in <code>/.silo/#000004</code>.</p>
  
  <p>Script:</p>
  
  <pre><code>import h5py
  f = h5py.File('xsn.silo', 'r')
  print f['sigma_t'].attrs['silo']
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>('mesh', '/.silo/#000004', 2, 1, 100, 0.0, -1000, 111, array([10, 10,  0], dtype=int32), array([9, 9, 0], dtype=int32), array([0, 0, 0], dtype=int32), array([9, 9, 0], dtype=int32), array([ 0.5,  0.5,  0. ], dtype=float32))
  </code></pre>
  
  <p>What I also want is something like:</p>
  
  <pre><code>('meshid','value0','ndims', ..., 'align')
  </code></pre>
  
  <p>Is this possible?</p>