1 / 9

MATLAB's HDF5 Updates John Evans Image and Scientific Data Formats

MATLAB's HDF5 Updates John Evans Image and Scientific Data Formats. Quick Overview. The MATLAB HDF5 low-level interface is divided into “packages” that correspond to the HDF5 interfaces. One such class is “H5F”, which has “open” as a member function.

tracen
Download Presentation

MATLAB's HDF5 Updates John Evans Image and Scientific Data Formats

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MATLAB's HDF5 Updates John Evans Image and Scientific Data Formats

  2. Quick Overview The MATLAB HDF5 low-level interface is divided into “packages” that correspond to the HDF5 interfaces. One such class is “H5F”, which has “open” as a member function. H5, H5A, H5D, H5DS, H5E, H5F, H5G, H5I, H5L, H5ML(??), H5O, H5P, H5R, H5S, H5T, H5Z. H5ML is a special MATLAB “helper” package.

  3. R2009b What's New In R2009b • HDF5 offerings based on library version 1.8.1 • Support for H5L, H5O, H5DS interfaces • A little bit more speed! • Over 300 functions in corresponding to HDF5 C API 3

  4. R2009b Link Interface >> help H5L Contents for H5L: Link interface H5L.create_hard - Creates a hard link H5L.create_soft - Creates a soft link H5L.delete - Deletes a link H5L.exists - Checks for the existence of a link H5L.get_info - Returns information about a link H5L.get_val - Returns the value of a symbolic link H5L.iterate - Iterates through links in a group H5L.iterate_by_name - Iterates through links in a group H5L.move - Moves a link from one location to another H5L.visit - Iterate through all links in and below a group H5L.visit_by_name - Iterate through all links in and below a group 4

  5. R2009b H5COPY >> help h5copy H5COPY copies an object from one HDF5 file to another file. h5copy(INPUTFILE,OUTPUTFILE,SRCOBJ,DSTOBJ) copies the source object name SRCOBJ in the input HDF5 file INPUTFILE to the destination identified by DSTOBJ in OUTPUTFILE. The behavior of the copy is to recursively copy all objects below the group, keep soft links as they are, keep external links as they are, update only the values of object references, and to copy attributes along with the object. This program was translated from the source code of "h5copy.c" written by Pedro Vicente Nunes and Quincey Koziol, THG. 5

  6. R2009b H5COPY % open input file ifid = H5F.open(ifile,'H5F_ACC_RDONLY','H5P_DEFAULT'); % open output file if exist(ofile,'file') ofid = H5F.open(ofile,'H5F_ACC_RDWR','H5P_DEFAULT'); else fcpl = H5P.create('H5P_FILE_CREATE'); ofid = H5F.create(ofile,'H5F_ACC_TRUNC',fcpl,'H5P_DEFAULT'); H5P.close(fcpl); end % create property lists for copy ocpl = H5P.create('H5P_OBJECT_COPY'); 6

  7. R2009b H5COPY % create link creation property list lcpl = H5P.create('H5P_LINK_CREATE'); % Set the intermediate creation property H5P.set_create_intermediate_group(lcpl,true); % do the copy H5O.copy(ifid,srcObjName,ofid,dstObjName,ocpl,lcpl); H5P.close(lcpl); H5P.close(ocpl); H5F.close(ifid); H5F.close(ofid); 7

  8. NetCDF-4? Well, sort of... • Native support for netCDF-3 since R2008b, not just yet for netCDF-4… • … but NetCDF-4 is HDF5 under the hood, so you can read with low-level HDF5 interface now. • Java? Yep, it's possible to use netcdf-java right now in MATLAB. • 3rd party mex-file mexcdf recompiled statically with HDF5 and NetCDF-4.

  9. References • MathWorks: http://www.mathworks.com • HDF5TOOLS: go to http://www.mathworks.com/matlabcentral/fileexchange/ and search for HDF5TOOLS • NetCDF Java Library: http://www.unidata.ucar.edu/software/netcdf-java/ • SNCTOOLS: http://mexcdf.sourceforge.net/ • HDF5 Group: go to http://www.hdfgroup.org/ftp/HDF5/examples/examples-by-api/ and look for the MATLAB examples

More Related