>From 47a8d071a5a0f5aa3b6eb35fc5670b7f2afdbbdc Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Tue, 30 Jul 2013 23:32:46 -0400 Subject: [PATCH 2/2] =?UTF-8?q?Move=20attribute=20=E2=80=9Cunit=E2=80=9D?= =?UTF-8?q?=20to=20discussion=20section.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A data stored in an attribute cannot have a unit attribute. http://thread.gmane.org/gmane.science.simulation.h5md.user/208 --- discussion.rst | 17 +++++++++++++++++ draft.rst | 12 ++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/discussion.rst b/discussion.rst index 36ba517..f8d2be3 100644 --- a/discussion.rst +++ b/discussion.rst @@ -58,6 +58,23 @@ Note that the statistical variance and the standard deviation are easily obtained from combining the datasets ``error`` and ``count`` and need not to be stored explicitly. +Units +===== + +The datasets ``time`` and ``value`` may possess an optional string attribute +``unit`` that gives the physical unit of their respective data (``nm`` for the +position, for instance). In the case of time-independent data, ``unit`` is +attached to the dataset itself. + +The structure of such a data group is :: + + data_group + \-- step [variable] + \-- time [variable] + +-- (unit) + \-- value [variable][...] + +-- (unit) + Extensions: Observables group ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/draft.rst b/draft.rst index 608d0f9..85ccb77 100644 --- a/draft.rst +++ b/draft.rst @@ -100,9 +100,7 @@ the physical time. The structure of such a group is:: data_group \-- step [variable] \-- time [variable] - +-- (unit) \-- value [variable][...] - +-- (unit) ``step`` A dataset with dimensions ``[variable]`` that contains the time steps @@ -112,8 +110,7 @@ the physical time. The structure of such a group is:: ``time`` A dataset that is the same as the ``step`` dataset, except it is - real-valued and contains the simulation time in simulation or physical - units. + real-valued and contains the simulation time. ``value`` A dataset that holds the data of the time series. Its shape is the shape @@ -123,11 +120,6 @@ the physical time. The structure of such a group is:: the unique dimension of ``step`` and ``time``, and serves to accumulate samples during the course of the simulation. -The datasets ``time`` and ``value`` may possess an optional string attribute -``unit`` that gives the physical unit of their respective data (``nm`` for the -position, for instance). In the case of time-independent data, ``unit`` is -attached to the dataset itself. - If several data groups are sampled at equal times, ``step`` and ``time`` of one data group may be hard links to the ``step`` and ``time`` datasets of a different data group. If data groups are sampled at different times (for @@ -140,7 +132,7 @@ Time-independent data Time-independent data is stored as a dataset or as an attribute. Like for the ``value`` dataset in the case of time-dependent data, data type and array shape are implied by the stored data, where the ``[variable]`` -dimension is omitted. Further, the optional attribute ``unit`` may be attached. +dimension is omitted. Storage as attributes is preferred over datasets for small amounts of data, in particular when the size of the data is known *a priori* and does not scale with -- 1.8.3.2