openPMD-standard
openPMD-standard copied to clipboard
GridSpacing: Per-Component UnitSI & UnitDimension
The gridSpacing should get a unitSI and a unitDimension for each of its components.
This allows to describe grid such as x, ux or x,y,t (although the "time" definition per iteration would then be "for the first row").
For gridUnitSI this seems quite simple: we just enter an array of floats (one element per dimension) instead of a single float.
For gridDimension, it seems that the most natural thing would be to have a 2d array of dimension Nx7, where N is the number of dimensions. However, I am not sure that HDF5 (and others) support 2d arrays as attributes. Therefore, I guess that the best choice would be a flattened 2d array. @ax3l Any opinion?
Sorry I missed the question. Yes, HDF5 does support 2D arrays as attributes, ADIOS afaik is limited to 1D arrays right now and as you found out: h5py does not expose that feature. So flattened to the same index order as the data (from fast varying index to slowest) is fine for me as well.