VTK supports dataset attributes defined in vtkDataSetAttributes that can be used to mark certain point and cell arrays as “special” arrays, such as Scalars, Normals, Global ids, etc.
Currently, the VTKHDF specification does not support marking arrays as such. We propose an addition to the VTKHDF format to support this VTK feature.
VTK DataSet Attributes will be marked as a string HDF5 attribute called “Attribute” on the HDF5 Dataset for the array.
From h5py, you could easily add an VTK attribute to an array this way:
We make the assumption that an array can only have a single attribute attached to it. We raise an error when multiple arrays of the same type (Point or Cell) share the same attribute.
Possible attributes will be (case insensitive): SCALARS, VECTORS, NORMALS, TCOORDS, TENSORS, GLOBALIDS, PEDIGREEIDS, EDGEFLAG, TANGENTS, RATIONALWEIGHTS, HIGHERORDERDEGREES, PROCESSIDS.
I totally support the idea of using attributes to add additional information to datasets. Attributes are one of the features of HDF5 that helps to make data understandable.
However, I would reconsider the naming. Having an attribute called “Attribute” is IMHO not ideal and self-explanatory. I would hope that there is a better name that clearly conveys the purpose of the attributes considered with this fix.
In the future, other attributes could be added. For physical quantities having information about the unit (m or mm) is often quite helpful. So an attribute unit could be an interesting feature.
The VTK Data model does not use measurement units, and there are no plans to support that. HDF5 Attribute / vtkDataSet Attribute is an unfortunate name clash, but it is the most accurate name we could use for that feature