Dimension Scales for HDF-EOS2 and HDF-EOS5 field dimensions were added to the new release of HDF-EOS. The new APIs will be presented and sample outputs will be shown. Need for development of new APIs for handling Dimension Scales will be discussed.
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Dimension Scales in HDF-EOS2 and HDF-EOS5
1. Dimension Scales
in
HDF-EOS2 & HDF-EOS5
Abe Taaheri, Raytheon IIS
HDF & HDF-EOS Workshop XIV
Champaign, IL
Sep. 29, 2010
Page 1
2. •
•
•
What is a Dimension Scale ?
Dimension Scales & Metadata
Dimension Scales APIs
–
–
•
Code example
–
–
•
he2
he5
Writing (he2, he5)
Reading (he2, he5)
Sample he2 and he5 files with Dimension Scales
Page 2
3. What is a Dimension Scale?
It is a sequence of numbers
placed along a dimension to
demarcate intervals along it
• HDF4
- It is an array with size and name similar to
its assigned dimension
- Stored using a structure similar to the SDS
array
- One scale is assigned per dimension
Page 3
4. * What is a Dimension Scale?
• HDF5
– A HDF5 dataset.
– With additional metadata that identifies
the dataset as a Dimension Scale
– Typically Dimension Scales are logically
associated with the dimensions of HDF5
Datasets
– The meaning of the association is left to
applications.
* Pedro Vicente talk, HDF/ HDF-EOS Workshop IX
Page 4
5. Example: 3D dataset
3 Dimension Scales Datasets
5
7
Dataset: 3D Array with
5 x 7 x 10
dimensions
10
Page 5
6. More on Dimension Scale
in HDF5
• A dimension scale is not required to be a 1-D
array, or to have a specific datatype
• A dataset dimension can have more than 1
associated dimension scale
• A Dimension Scale can be shared by two or
more Dataset dimensions
Page 6
7. Example: 3D dataset in HDF5
Several Dimension Scales
Datasets
Dataset: 3D Array with
5 x 7 x 10
dimensions
Page 7
8. HDF5 Dimension Scale Metadata
• When the Dimension Scale is associated with
a dimension of a Dataset, the association is
represented by attributes of the two datasets.
• The following dataset attributes are used to
describe dimension scale datasets:
– Attribute named “CLASS” with the value
“DIMENSION_SCALE”
– Optional attribute named “NAME”
– Attribute references to any associated
Dataset
Page 8
9. • HDF4
– Since Version 4.0 ?
– SDsetdimscale()
– SDgetdimscale()
– SDsetdimstrs(): label, unit, format
– SDgetdimstrs()
• HDF5
– Since Version 1.8
– H5DSset_scale()
– H5DSattach_scale(), H5DSdetach_scale()
– H5DSset_label(), H5DSget_label()
– A few more APIs
Page 9
11. •
HDF-EOS
–
Added a few routines to HDF-EOS2 to
create dimension scales like HDF4
Version 2.17
–
Added a few routines to HDF-EOS5 to
create dimension scales like those added
by the HDF Augmentation Tool
Version 1.13
Page 11
19. • Name:
HE5_SWsetdimscale
• Signature:
– herr_t HE5_SWsetdimscale( hid_t swathID,
char *fieldname, char *dimname,
const hsize_t dimsize, hid_t numbertype,
void * data)
• Purpose:
– Sets dimension scale for a field dimension
within the swath
Page 19
20. • Name:
HE5_SWgetdimscale
• Signature:
– long HE5_SWgetdimscale( hid_t swathID,
char *fieldname, char *dimname,
hsize_t *dimsize, hid_t *numbertype,
void * data)
• Purpose:
– Gets dimension scale for a field dimension
within the swath
Page 20
21. • Name:
HE5_SWwritedscaleattr
• Signature:
– herr_t HE5_SWwritedscaleattr( hid_t swathID,
const char *dimname, const char *attrname,
hid_t ntype, hsize_t count[], void *datbuf)
• Purpose:
– Writes/Updates a dimension scale attribute in a
specific swath
Page 21
22. • Name:
HE5_SWreaddscaleattr
• Signature:
– herr_t HE5_SWreaddscaleattr( hid_t swathID,
const char *dimname, const char *attrname,
void *datbuf)
• Purpose:
– Reads a dimension scale attribute from a
specific dimension
Page 22
23. • Name:
HE5_SWinqdscaleattrs
• Signature:
– Long HE5_SWinqdscaleattrs( hid_t swathID,
const char *dimname, char *attrnames,
long *strbufsize)
• Purpose:
– Retrieve information about the attributes
defined
Page 23
24. • Name:
HE5_SWdscaleattrinfo
• Signature:
– herr_t HE5_SWdscaleattrinfo( hid_t swathID,
const char *dimname, const char *attrname,
hid_t *ntype, hsize_t *count)
count : Number of attribute elements
• Purpose:
– Returns information about attribute(s) in a
specific dimension scale
Page 24
25. • Similar APIs for Dimension Scales in
– Grid
– Zonal Average
Page 25