240 likes | 415 Views
HDF-Java Products. Peter Cao The HDF Group The 13 th HDF and HDF-EOS Workshop November 3-5, 2009. Outline. HDF-Java products Short demo of NPOESS features Full support of HDF5 1.8 in HDF-Java.
E N D
HDF-Java Products Peter Cao The HDF Group The 13th HDF and HDF-EOS Workshop November 3-5, 2009 HDF/HDF-EOS Workshop XIII
Outline HDF-Java products Short demo of NPOESS features Full support of HDF5 1.8 in HDF-Java HDF/HDF-EOS Workshop XIII
What are the HDF-Java products? HDF-Java HDF Java Wrapper Object Package Viewer Editor HDF/HDF-EOS Workshop XIII
Java Wrapper Pure Java Library HDF JNI a programming framework that allows Java code to call and be called by applications and libraries written in other languages NetCDF-Java library HDF HDF/HDF-EOS Workshop XIII
Pure Java Library • Pros: • True platform independence • Direct access to file (no data conversion between C and Java) Pure Java Library • Cons: • Substantial amount of work to support features in the C library. HDF HDF/HDF-EOS Workshop XIII
HDF JNI • Pros: • Easy to implement • Easy to keep up with the library changes HDF • Cons: • Requires data conversion between C and Java • The JNI is platform dependent HDF HDF/HDF-EOS Workshop XIII
Java Wrapper C Java C Native Impl. HDF h5Imp.c H5.java HDF/HDF-EOS Workshop XIII
Java Wrapper: C versus Java C Java public static native int H5Fopen ( String name, int flags, int access_id); hid_t H5Fopen ( const char *name, unsigned flags, hid_t access_id ); HDF/HDF-EOS Workshop XIII
Object Package HDF-Java HDF Java Wrapper Object Package Viewer Editor HDF/HDF-EOS Workshop XIII
Java Wrapper: read data A very simple example. Is there an easy way? int fid, did, sid, tid, rank; long dims[], maxDims[]; Object theData; fid = H5.H5Fopen( fname, HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT); did = H5.H5Dopen(fid, dname); sid = H5.H5Dget_space(did); tid = H5.H5Dget_type(did); rank = H5.H5Sget_simple_extent_ndims(sid); dims = new long[rank]; maxDims = new long[rank]; H5.H5Sget_simple_extent_dims(sid, dims, maxDims); theData = allocateArray(tid, dims); H5.H5Dread( did, tid, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT, theData); H5.H5Sclose(sid); H5.H5Tclose(tid); H5.H5Dclose(did); H5.H5Fclose(fid); HDF/HDF-EOS Workshop XIII
Object Package: the easy way theData = Dataset.read(); HDF/HDF-EOS Workshop XIII
Object Package: main purposes For the application developers • Less function calls • Easy to extend for specific needs HDF/HDF-EOS Workshop XIII
Object Package: basic objects File Group Dataset Datatype Attribute http://www.hdfgroup.org/hdf-java-html/hdf-object/
HDFView HDF-Java HDF Java Wrapper Object Package Viewer Editor HDF/HDF-EOS Workshop XIII
HDFView HDF/HDF-EOS Workshop XIII
Outline HDF-Java products Short demo of advanced features to support NPOESS data Full support of HDF5 1.8 in HDF-Java HDF/HDF-EOS Workshop XIII
Features to support NPOESS data • Aggregated granules • dataset pointed by an object reference • Granules • Subset pointed a region reference • Quality Flags • bits of quality flags packed in one byte • HDFView version 2.5 patch 3 http://www.hdfgroup.org/ftp/HDF5/hdf-java/v25p3/ HDF/HDF-EOS Workshop XIII
Outline HDF-Java products Short demo of advanced features to support NPOESS data Full support of HDF5 1.8 in HDF-Java HDF/HDF-EOS Workshop XIII
HDF5 1.8 support Take advantages of HDF5 1.8 library New capabilities. Performance improvements. HDF/HDF-EOS Workshop XIII
HDF5 1.8 support www.hdfgroup.uiuc.edu/RFC/HDF5/hdf-java/ Support HDF5 1.8 APIs in JHI5 Use new APIs in the hdf-java objects Add 1.8 features in HDFView HDF/HDF-EOS Workshop XIII
HDF5 1.8 support: New APIs HDF/HDF-EOS Workshop XIII
HDF5 1.8 support: possible changes • Package names • “org.hdfgroup.hdf.” • “hdf.” • “ncsa.hdf.” • Class structure • H5, H5D, H5F, etc. HDF/HDF-EOS Workshop XIII
Acknowledgements This work was supported by cooperative agreement number NNX08AO77A from the National Aeronautics and Space Administration (NASA). Any opinions, findings, conclusions, or recommendations expressed in this material are those of the author[s] and do not necessarily reflect the views of the National Aeronautics and Space Administration. HDF/HDF-EOS Workshop XIII
Thank You!Questions/comments? HDF/HDF-EOS Workshop XIII