You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document describes how SDF is stored in HDF5.
Datasets
Datasets may have the following data types: Float, Double and Integer. Every
non-scalar dataset (rank > 0) can have one dimension scale per dimension. The
length of the scale must match the extent of the respective dimension. Elements
must be stored in row-major order.
Variable Type
HDF5 Data Type
Size
Float
H5T_FLOAT
4
Double
H5T_FLOAT
8
Integer
H5T_INTEGER
4
Dimension Scales
Dimension scales must be one-dimensional and the values must be monotonically
increasing. Dimension scales must not have scales themselves.
Object Names
The names of Groups and Datasets must only contain upper and lower case letters,
digits and underscores (_) and start with a letter. Object names must conform to
the object_name syntax.
object_name:
[a-zA-Z][a-zA-Z0-9_]*
Attributes
Attributes are stored as scalar attributes of type H5T_STRING (variable length).
SDF has the following reserved attribute names:
Name
Allowed In
Legal Values
Description
COMMENT
Group, Dataset
UTF-8 string
A short description of the stored quantity
DISPLAY_UNIT
Dataset
unit_expression
The display unit of the quantity stored in the dataset
NAME
Dataset
UTF-8 string
The display name of the dataset (shared with the scale_name of the H5DS API)
RELATIVE_QUANTITY
Dataset
"TRUE"
Indicates that the stored value is a relative quantity
UNIT
Dataset
unit_expression
The unit of the quantity stored in the dataset
All attributes are optional
DISPLAY_UNIT is only allowed if UNIT is present
Attribute names must only contain uppercase letters and digits and start with a
letter. Attribute names must conform to the attribute_name syntax.
attribute_name:
[A-Z][A-Z0-9_]*
Units
SDF uses the same unit expressions as Modelica. A unit expression is a string
composed of unit symbols, operands and exponent factors.
Operands
Operand
Symbol
Example
Multiplication
.
N.m
Division
/
1/rad
Exponent
n
m2
Exponent Factors
Name
Symbol
Factor
yotta
Y
1024
zetta
Z
1021
exa
E
1018
peta
P
1015
tera
T
1012
giga
G
109
mega
M
106
kilo
k
103
hecto
h
102
deca
da
101
deci
d
10-1
centi
c
10-2
milli
m
10-3
micro
u
10-6
nano
n
10-9
pico
p
10-12
femto
f
10-15
atto
a
10-18
zepto
z
10-21
yocto
y
10-24
Examples are N.m, kg.m/s2, kg.m.s-2, 1/rad, mm/s
Expression Syntax
These are the rules to build a unit expression. For a formal definition see the
Modelica Specification (Chapter 19: Unit Expressions).
unit_expression:
unit_numerator [ "/" unit_denominator ]
unit_numerator:
"1" | unit_factors | "(" unit_expression ")"
unit_denominator:
unit_factor | "(" unit_expression ")"
unit_factors:
unit_factor [ unit_mulop unit_factors ]
unit_mulop:
"."
unit_factor:
unit_operand [ unit_exponent ]
unit_exponent:
[ "+" | "-" ] integer
unit_operand:
unit_symbol | unit_prefix unit_symbol
unit_prefix:
Y | Z | E | P | T | G | M | k | h | da | d | c | m | u | n | p | f | a | z | y
Unit Conversions
This section defines a set of derived units and conversions. Derived units can
be used when plotting presenting data in an UI. The value B in the derived
unit is calculated from the value A in the base unti as follows:
B = A * scale + offset
Likewise B can be converted back to A:
A = (B - offset) / scale
Note that for relative quantities only the scale is applied when converting
between base and derived units.