SlideShare a Scribd company logo
Dimension Scales
in
HDF-EOS2 & HDF-EOS5
Abe Taaheri, Raytheon IIS
HDF & HDF-EOS Workshop XIV
Champaign, IL
Sep. 29, 2010

Page 1
•
•
•

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
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
* 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
Example: 3D dataset
3 Dimension Scales Datasets

5
7

Dataset: 3D Array with
5 x 7 x 10
dimensions

10
Page 5
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
Example: 3D dataset in HDF5
Several Dimension Scales
Datasets

Dataset: 3D Array with
5 x 7 x 10
dimensions

Page 7
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
• 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
HDF Augmentation Tool

Augmentation Tool adds
HDF5 Dimension Scales
inside the file so that
netCDF-4 APIs can access
the data

Page 10
•

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
HDF-EOS2 APIs

Page 12
• Name:

SWsetdimscale

• Signature:
– intn SWsetdimscale( int32 swathID,
char *fieldname, char *dimname, int32 dimsize,
int32 numbertype, VOIDP data)

• Purpose:
– Sets dimension scale for a given dimension

Page 13
• Name:

SWgetdimscale

• Signature:
– intn SWgetdimscale( int32 swathID,
char *fieldname, char *dimname,
int32 *dimsize, int32 *numbertype,
VOIDP data)

• Purpose:
– Gets dimension scale for a given dimension
Page 14
• Name:

SWsetdimstrs

• Signature:
– intn SWsetdimstrs( int32 swathID,
char *fieldname, char *dimname, char *label,
char *unit, char *format)

• Purpose:
– Sets the label, unit, and format strings for a
given dimension
Page 15
• Name:

SWgetdimstrs

• Signature:
– intn SWgetdimstrs( int32 swathID, char
*fieldname, char *dimname, char *label,
char *unit, char *format, intn len)

• Purpose:
– Gets the label, unit, and format strings for a
given dimension
Page 16
• Similar APIs for Dimension Scales in
– Grid Fields

Page 17
HDF-EOS5 APIs

Page 18
• 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
• 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
• 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
• 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
• 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
• 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
• Similar APIs for Dimension Scales in
– Grid

– Zonal Average

Page 25
Code Examples

Page 26
Writing Code Example (HDF-EOS2)
#include "hdf.h"
#include "HdfEosDef.h"
int main()
{
intn
status, i;
int32
swfid, SWid;
int32
nbands, nGeoTrack;
int32
bands[15]={3,6,9,12,15,18,23,26,29,32,33,34,36,37,39};
char
label[16];
char
unit[16];
char
format[16];
float
dataGeoTrack[20];
swfid = SWopen ( "SwathFile.hdf", DFACC_RDWR );
SWid = SWattach ( swfid, "Swath1“ );
Page 27
nGeoTrack = 20;
for (i=0; i<20; i++) { dataGeoTrack[i] = (float) I; }
status = SWsetdimscale ( SWid, "Temperature", "GeoTrack",
nGeoTrack, DFNT_FLOAT32, dataGeoTrack );
nbands = 15;
status = SWsetdimscale ( SWid, "Spectra", "Bands",
nbands, DFNT_INT32, bands );
strcpy (label, "Bands");
strcpy (unit, "none");
strcpy (format, "I2");
status = SWsetdimstrs ( SWid, "Spectra", "Bands", label, unit, format );
SWdetach ( SWid );
SWclose ( swfid );
return 0;
}
Page 28
Writing Code Example (HDF-EOS5)
#include <HE5_HdfEosDef.h>
int main()
{
herr_t
status = FAIL;
hid_t
swfid = FAIL;
hid_t
SWid1 = FAIL;
int
data[15]={1,2,3,6,9,12,15,18,23,26,29,32, 33,34,35};
char
label[16], unit[16], format[16];
int
nbands;
hsize_t
count[3];
swfid = HE5_SWopen ( "Swath.h5", H5F_ACC_RDWR );
SWid1 = HE5_SWattach ( swfid, "Swath1“ );

Page 29
nbands = 15;
status = HE5_SWsetdimscale ( SWid1, "Spectra", "Bands", nbands,
H5T_NATIVE_INT, (void *)data );
strcpy(label, "Bands Dim");
strcpy(unit, "None");
strcpy(format, "I2");
count[0]= 12;
status = HE5_SWwritedscaleattr ( SWid1, "Bands", "label",
H5T_NATIVE_CHAR, count, label );
count[0]= 6;
status = HE5_SWwritedscaleattr ( SWid1, "Bands", "unit",
H5T_NATIVE_CHAR, count, unit );
count[0]= 4;
status = HE5_SWwritedscaleattr ( SWid1, "Bands", "format",
H5T_NATIVE_CHAR, count, format );
Page 30
int datbuf_i1[1] = {-999};
count[0]= 1;
status = HE5_SWwritedscaleattr ( SWid1, "Bands", "MissingValue",
H5T_NATIVE_INT, count, datbuf_i1 );
int datbuf_i2[3] = {-999, 0, 999};
count[0]= 3;
status = HE5_SWwritedscaleattr(SWid1, "Bands", "IntValues",
H5T_NATIVE_INT, count, datbuf_i2 );
HE5_SWdetach ( SWid1 );
HE5_SWclose ( swfid );
return 0;
}

Page 31
Reading Code Example (HDF-EOS2)
#include "hdf.h"
#include "HdfEosDef.h"
Int main()
{
intn
status, i;
int32
swfid, SWid;
int32
*datbuf_int32;
int32
nbands, data_type, dimsize, dimsize1;
intn
len, buffsize;
char
label[16], unit[16], format[16];
swfid = SWopen ( "SwathFile.hdf", DFACC_RDWR );
SWid = SWattach ( swfid, "Swath1“ );

/* get Bands */
dimsize = SWdiminfo ( SWid, "Bands“ );
buffsize = SWgetdimscale ( SWid, "Spectra", "Bands", &dimsize1,
&data_type, NULL );
Page 32
datbuf_int32 = (int32 *) malloc(buffsize);
buffsize = SWgetdimscale ( SWid, "Spectra", "Bands", &dimsize1,
&data_type, (void *)datbuf_int32 );
for (i=0; i<dimsize; i++)
{ printf("i = %d datbuf_int32 = %dn", i, datbuf_int32[i]); }
/* get str attributes of Bands*/
len = 15;
status = SWgetdimstrs ( SWid, "Spectra", "Bands",
label, unit, format, len );
printf(" ttlabel = %s unit = %s format = %s nn", label, unit, format);
free(datbuf_int32);
datbuf_int32 = NULL;
SWdetach ( SWid );
SWclose ( swfid );
return 0;
}
Page 33
Reading Code Example (HDF-EOS5)
#include <HE5_HdfEosDef.h>
int main()
{
herr_t
status = FAIL;
hid_t
swfid = FAIL, SWid = FAIL, numtype;
int
i,j, bufsize;
int
*databuff;
long
nattr, strbufsize;
char
*attrlist, *attrname = (char *)NULL;
size_t
fldnmlen[HE5_HDFE_NAMBUFSIZE];
char
*fldnm[HE5_HDFE_NAMBUFSIZE];
hid_t
*ntype;
hsize_t
count = 0;
void
*attr;
int
*attr_int;
float
*attr_flt;
char
*attr_char;
hsize_t
dimsize;
swfid = HE5_SWopen ( "Swath.h5", H5F_ACC_RDWR );
SWid = HE5_SWattach ( swfid, "Swath1“ );

Page 34
bufsize = HE5_SWgetdimscale ( SWid, "Spectra", "Bands", &dimsize,
&numtype, NULL );
databuff = (int *) malloc(bufsize );
bufsize = HE5_SWgetdimscale ( SWid, "Spectra", "Bands", &dimsize,
&numtype, (void *)databuff );
for( i = 0; i < dimsize; i++)
{ printf ("DscaleVal[%d] = %dn",i,databuff[i] ); }
nattr = HE5_SWinqdscaleattrs ( SWid, "Bands", NULL, &strbufsize );
attrlist = (char *) calloc(strbufsize + 1, sizeof(char));
nattr = HE5_SWinqdscaleattrs ( SWid, "Bands", attrlist, &strbufsize );
nattr = HE5_EHparsestr(attrlist, ',', fldnm, fldnmlen);

Page 35
for( i = 0; i < nattr; i++)
{
attrname = (char *) calloc(fldnmlen[i] + 1, sizeof(char) );
memmove ( attrname,fldnm[i],fldnmlen[i] );
ntype = (hid_t *) calloc(1, sizeof(hid_t));
if ( strcmp ( attrname, "REFERENCE_LIST") == 0 ) continue;
status = HE5_SWdscaleattrinfo ( SWid,"Bands", attrname,
ntype, &count );
if( (int)*ntype == 0) {
attr_int = (int *) malloc(count*sizeof(int));
attr = (void *) attr_int; }
if( (int)*ntype == 10) {
attr_flt = (float *) malloc(count*sizeof(float));
attr = (void *) attr_flt; }
if( (int)*ntype == 57) {
attr_char = (char *) malloc((count+1)*sizeof(char));
attr = (void *) attr_char; }
status = HE5_SWreaddscaleattr ( SWid,"Bands", attrname, attr );
printf("tAttribute Name:
%s n",attrname);
printf("tNumber of attr elem: %lu n", (unsigned long)count);
printf("tData type of attribute:
%d n", (int)*ntype);
Page 36
if( (int)*ntype == 0) {
attr_int = (int *) attr;
for (j = 0; j < count; j++) { printf("tAttrvalue[%d]:
}
if( (int)*ntype == 10) {
attr_flt = (float *) attr;
for (j = 0; j < count; j++) { printf("tAttrvalue[%d]:
}

}

}

if( (int)*ntype == 57) {
attr_char = (char *) attr;
attr_char[count]='0';
printf("tAttrvalue:
free ( attr_char );
}

%d n", j,attr_int[j]); }

%f n", j,attr_flt[j]); }

%s n", attr_char);

HE5_SWdetach ( SWid );
HE5_SWclose ( swfid );
return 0;

Page 37
Test File content (he2)
HDFView 2.4:
uses plug-in with
hdf-eos5-1.11,
Hdfeos2.15,
HDF4.2r3,
HDF5-1.6.7

Page 38
Test File content (he5)
HDFView 2.4:
uses plug-in with
hdf-eos5-1.11,
Hdfeos2.15,
HDF4.2r3,
HDF5-1.6.7

Page 39
Test File content (he5)
HDFView 2.6:
Without plug-in
HDF4.2r4,
HDF5-1.8.3

Page 40
Test File content (he5)
HDFView 2.6:
uses plug-in with
hdf-eos5-1.12,
Hdfeos2.16,
HDF4.2r4,
HDF5-1.8.3

Page 41
File content (HIRDLS he5)
HIRDLS he5
Modified with
HDF
Augmentation
Tool

Page 42
Suggestions?

– Do we need new APIs ?
– Improvements for existing APIs ?
– What else?

Page 43
Thank You!

Page 44

More Related Content

Viewers also liked

Implementation of HDF-EOS5 and HDF5 into NCL
Implementation of HDF-EOS5 and HDF5 into NCLImplementation of HDF-EOS5 and HDF5 into NCL
Implementation of HDF-EOS5 and HDF5 into NCL
The HDF-EOS Tools and Information Center
 
Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 productsInteroperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
The HDF-EOS Tools and Information Center
 
An Overview of HDF-EOS (Part II)
An Overview of HDF-EOS (Part II)An Overview of HDF-EOS (Part II)
An Overview of HDF-EOS (Part II)
The HDF-EOS Tools and Information Center
 
Visualizing and Analyzing HDF-EOS5 and HDF5 data with NCL
Visualizing and Analyzing HDF-EOS5 and HDF5 data with NCLVisualizing and Analyzing HDF-EOS5 and HDF5 data with NCL
Visualizing and Analyzing HDF-EOS5 and HDF5 data with NCL
The HDF-EOS Tools and Information Center
 
Summary of HDF-EOS5 Files, Data Model and File Format
Summary of HDF-EOS5 Files, Data Model and File FormatSummary of HDF-EOS5 Files, Data Model and File Format
Summary of HDF-EOS5 Files, Data Model and File Format
The HDF-EOS Tools and Information Center
 
Breakthrough Listen
Breakthrough ListenBreakthrough Listen
SPD and KEA: HDF5 based file formats for Earth Observation
SPD and KEA: HDF5 based file formats for Earth ObservationSPD and KEA: HDF5 based file formats for Earth Observation
SPD and KEA: HDF5 based file formats for Earth Observation
The HDF-EOS Tools and Information Center
 

Viewers also liked (7)

Implementation of HDF-EOS5 and HDF5 into NCL
Implementation of HDF-EOS5 and HDF5 into NCLImplementation of HDF-EOS5 and HDF5 into NCL
Implementation of HDF-EOS5 and HDF5 into NCL
 
Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 productsInteroperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
Interoperability with netCDF-4 - Experience with NPP and HDF-EOS5 products
 
An Overview of HDF-EOS (Part II)
An Overview of HDF-EOS (Part II)An Overview of HDF-EOS (Part II)
An Overview of HDF-EOS (Part II)
 
Visualizing and Analyzing HDF-EOS5 and HDF5 data with NCL
Visualizing and Analyzing HDF-EOS5 and HDF5 data with NCLVisualizing and Analyzing HDF-EOS5 and HDF5 data with NCL
Visualizing and Analyzing HDF-EOS5 and HDF5 data with NCL
 
Summary of HDF-EOS5 Files, Data Model and File Format
Summary of HDF-EOS5 Files, Data Model and File FormatSummary of HDF-EOS5 Files, Data Model and File Format
Summary of HDF-EOS5 Files, Data Model and File Format
 
Breakthrough Listen
Breakthrough ListenBreakthrough Listen
Breakthrough Listen
 
SPD and KEA: HDF5 based file formats for Earth Observation
SPD and KEA: HDF5 based file formats for Earth ObservationSPD and KEA: HDF5 based file formats for Earth Observation
SPD and KEA: HDF5 based file formats for Earth Observation
 

Similar to Dimension Scales in HDF-EOS2 and HDF-EOS5

Introduction to HDF5 for HDF4 Users
Introduction to HDF5 for HDF4 UsersIntroduction to HDF5 for HDF4 Users
Introduction to HDF5 for HDF4 Users
The HDF-EOS Tools and Information Center
 
Advanced HDF5 Features
Advanced HDF5 FeaturesAdvanced HDF5 Features
Using HDF5 and Python: The H5py module
Using HDF5 and Python: The H5py moduleUsing HDF5 and Python: The H5py module
Using HDF5 and Python: The H5py module
The HDF-EOS Tools and Information Center
 
The MATLAB Low-Level HDF5 Interface
The MATLAB Low-Level HDF5 InterfaceThe MATLAB Low-Level HDF5 Interface
The MATLAB Low-Level HDF5 Interface
The HDF-EOS Tools and Information Center
 
Overview of Parallel HDF5 and Performance Tuning in HDF5 Library
Overview of Parallel HDF5 and Performance Tuning in HDF5 LibraryOverview of Parallel HDF5 and Performance Tuning in HDF5 Library
Overview of Parallel HDF5 and Performance Tuning in HDF5 Library
The HDF-EOS Tools and Information Center
 
Advanced HDF5 Features
Advanced HDF5 FeaturesAdvanced HDF5 Features
Overview of Parallel HDF5
Overview of Parallel HDF5Overview of Parallel HDF5
Overview of Parallel HDF5
The HDF-EOS Tools and Information Center
 
Introduction to pig & pig latin
Introduction to pig & pig latinIntroduction to pig & pig latin
Introduction to pig & pig latin
knowbigdata
 
NetCDF and HDF5
NetCDF and HDF5NetCDF and HDF5
HDF5 Advanced Topics
HDF5 Advanced TopicsHDF5 Advanced Topics
Overview of Parallel HDF5 and Performance Tuning in HDF5 Library
Overview of Parallel HDF5 and Performance Tuning in HDF5 LibraryOverview of Parallel HDF5 and Performance Tuning in HDF5 Library
Overview of Parallel HDF5 and Performance Tuning in HDF5 Library
The HDF-EOS Tools and Information Center
 
Introduction to HDF5 Data Model, Programming Model and Library APIs
Introduction to HDF5 Data Model, Programming Model and Library APIsIntroduction to HDF5 Data Model, Programming Model and Library APIs
Introduction to HDF5 Data Model, Programming Model and Library APIs
The HDF-EOS Tools and Information Center
 
Introduction to HDF5
Introduction to HDF5Introduction to HDF5
Parallel HDF5 Introductory Tutorial
Parallel HDF5 Introductory TutorialParallel HDF5 Introductory Tutorial
Parallel HDF5 Introductory Tutorial
The HDF-EOS Tools and Information Center
 
Rpg Pointers And User Space
Rpg Pointers And User SpaceRpg Pointers And User Space
Rpg Pointers And User Space
ramanjosan
 
Data Analytics using MATLAB and HDF5
Data Analytics using MATLAB and HDF5Data Analytics using MATLAB and HDF5
Data Analytics using MATLAB and HDF5
The HDF-EOS Tools and Information Center
 
Using HDF5 in MATLAB
Using HDF5 in MATLABUsing HDF5 in MATLAB
Proposal for adding Named Dimensions to HDF5 Arrays
Proposal for adding Named Dimensions to HDF5 ArraysProposal for adding Named Dimensions to HDF5 Arrays
Proposal for adding Named Dimensions to HDF5 Arrays
The HDF-EOS Tools and Information Center
 
Hive ICDE 2010
Hive ICDE 2010Hive ICDE 2010
Hive ICDE 2010
ragho
 
HDF5 <-> Zarr
HDF5 <-> ZarrHDF5 <-> Zarr

Similar to Dimension Scales in HDF-EOS2 and HDF-EOS5 (20)

Introduction to HDF5 for HDF4 Users
Introduction to HDF5 for HDF4 UsersIntroduction to HDF5 for HDF4 Users
Introduction to HDF5 for HDF4 Users
 
Advanced HDF5 Features
Advanced HDF5 FeaturesAdvanced HDF5 Features
Advanced HDF5 Features
 
Using HDF5 and Python: The H5py module
Using HDF5 and Python: The H5py moduleUsing HDF5 and Python: The H5py module
Using HDF5 and Python: The H5py module
 
The MATLAB Low-Level HDF5 Interface
The MATLAB Low-Level HDF5 InterfaceThe MATLAB Low-Level HDF5 Interface
The MATLAB Low-Level HDF5 Interface
 
Overview of Parallel HDF5 and Performance Tuning in HDF5 Library
Overview of Parallel HDF5 and Performance Tuning in HDF5 LibraryOverview of Parallel HDF5 and Performance Tuning in HDF5 Library
Overview of Parallel HDF5 and Performance Tuning in HDF5 Library
 
Advanced HDF5 Features
Advanced HDF5 FeaturesAdvanced HDF5 Features
Advanced HDF5 Features
 
Overview of Parallel HDF5
Overview of Parallel HDF5Overview of Parallel HDF5
Overview of Parallel HDF5
 
Introduction to pig & pig latin
Introduction to pig & pig latinIntroduction to pig & pig latin
Introduction to pig & pig latin
 
NetCDF and HDF5
NetCDF and HDF5NetCDF and HDF5
NetCDF and HDF5
 
HDF5 Advanced Topics
HDF5 Advanced TopicsHDF5 Advanced Topics
HDF5 Advanced Topics
 
Overview of Parallel HDF5 and Performance Tuning in HDF5 Library
Overview of Parallel HDF5 and Performance Tuning in HDF5 LibraryOverview of Parallel HDF5 and Performance Tuning in HDF5 Library
Overview of Parallel HDF5 and Performance Tuning in HDF5 Library
 
Introduction to HDF5 Data Model, Programming Model and Library APIs
Introduction to HDF5 Data Model, Programming Model and Library APIsIntroduction to HDF5 Data Model, Programming Model and Library APIs
Introduction to HDF5 Data Model, Programming Model and Library APIs
 
Introduction to HDF5
Introduction to HDF5Introduction to HDF5
Introduction to HDF5
 
Parallel HDF5 Introductory Tutorial
Parallel HDF5 Introductory TutorialParallel HDF5 Introductory Tutorial
Parallel HDF5 Introductory Tutorial
 
Rpg Pointers And User Space
Rpg Pointers And User SpaceRpg Pointers And User Space
Rpg Pointers And User Space
 
Data Analytics using MATLAB and HDF5
Data Analytics using MATLAB and HDF5Data Analytics using MATLAB and HDF5
Data Analytics using MATLAB and HDF5
 
Using HDF5 in MATLAB
Using HDF5 in MATLABUsing HDF5 in MATLAB
Using HDF5 in MATLAB
 
Proposal for adding Named Dimensions to HDF5 Arrays
Proposal for adding Named Dimensions to HDF5 ArraysProposal for adding Named Dimensions to HDF5 Arrays
Proposal for adding Named Dimensions to HDF5 Arrays
 
Hive ICDE 2010
Hive ICDE 2010Hive ICDE 2010
Hive ICDE 2010
 
HDF5 <-> Zarr
HDF5 <-> ZarrHDF5 <-> Zarr
HDF5 <-> Zarr
 

More from The HDF-EOS Tools and Information Center

Cloud-Optimized HDF5 Files
Cloud-Optimized HDF5 FilesCloud-Optimized HDF5 Files
Cloud-Optimized HDF5 Files
The HDF-EOS Tools and Information Center
 
Accessing HDF5 data in the cloud with HSDS
Accessing HDF5 data in the cloud with HSDSAccessing HDF5 data in the cloud with HSDS
Accessing HDF5 data in the cloud with HSDS
The HDF-EOS Tools and Information Center
 
The State of HDF
The State of HDFThe State of HDF
Highly Scalable Data Service (HSDS) Performance Features
Highly Scalable Data Service (HSDS) Performance FeaturesHighly Scalable Data Service (HSDS) Performance Features
Highly Scalable Data Service (HSDS) Performance Features
The HDF-EOS Tools and Information Center
 
Creating Cloud-Optimized HDF5 Files
Creating Cloud-Optimized HDF5 FilesCreating Cloud-Optimized HDF5 Files
Creating Cloud-Optimized HDF5 Files
The HDF-EOS Tools and Information Center
 
HDF5 OPeNDAP Handler Updates, and Performance Discussion
HDF5 OPeNDAP Handler Updates, and Performance DiscussionHDF5 OPeNDAP Handler Updates, and Performance Discussion
HDF5 OPeNDAP Handler Updates, and Performance Discussion
The HDF-EOS Tools and Information Center
 
Hyrax: Serving Data from S3
Hyrax: Serving Data from S3Hyrax: Serving Data from S3
Hyrax: Serving Data from S3
The HDF-EOS Tools and Information Center
 
Accessing Cloud Data and Services Using EDL, Pydap, MATLAB
Accessing Cloud Data and Services Using EDL, Pydap, MATLABAccessing Cloud Data and Services Using EDL, Pydap, MATLAB
Accessing Cloud Data and Services Using EDL, Pydap, MATLAB
The HDF-EOS Tools and Information Center
 
HDF - Current status and Future Directions
HDF - Current status and Future DirectionsHDF - Current status and Future Directions
HDF - Current status and Future Directions
The HDF-EOS Tools and Information Center
 
HDFEOS.org User Analsys, Updates, and Future
HDFEOS.org User Analsys, Updates, and FutureHDFEOS.org User Analsys, Updates, and Future
HDFEOS.org User Analsys, Updates, and Future
The HDF-EOS Tools and Information Center
 
HDF - Current status and Future Directions
HDF - Current status and Future Directions HDF - Current status and Future Directions
HDF - Current status and Future Directions
The HDF-EOS Tools and Information Center
 
H5Coro: The Cloud-Optimized Read-Only Library
H5Coro: The Cloud-Optimized Read-Only LibraryH5Coro: The Cloud-Optimized Read-Only Library
H5Coro: The Cloud-Optimized Read-Only Library
The HDF-EOS Tools and Information Center
 
MATLAB Modernization on HDF5 1.10
MATLAB Modernization on HDF5 1.10MATLAB Modernization on HDF5 1.10
MATLAB Modernization on HDF5 1.10
The HDF-EOS Tools and Information Center
 
HDF for the Cloud - Serverless HDF
HDF for the Cloud - Serverless HDFHDF for the Cloud - Serverless HDF
HDF for the Cloud - Serverless HDF
The HDF-EOS Tools and Information Center
 
HDF for the Cloud - New HDF Server Features
HDF for the Cloud - New HDF Server FeaturesHDF for the Cloud - New HDF Server Features
HDF for the Cloud - New HDF Server Features
The HDF-EOS Tools and Information Center
 
Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3
Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3
Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3
The HDF-EOS Tools and Information Center
 
STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...
STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...
STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...
The HDF-EOS Tools and Information Center
 
HDF5 and Ecosystem: What Is New?
HDF5 and Ecosystem: What Is New?HDF5 and Ecosystem: What Is New?
HDF5 and Ecosystem: What Is New?
The HDF-EOS Tools and Information Center
 
HDF5 Roadmap 2019-2020
HDF5 Roadmap 2019-2020HDF5 Roadmap 2019-2020
Leveraging the Cloud for HDF Software Testing
Leveraging the Cloud for HDF Software TestingLeveraging the Cloud for HDF Software Testing
Leveraging the Cloud for HDF Software Testing
The HDF-EOS Tools and Information Center
 

More from The HDF-EOS Tools and Information Center (20)

Cloud-Optimized HDF5 Files
Cloud-Optimized HDF5 FilesCloud-Optimized HDF5 Files
Cloud-Optimized HDF5 Files
 
Accessing HDF5 data in the cloud with HSDS
Accessing HDF5 data in the cloud with HSDSAccessing HDF5 data in the cloud with HSDS
Accessing HDF5 data in the cloud with HSDS
 
The State of HDF
The State of HDFThe State of HDF
The State of HDF
 
Highly Scalable Data Service (HSDS) Performance Features
Highly Scalable Data Service (HSDS) Performance FeaturesHighly Scalable Data Service (HSDS) Performance Features
Highly Scalable Data Service (HSDS) Performance Features
 
Creating Cloud-Optimized HDF5 Files
Creating Cloud-Optimized HDF5 FilesCreating Cloud-Optimized HDF5 Files
Creating Cloud-Optimized HDF5 Files
 
HDF5 OPeNDAP Handler Updates, and Performance Discussion
HDF5 OPeNDAP Handler Updates, and Performance DiscussionHDF5 OPeNDAP Handler Updates, and Performance Discussion
HDF5 OPeNDAP Handler Updates, and Performance Discussion
 
Hyrax: Serving Data from S3
Hyrax: Serving Data from S3Hyrax: Serving Data from S3
Hyrax: Serving Data from S3
 
Accessing Cloud Data and Services Using EDL, Pydap, MATLAB
Accessing Cloud Data and Services Using EDL, Pydap, MATLABAccessing Cloud Data and Services Using EDL, Pydap, MATLAB
Accessing Cloud Data and Services Using EDL, Pydap, MATLAB
 
HDF - Current status and Future Directions
HDF - Current status and Future DirectionsHDF - Current status and Future Directions
HDF - Current status and Future Directions
 
HDFEOS.org User Analsys, Updates, and Future
HDFEOS.org User Analsys, Updates, and FutureHDFEOS.org User Analsys, Updates, and Future
HDFEOS.org User Analsys, Updates, and Future
 
HDF - Current status and Future Directions
HDF - Current status and Future Directions HDF - Current status and Future Directions
HDF - Current status and Future Directions
 
H5Coro: The Cloud-Optimized Read-Only Library
H5Coro: The Cloud-Optimized Read-Only LibraryH5Coro: The Cloud-Optimized Read-Only Library
H5Coro: The Cloud-Optimized Read-Only Library
 
MATLAB Modernization on HDF5 1.10
MATLAB Modernization on HDF5 1.10MATLAB Modernization on HDF5 1.10
MATLAB Modernization on HDF5 1.10
 
HDF for the Cloud - Serverless HDF
HDF for the Cloud - Serverless HDFHDF for the Cloud - Serverless HDF
HDF for the Cloud - Serverless HDF
 
HDF for the Cloud - New HDF Server Features
HDF for the Cloud - New HDF Server FeaturesHDF for the Cloud - New HDF Server Features
HDF for the Cloud - New HDF Server Features
 
Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3
Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3
Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3
 
STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...
STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...
STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...
 
HDF5 and Ecosystem: What Is New?
HDF5 and Ecosystem: What Is New?HDF5 and Ecosystem: What Is New?
HDF5 and Ecosystem: What Is New?
 
HDF5 Roadmap 2019-2020
HDF5 Roadmap 2019-2020HDF5 Roadmap 2019-2020
HDF5 Roadmap 2019-2020
 
Leveraging the Cloud for HDF Software Testing
Leveraging the Cloud for HDF Software TestingLeveraging the Cloud for HDF Software Testing
Leveraging the Cloud for HDF Software Testing
 

Recently uploaded

Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 

Recently uploaded (20)

Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 

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
  • 10. HDF Augmentation Tool Augmentation Tool adds HDF5 Dimension Scales inside the file so that netCDF-4 APIs can access the data Page 10
  • 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
  • 13. • Name: SWsetdimscale • Signature: – intn SWsetdimscale( int32 swathID, char *fieldname, char *dimname, int32 dimsize, int32 numbertype, VOIDP data) • Purpose: – Sets dimension scale for a given dimension Page 13
  • 14. • Name: SWgetdimscale • Signature: – intn SWgetdimscale( int32 swathID, char *fieldname, char *dimname, int32 *dimsize, int32 *numbertype, VOIDP data) • Purpose: – Gets dimension scale for a given dimension Page 14
  • 15. • Name: SWsetdimstrs • Signature: – intn SWsetdimstrs( int32 swathID, char *fieldname, char *dimname, char *label, char *unit, char *format) • Purpose: – Sets the label, unit, and format strings for a given dimension Page 15
  • 16. • Name: SWgetdimstrs • Signature: – intn SWgetdimstrs( int32 swathID, char *fieldname, char *dimname, char *label, char *unit, char *format, intn len) • Purpose: – Gets the label, unit, and format strings for a given dimension Page 16
  • 17. • Similar APIs for Dimension Scales in – Grid Fields Page 17
  • 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
  • 27. Writing Code Example (HDF-EOS2) #include "hdf.h" #include "HdfEosDef.h" int main() { intn status, i; int32 swfid, SWid; int32 nbands, nGeoTrack; int32 bands[15]={3,6,9,12,15,18,23,26,29,32,33,34,36,37,39}; char label[16]; char unit[16]; char format[16]; float dataGeoTrack[20]; swfid = SWopen ( "SwathFile.hdf", DFACC_RDWR ); SWid = SWattach ( swfid, "Swath1“ ); Page 27
  • 28. nGeoTrack = 20; for (i=0; i<20; i++) { dataGeoTrack[i] = (float) I; } status = SWsetdimscale ( SWid, "Temperature", "GeoTrack", nGeoTrack, DFNT_FLOAT32, dataGeoTrack ); nbands = 15; status = SWsetdimscale ( SWid, "Spectra", "Bands", nbands, DFNT_INT32, bands ); strcpy (label, "Bands"); strcpy (unit, "none"); strcpy (format, "I2"); status = SWsetdimstrs ( SWid, "Spectra", "Bands", label, unit, format ); SWdetach ( SWid ); SWclose ( swfid ); return 0; } Page 28
  • 29. Writing Code Example (HDF-EOS5) #include <HE5_HdfEosDef.h> int main() { herr_t status = FAIL; hid_t swfid = FAIL; hid_t SWid1 = FAIL; int data[15]={1,2,3,6,9,12,15,18,23,26,29,32, 33,34,35}; char label[16], unit[16], format[16]; int nbands; hsize_t count[3]; swfid = HE5_SWopen ( "Swath.h5", H5F_ACC_RDWR ); SWid1 = HE5_SWattach ( swfid, "Swath1“ ); Page 29
  • 30. nbands = 15; status = HE5_SWsetdimscale ( SWid1, "Spectra", "Bands", nbands, H5T_NATIVE_INT, (void *)data ); strcpy(label, "Bands Dim"); strcpy(unit, "None"); strcpy(format, "I2"); count[0]= 12; status = HE5_SWwritedscaleattr ( SWid1, "Bands", "label", H5T_NATIVE_CHAR, count, label ); count[0]= 6; status = HE5_SWwritedscaleattr ( SWid1, "Bands", "unit", H5T_NATIVE_CHAR, count, unit ); count[0]= 4; status = HE5_SWwritedscaleattr ( SWid1, "Bands", "format", H5T_NATIVE_CHAR, count, format ); Page 30
  • 31. int datbuf_i1[1] = {-999}; count[0]= 1; status = HE5_SWwritedscaleattr ( SWid1, "Bands", "MissingValue", H5T_NATIVE_INT, count, datbuf_i1 ); int datbuf_i2[3] = {-999, 0, 999}; count[0]= 3; status = HE5_SWwritedscaleattr(SWid1, "Bands", "IntValues", H5T_NATIVE_INT, count, datbuf_i2 ); HE5_SWdetach ( SWid1 ); HE5_SWclose ( swfid ); return 0; } Page 31
  • 32. Reading Code Example (HDF-EOS2) #include "hdf.h" #include "HdfEosDef.h" Int main() { intn status, i; int32 swfid, SWid; int32 *datbuf_int32; int32 nbands, data_type, dimsize, dimsize1; intn len, buffsize; char label[16], unit[16], format[16]; swfid = SWopen ( "SwathFile.hdf", DFACC_RDWR ); SWid = SWattach ( swfid, "Swath1“ ); /* get Bands */ dimsize = SWdiminfo ( SWid, "Bands“ ); buffsize = SWgetdimscale ( SWid, "Spectra", "Bands", &dimsize1, &data_type, NULL ); Page 32
  • 33. datbuf_int32 = (int32 *) malloc(buffsize); buffsize = SWgetdimscale ( SWid, "Spectra", "Bands", &dimsize1, &data_type, (void *)datbuf_int32 ); for (i=0; i<dimsize; i++) { printf("i = %d datbuf_int32 = %dn", i, datbuf_int32[i]); } /* get str attributes of Bands*/ len = 15; status = SWgetdimstrs ( SWid, "Spectra", "Bands", label, unit, format, len ); printf(" ttlabel = %s unit = %s format = %s nn", label, unit, format); free(datbuf_int32); datbuf_int32 = NULL; SWdetach ( SWid ); SWclose ( swfid ); return 0; } Page 33
  • 34. Reading Code Example (HDF-EOS5) #include <HE5_HdfEosDef.h> int main() { herr_t status = FAIL; hid_t swfid = FAIL, SWid = FAIL, numtype; int i,j, bufsize; int *databuff; long nattr, strbufsize; char *attrlist, *attrname = (char *)NULL; size_t fldnmlen[HE5_HDFE_NAMBUFSIZE]; char *fldnm[HE5_HDFE_NAMBUFSIZE]; hid_t *ntype; hsize_t count = 0; void *attr; int *attr_int; float *attr_flt; char *attr_char; hsize_t dimsize; swfid = HE5_SWopen ( "Swath.h5", H5F_ACC_RDWR ); SWid = HE5_SWattach ( swfid, "Swath1“ ); Page 34
  • 35. bufsize = HE5_SWgetdimscale ( SWid, "Spectra", "Bands", &dimsize, &numtype, NULL ); databuff = (int *) malloc(bufsize ); bufsize = HE5_SWgetdimscale ( SWid, "Spectra", "Bands", &dimsize, &numtype, (void *)databuff ); for( i = 0; i < dimsize; i++) { printf ("DscaleVal[%d] = %dn",i,databuff[i] ); } nattr = HE5_SWinqdscaleattrs ( SWid, "Bands", NULL, &strbufsize ); attrlist = (char *) calloc(strbufsize + 1, sizeof(char)); nattr = HE5_SWinqdscaleattrs ( SWid, "Bands", attrlist, &strbufsize ); nattr = HE5_EHparsestr(attrlist, ',', fldnm, fldnmlen); Page 35
  • 36. for( i = 0; i < nattr; i++) { attrname = (char *) calloc(fldnmlen[i] + 1, sizeof(char) ); memmove ( attrname,fldnm[i],fldnmlen[i] ); ntype = (hid_t *) calloc(1, sizeof(hid_t)); if ( strcmp ( attrname, "REFERENCE_LIST") == 0 ) continue; status = HE5_SWdscaleattrinfo ( SWid,"Bands", attrname, ntype, &count ); if( (int)*ntype == 0) { attr_int = (int *) malloc(count*sizeof(int)); attr = (void *) attr_int; } if( (int)*ntype == 10) { attr_flt = (float *) malloc(count*sizeof(float)); attr = (void *) attr_flt; } if( (int)*ntype == 57) { attr_char = (char *) malloc((count+1)*sizeof(char)); attr = (void *) attr_char; } status = HE5_SWreaddscaleattr ( SWid,"Bands", attrname, attr ); printf("tAttribute Name: %s n",attrname); printf("tNumber of attr elem: %lu n", (unsigned long)count); printf("tData type of attribute: %d n", (int)*ntype); Page 36
  • 37. if( (int)*ntype == 0) { attr_int = (int *) attr; for (j = 0; j < count; j++) { printf("tAttrvalue[%d]: } if( (int)*ntype == 10) { attr_flt = (float *) attr; for (j = 0; j < count; j++) { printf("tAttrvalue[%d]: } } } if( (int)*ntype == 57) { attr_char = (char *) attr; attr_char[count]='0'; printf("tAttrvalue: free ( attr_char ); } %d n", j,attr_int[j]); } %f n", j,attr_flt[j]); } %s n", attr_char); HE5_SWdetach ( SWid ); HE5_SWclose ( swfid ); return 0; Page 37
  • 38. Test File content (he2) HDFView 2.4: uses plug-in with hdf-eos5-1.11, Hdfeos2.15, HDF4.2r3, HDF5-1.6.7 Page 38
  • 39. Test File content (he5) HDFView 2.4: uses plug-in with hdf-eos5-1.11, Hdfeos2.15, HDF4.2r3, HDF5-1.6.7 Page 39
  • 40. Test File content (he5) HDFView 2.6: Without plug-in HDF4.2r4, HDF5-1.8.3 Page 40
  • 41. Test File content (he5) HDFView 2.6: uses plug-in with hdf-eos5-1.12, Hdfeos2.16, HDF4.2r4, HDF5-1.8.3 Page 41
  • 42. File content (HIRDLS he5) HIRDLS he5 Modified with HDF Augmentation Tool Page 42
  • 43. Suggestions? – Do we need new APIs ? – Improvements for existing APIs ? – What else? Page 43