Professional Documents
Culture Documents
- Introduce HDF5
http://hdfeos.org/workshops/ws12/workshop_twelve.php
1998 HDF5 was released with support from National Labs, NASA, NCSA
2006 The HDF Group spun off from University of Illinois as non-profit
corporation
10/15/08 HDF & HDF-EOS Workshop XII 5
Why HDF5?
60 385 610
LCI Tutorial
Discrepancies
Contig Qualities
Coverage Depth
Trace
Reads
Aligned bases
Read
quality Contig
Percent match
Applications
Library internals
Virtual file I/O
Storage
HDF5 ?
User-defined
Split metadata File on parallel
format File and raw data files file system device
…into
which you lat | lon | temp
objects.
“/” (root)
Primary Objects
• Groups
• Datasets
Metadata Data
Dataspace
Rank Dimensions
3 Dim_1 = 4
Dim_2 = 5
Dim_3 = 7
Datatype
Integer
Attributes
Storage Info Time = 32.4
Chunked Pressure = 987
Compressed Temp = 56
memory disk
memory disk
Dimensionality: 5 x 3
Record
10/15/08 HDF & HDF-EOS Workshop XII 28
Properties
Improves storage
compressed efficiency,
transmission speed
Arrays can be
extensible extended in any
direction
File B
Dataset “Fred” Metadata in one file,
split file File A raw data in another
Metadata Data
Dataspace
Rank Dimensions
3 Dim_1 = 4
Dim_2 = 5
Dim_3 = 7
Datatype
Integer
Attributes
Storage info Time = 32.4
Chunked Pressure = 987
Compressed Temp = 56
“/”
foo x
/ (root)
/x
temp bar
/foo
/foo/temp
/foo/bar/temp temp
“/”
A C
B
R P
P
/A/P
/B/R
/C/P
h5dump:
Tool to “dump” or display contents of HDF5 files
HDFView:
Java browser to view HDF4 and HDF5 files
HDF5 "dset.h5" {
GROUP "/" {
DATASET "dset" {
DATATYPE { H5T_STD_I32BE }
DATASPACE { SIMPLE ( 4, 6 ) / ( 4, 6 ) }
DATA {
1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24
} “/”
} ‘dset’
}
}
To compile:
% h5cc h5prog.c
% h5fc h5prog.f90
For Example:
A file must be opened before a dataset
-because-
the dataset open call requires a file handle
as an argument.
Example Functions:
hid_t file_id;
herr_t status;
Metadata Data
Dataspace
Rank Dimensions
3 Dim_1 = 4
Dim_2 = 5
Dim_3 = 7
Datatype
Integer
Attributes
Storage info Time = 32.4
Chunked Pressure = 987
Compressed Temp = 56
Examples:
Programming
Architecture* Type
NOTE: What you see in the file. Name is the same everywhere and
explicitly defines a datatype.
*STD= “An architecture with a semi-standard type like 2’s complement integer, unsigned integer…”
10/15/08 HDF & HDF-EOS Workshop XII 67
Pre-defined Native Datatypes
Examples of predefined native types in C:
H5T_NATIVE_INT (int)
H5T_NATIVE_FLOAT (float )
H5T_NATIVE_UINT (unsigned int)
H5T_NATIVE_LONG (long )
H5T_NATIVE_CHAR (char )
Chunked
Chunked &
compressed
H5P_DEFAULT: contiguous
H5S_ALL H5S_ALL
Get a Dataspace:
H5Screate_simple
H5Dget_space
Modify Dataspace:
H5Sselect_hyperslab
H5Sselect_elements
#include "H5LT.h"
…
file_id = H5Fcreate (“file.h5", H5F_ACC_TRUNC,
H5P_DEFAULT, H5P_DEFAULT);
• HDF5 Lite
• HDF5 Image
• HDF5 Table
• HDF5 Dimension Scales
• HDF5 Packet Table
“/” (root)
A B
4x6 array of
integers
file.h5