HDFGroup / hdf5-json

Specification and tools for representing HDF5 in JSON
https://hdf5-json.readthedocs.io
Other
73 stars 25 forks source link

Provide an array type example of compound dataset. #11

Closed hyoklee closed 9 years ago

hyoklee commented 9 years ago

Please provide compound dataset example that matches the following h5dump output:

              DATASET "Sensor" {
                  DATATYPE  H5T_COMPOUND {
                     H5T_IEEE_F64LE "Time";
                     H5T_ARRAY { [4] H5T_IEEE_F32LE } "Concentration";
                     H5T_ARRAY { [8] H5T_STD_I8LE } "Species";
                  }
                  DATASPACE  SIMPLE { ( 15 ) / ( H5S_UNLIMITED ) }
               }

The current example doesn't cover the above case.

hyoklee commented 9 years ago

Is the following JSON correct for above dataset?

"datasets": {"4c97c75c-2553-42b7-a733-1c18887001c2": {"type": {"fields": [{"type": {"class": "H5T_FLOAT", "base": "H5T_IEEE_F64LE"}, "name": "Time"}, {"type": {"class": "H5T_ARRAY", "dims": [4], "base": {"class": "H5T_FLOAT", "base": "H5T_IEEE_F32LE"}}, "name": "Concentration"}, {"type": {"class": "H5T_ARRAY", "dims": [8], "base": {"class": "H5T_INTEGER", "base": "H5T_STD_I8LE"}}, "name": "Species"}], "class": "H5T_COMPOUND"}, "creationProperties": {"layout": {"class": "H5D_CONTIGUOUS"}}, "description": "", "shape": {"maxims": [15], "class": "H5S_SIMPLE", "dims": [15]}, "attributes": []}}
gheber commented 9 years ago

This looks good, except there's a typo in the dataset shape. It should be "maxdims" instead of "maxims".

hyoklee commented 9 years ago

Thanks Gerd. "maxims" sneaked in thanks to spell-corrector of Apple Safari browser.

jreadey commented 9 years ago

I've added your json to the sample json directory: https://github.com/HDFGroup/hdf5-json/blob/master/data/json/compound_array.json. It converts cleanly to hdf5.