Bug introduced in 7.0 and fixed in 8.0
I am using Mathematica 7 and I need to export a table of data and the corresponding x and y arrays. I would like to format them as a single file, say grid.h5, and need the arrays named for import in a different program. Unfortunately, applying the command:
Export["MGfunc.h5", {data, x1, y1}, {"Datasets", {"MGfunc", "x", "y"}}]
only seems to save the last array in the file MGfunc.h5.
Does anyone know how to get this working using the HDF5 format?
Here is an example:
ki = N[Table[i, {i, 0, 3}]] (* -> {0., 1., 2., 3.} *)
kj = N[Table[j, {j, 0, 3}]] (* -> {0., 1., 2., 3.} *)
testgrid = Table[ki*kj, {ki, 0, 3}, {kj, 0, 3}]
(* -> {{0, 0, 0, 0}, {0, 1, 2, 3}, {0, 2, 4, 6}, {0, 3, 6, 9}} *)
Export["testgrid.h5", {testgrid, ki, kj}, {"Datasets", {"gridtest", "x", "y"}}]
(* -> "testgrid.h5" *)
Import["testgrid.h5"] (* -> {"/y"} *)
Import["testgrid.h5", "Data"] (* -> {{0., 1., 2., 3.}} *)
bugsquestions. For the sake of consistency I think this is best. If you have a different perspective please post it in that Meta Q&A. $\endgroup$