Main Content

Property (H5P)

Object property lists

Description

Use the MATLAB® HDF5 property interface, H5P, to control and access information about object properties.

General Property List Operations

H5P.close

Close property list

H5P.close(plistID) terminates access to the property list specified by plistID.

H5P.copy

Copy of property list

newplist = H5P.copy(plistID) returns a copy of the property list specified by plistID.

H5P.create

Create new property list

plist = H5P.create(classID) creates a new property list as an instance of the property list class specified by classID. The classID argument can also be an instance of a property list class.

 Details

H5P.get_class

Property list class

plistClass = H5P.get_class(plistID) returns the property list class for the property list specified by plistID.

Generic Property List Operations

H5P.close_class

Close property list class

H5P.close_class(classID) closes the property list class specified by classID.

H5P.equal

Determine equality of property lists

tf = H5P.equal(plistID1,plistID2) returns a positive number if the two property lists specified are equal, and zero if they are not. A negative value indicates failure.

H5P.exist

Determine if specified property exists in property list

tf = H5P.exist(propID,propname) returns a positive value if the property specified by name exists within the property list or class specified by propID. Specify propname as a character vector or string scalar.

H5P.get

Value of specified property in property list

value = H5P.get(plistID,propname) retrieves a copy of the value of the property specified by propname in the property list specified by plistID. Specify propname as a character vector or string scalar. The H5P.get function returns the property as an array of uint8 values. You might need to cast the value to an appropriate datatype to get a meaningful result.

It is recommended to use alternative functions like H5P.get_chunk, H5P.get_layout, H5P.get_size etc., where available, to get values for the common property names.

H5P.get_class_name

Name of property list class

classname = H5P.get_class_name(classID) retrieves the name of the generic property list class and returns it as a character vector classname. If no class is found, H5P.get_class_name returns an empty character vector.

H5P.get_class_parent

Identifier for parent class

pclassObj = H5P.get_class_parent(pclassID) returns an identifier to the parent class object of the property class specified by pclassID.

H5P.get_nprops

Query number of properties in property list or class

numProps = H5P.get_nprops(propID) returns the number of properties in the property list or class specified by propID.

H5P.get_size

Query size of property value in bytes

sz = H5P.get_size(propID,propname) returns the size in bytes of the property specified by propname in the property list or property class specified by propID. Specify propname as a character vector or string scalar.

H5P.isa_class

Determine if property list is member of class

tf = H5P.isa_class(plistID,pclassID) returns a positive number if the property list specified by plistID is a member of the class specified by pclassID, zero if it is not, and a negative value to indicate an error.

H5P.iterate

Iterate over properties in property list

[output,idxOut] = H5P.iterate(propID,idxIn,fnc) executes the operation fnc on each property in the property object specified in propID.

 Details

H5P.set

Set property list value

H5P.set(plistID,propname,value) sets the value of the property specified by propname in the property list specified by plistID to the value specified in value.

It is recommended to use alternative functions like H5P.set_chunk, H5P.set_layout, H5P.set_size, etc., where available, to set values for the common property names.

 Details

Dataset Access, Memory, and Transfer Properties

H5P.get_btree_ratios

B-tree split ratios

[left,middle,right] = H5P.get_btree_ratios(plistID) returns the B-tree split ratios for the dataset transfer property list specified by plistID. The left output specifies the B-tree split ratio for left-most nodes, right corresponds to the right-most nodes and lone nodes, and middle corresponds to all other nodes.

H5P.get_chunk_cache

Raw data chunk cache parameters

[nslots,nbytes,w0] = H5P.get_chunk_cache(daplID) returns the number of chunk slots in the raw data chunk cache hash table (nslots), the maximum possible number of bytes in the raw data chunk cache (nbytes), and the preemption policy value w0 of a dataset access property list specified by daplID.

H5P.get_edc_check

Determine if error detection is enabled

check = H5P.get_edc_check(plistID) queries the dataset transfer property list specified by plistID to determine whether error detection is enabled for data read operations. H5P.get_edc_check returns either H5Z_ENABLE_EDC or H5Z_DISABLE_EDC.

H5P.get_hyper_vector_size

Number of I/O vectors

sz = H5P.get_hyper_vector_size(dxplID) returns the number of I/O vectors to be read or written in hyperslab I/O.

H5P.set_btree_ratios

Set B-tree split ratios for dataset transfer

H5P.set_btree_ratios(plistID,left,middle,right) sets the B-tree split ratios for the dataset transfer property list specified by plistID. The left argument specifies the B-tree split ratio for left-most nodes, right specifies the B-tree split ratio for right-most nodes and lone nodes, and middle specifies the B-tree split ratio for all other nodes.

H5P.set_chunk_cache

Set raw data chunk cache parameters

H5P.set_chunk_cache(daplID,nslots,nbytes,w0) sets the number of elements nslots, the total number of bytes nbytes, and the preemption policy value w0 in the raw data chunk cache.

H5P.set_edc_check

Enable error detection for dataset transfer

H5P.set_edc_check(dtplID,check) sets the dataset transfer property list specified by dtplID to enable or disable error detection when reading data. Specify check as a character vector or string scalar containing 'H5Z_ENABLE_EDC' or 'H5Z_DISABLE_EDC'.

H5P.set_hyper_vector_size

Set number of I/O vectors for hyperslab I/O

H5P.set_hyper_vector_size(dxplID,size) sets the number of I/O vectors to be accumulated in memory before being issued to the lower levels of the HDF5 library for reading or writing the actual data.

 Details

Dataset Creation Properties

H5P.all_filters_avail

Determine availability of all filters

tf = H5P.all_filters_avail(dcplID) returns a positive value if all of the filters set in the dataset creation property list dcplID are currently available, and zero if they are not. A negative value indicates failure.

H5P.fill_value_defined

Determine if fill value is defined

fvstatus = H5P.fill_value_defined(dcplID) determines whether a fill value is defined in the dataset creation property list specified by dcplID.

 Details

H5P.get_alloc_time

Return timing of storage space allocation

allocTime = H5P.get_alloc_time(dcplID) retrieves the timing for storage space allocation from the dataset creation property list specified by dcplID.

 Details

H5P.get_chunk

Return size of chunks

[rank,chunkdims] = H5P.get_chunk(dcplID) retrieves the chunk size of a dataset with dataset creation property list specified by dcplID.

 Details

H5P.get_external

Return information about external file

[name,offset,size] = H5P.get_external(dcplID,idx) returns information about the external file specified by the dataset creation property list dcplID.

 Details

H5P.get_external_count

H5P.get_external_count

numfiles = H5P.get_external_count(dcplID) returns the number of external files for the dataset creation property list specified by dcplID.

H5P.get_fill_time

Return time when fill values are written to dataset

fillTime = H5P.get_fill_time(dcplID) returns the time when fill values are written to the dataset creation property list specified by dcplID.

 Details

H5P.get_fill_value

Return dataset fill value

value = H5P.get_fill_value(dcplID,typeID) returns the dataset fill value defined in the dataset creation property list specified by dcplID. The typeID argument specifies the datatype of the returned fill value.

H5P.get_filter

Return information about filter in pipeline

[filter,flags,values,name] = H5P.get_filter(dcplID,filterIdx) returns information about the filter, specified by its filter index, in the filter pipeline specified by the property list identifier dcplID. This syntax corresponds to the H5Pget_filter interface in version 1.6 of the HDF5 C library.

[filter,flags,values,name,config] = H5P.get_filter(dcplID,filterIdx) returns information about the filter, specified by its filter index, in the filter pipeline, specified by the property list with which it is associated. It also returns information about the filter. Consult the HDF5 documentation for H5Zget_filter_info for information about config. This syntax corresponds to the H5Pget_filter interface in version 1.8 of the HDF5 C library.

H5P.get_filter_by_id

Return information about specified filter

[flags,values,name,config] = H5P.get_filter_by_id(dcplID,idx) returns information about the filter specified by filter idx.

H5P.get_layout

Determine layout of raw data for dataset

layout = H5P.get_layout(dcplID) returns the layout of the raw data for the dataset specified by dataset creation property list identifier dcplID.

 Details

H5P.get_nfilters

Return number of filters in pipeline

numfilters = H5P.get_nfilters(dcplID) returns the number of filters defined in the filter pipeline associated with the dataset creation property list identifier dcplID.

H5P.modify_filter

Modify filter in pipeline

H5P.modify_filter(dcplID,filterID,flags,values) modifies the filter in the filter pipeline.

 Details

H5P.remove_filter

Remove filter from property list

H5P.remove_filter(dcplID,filter) removes the specified filter from the filter pipeline. dcplID is the dataset creation property list identifier.

H5P.set_alloc_time

Set timing for storage space allocation

H5P.set_alloc_time(dcplID,allocTime) sets the timing for the allocation of storage space for the raw data of a dataset.

 Details

H5P.set_chunk

Set chunk size

H5P.set_chunk(dcplID,chunkDims) sets the size of the chunks used to store a chunked layout dataset.

 Details

Note

The HDF5 C library uses C-style ordering for multidimensional arrays, while MATLAB uses FORTRAN-style ordering. The chunkDims parameter assumes C-style ordering. For more information see, Report Data Set Dimensions.

H5P.set_deflate

Set compression method and compression level

H5P.set_deflate(dcplID,level) sets the compression method for the dataset creation property list specified by dcplID to H5D_COMPRESS_DEFLATE. Specify the compression level level as a numeric value between 0 and 9, where 0 is the lowest compression level and 9 is the highest.

H5P.set_external

Add additional file to external file list

H5P.set_external(dcplID,name,offset,nbytes) adds the external file specified by name to the list of external files in the dataset creation property list, dcplID.

 Details

H5P.set_fill_time

Set time when fill values are written to dataset

H5P.set_fill_time(dcplID,fillTime) sets the timing for writing fill values to a dataset in the dataset creation property list specified by dcplID.

 Details

H5P.set_fill_value

Set fill value for dataset creation property list

H5P.set_fill_value(dcplID,typeID,value) sets the fill value for the dataset creation property list specified by dcplID.

 Details

H5P.set_filter

Add filter to filter pipeline

H5P.set_filter(dcplID,filter,flags,values) adds the specified filter and corresponding properties to the end of an output filter pipeline in plistID.

 Details

H5P.set_fletcher32

Set Fletcher32 checksum filter in dataset creation

H5P.set_fletcher32(dcplID) sets the 32-bit Fletcher checksum filter in the dataset creation property list specified by dcplID. The dataset creation property list must have chunking enabled.

H5P.set_layout

Set type of storage for dataset

H5P.set_layout(dcplID,layout) sets the type of storage used to store the raw data for the dataset creation property list specified by dcplID.

 Details

H5P.set_nbit

Set N-Bit filter

H5P.set_nbit(dcplID) sets the N-Bit filter 'H5Z_FILTER_NBIT' for the dataset property list specified by dcplID.

H5P.set_scaleoffset

Set Scale-Offset filter

H5P.set_scaleoffset(dcplID,scaleType,scaleFactor) sets the scale offset filter 'H5Z_FILTER_SCALEOFFSET' for a dataset specified by dcplID. Chunking must already be enabled on the dataset creation property list.

 Details

H5P.set_shuffle

Set shuffle filter

H5P.set_shuffle(dcplID) sets the shuffle filter, H5Z_FILTER_SHUFFLE, in the dataset property list specified by dcplID. Compression must be enabled on the dataset creation property list in order to use the shuffle filter, and best results are usually obtained when the shuffle filter is set immediately prior to setting the deflate filter.

File Access Properties

H5P.get_alignment

Retrieve alignment properties

[threshold,alignment] = H5P.get_alignment(faplID) retrieves the current alignment properties from the file access property list specified by faplID.

H5P.get_driver

Low-level file driver

driverID = H5P.get_driver(plistID) returns the identifier of the low-level file driver associated with the file access property list or data transfer property list specified by plistID. See HDF5 documentation for a list of valid return values.

H5P.get_family_offset

Offset for family file driver

offset = H5P.get_family_offset(faplID) retrieves the value of offset from the file access property list specified by faplID. The offset output is the offset of the data in the HDF5 file that is stored on disk in the selected member file in a family of files.

H5P.get_fapl_core

Information about core file driver properties

[increment,backingStore] = H5P.get_fapl_core(faplID) queries the H5FD_CORE driver properties as set by H5P.set_fapl_core.

 Details

H5P.get_fapl_family

File access property list information

[membSize,membfaplID] = H5P.get_fapl_family(faplID) returns the size in bytes of each file member and the identifier of the file access property list for use with the family driver specified by faplID.

H5P.get_fapl_multi

Information about multifile access property list

[membmap,membfapl,membname,membaddr,relax] = H5P.get_fapl_multi(faplID) returns information about the multifile access property list specified by faplID.

 Details

H5P.get_fclose_degree

File close degree

fcdegree = H5P.get_fclose_degree(faplID) returns the current setting of the file close degree property fcdegree in the file access property list specified by faplID.

 Details

H5P.get_libver_bounds

Library version bounds settings

[low,high] = H5P.get_libver_bounds(faplID) retrieves the lower and upper bounds, low and high, on the HDF5 library release versions that indirectly determine the object format versions used when creating objects in the file. This property is retrieved from the file access property list specified by the parameter faplID.

The H5P.get_libver_bounds function returns low and high as any of these enumerated values:

  • 'H5F_LIBVER_EARLIEST'

  • 'H5F_LIBVER_V18'

  • 'H5F_LIBVER_V110'

  • 'H5F_LIBVER_LATEST'.

H5P.get_gc_references

Garbage collection references setting

tf = H5P.get_gc_references(faplID) returns a value of 1 if the garbage collection references property is on for the file access property list specified by faplID, and 0 if it is off.

H5P.get_mdc_config

Metadata cache configuration

config = H5P.get_mdc_config(faplID) returns the current metadata cache configuration from the file access property list specified by faplID.

H5P.get_meta_block_size

Metadata block size setting

sz = H5P.get_meta_block_size(faplID) returns the current minimum size in bytes of new metadata block allocations.

H5P.get_multi_type

Type of data property for multifile driver

type = H5P.get_multi_type(plistID) returns the data setting from the file access or data transfer property list, plistID.

This function should only be used with an HDF5 file written as a set of files with the multifile driver.

H5P.get_sieve_buf_size

Maximum data sieve buffer size

sz = H5P.get_sieve_buf_size(faplID) returns the current maximum size of the data sieve buffer.

H5P.get_small_data_block_size

Small data block size setting

sz = H5P.get_small_data_block_size(faplID) returns the current setting for the size of the small data block of the file access property list specified by faplID.

H5P.set_alignment

Set alignment properties for file access property list

H5P.set_alignment(faplID,threshold,alignment) sets the alignment properties of the file access property list specified by faplID so that any file object greater than or equal in size to threshold, in bytes, is aligned on an address which is a multiple of the value specified by alignment.

In most cases, the default values of threshold and alignment result in the best performance.

H5P.set_family_offset

Set offset property for family of files

H5P.set_family_offset(faplID,offset)sets offset property in the file access property list specified by faplID for low-level access to a file in a family of files.

 Details

H5P.set_fapl_core

Modify file access to use H5FD_CORE driver

H5P.set_fapl_core(faplID,increment,backingstore) modifies the file access property list specified by faplID to use the H5FD_CORE driver.

 Details

H5P.set_fapl_family

Set file access to use family driver

H5P.set_fapl_family(faplID,membsize,membfaplID) sets the file access property list, faplID, to use the family driver.

 Details

H5P.set_fapl_log

Set use of logging driver

H5P.set_fapl_log(faplID,logfile,flags,bufsize) modifies the file access property list, faplID, to use the logging driver H5FD_LOG.

 Details

H5P.set_fapl_multi

Set use of multifile driver

H5P.set_fapl_multi(faplID,relax) sets the file access property list, faplID, to access HDF5 files created with the multi-driver with default values provided by the HDF5 library. Specify relax as a value of 1 to allow read-only access to incomplete file sets.

H5P.set_fapl_multi(faplID,membmap,membfapl,membname,membaddr,relax) sets the file access property list to use the multifile driver with additional parameters.

 Details

H5P.set_fapl_sec2

Set file access for sec2 driver

H5P.set_fapl_sec2(faplID) modifies the file access property list, faplID, to use the 'H5FD_SEC2' driver.

H5P.set_fapl_split

Set file access for emulation of split file driver

H5P.set_fapl_split(faplID,metaext,metaplistID,rawext,rawplistID) is a compatibility function that enables the multifile driver to emulate the split driver from HDF5 Releases 1.0 and 1.2.

 Details

H5P.set_fapl_stdio

Set file access for standard I/O driver

H5P.set_fapl_stdio(faplID) modifies the file access property list, faplID, to use the standard I/O driver, H5FD_STDIO.

H5P.set_fclose_degree

Set file access for file close degree

H5P.set_fclose_degree(faplID,degree) sets the file close degree property in the file access property list, faplID, to the value specified by degree.

 Details

H5P.set_gc_references

Set garbage collection references flag

H5P.set_gc_references(faplID,gcref) sets the flag for garbage collecting references for the file the file access property list identifier, faplID. Specify the flag gcref as a value of 1 to enable the garbage collection references property, and 0 to disable it.

H5P.set_libver_bounds

Set library version bounds for objects

H5P.set_libver_bounds(faplID,low,high) controls the range of library release versions that will be used when creating objects in a file. The object format versions are determined indirectly from the library release versions specified in the call.

This property is set in the file access property list specified by the parameter faplID.

 Details

H5P.set_mdc_config

Set initial metadata cache configuration

H5P.set_mdc_config(faplID,config) sets the initial metadata cache configuration in the file access property list specified by faplID to the supplied values in config. Before using this function, you should retrieve the current configuration using the H5P.get_mdc_config function.

Many of the fields in the config structure are intended to be used only in close consultation with the HDF Group.

H5P.set_meta_block_size

Set minimum metadata block size

H5P.set_meta_block_size(faplID,size) sets the minimum metadata block size size, in bytes, for the file access property list specified by faplID.

H5P.set_multi_type

Specify type of data to access with MULTI driver

H5P.set_multi_type(faplID,type) sets the type of data to access in the file access or data transfer property list specified by faplID.

 Details

H5P.set_sieve_buf_size

Set maximum size of data sieve buffer

H5P.set_sieve_buf_size(faplID,bufsize) sets the maximum size in bytes of the data sieve buffer, bufsize, which is used by the file drivers that can sieve data.

H5P.set_small_data_block_size

Set size of block reserved for small data

H5P.set_small_data_block_size(faplID,size) sets the maximum size, in bytes, of a contiguous block reserved for small data in the file access property list specified by faplID.

File Creation Properties

H5P.get_istore_k

Return 1/2 rank of indexed storage B-tree

ik = H5P.get_istore_k(fcplID) returns the chunked storage B-tree 1/2 rank of the file creation property list specified by fcplID.

H5P.get_sizes

Return size of offsets and lengths

[offset,lengths] = H5P.get_sizes(fcplID) returns the size of the offsets and lengths used of an HDF5 file.

H5P.get_sym_k

Return size of B-tree 1/2 rank and leaf node 1/2 size

[ik,lk] = H5P.get_sym_k(fcplID) returns the size of the symbol table B-tree 1/2 rank, ik, and the symbol table leaf node 1/2 size, lk.

H5P.get_userblock

Return size of user block

sz = H5P.get_userblock(fcplID) returns the size of a user block.

H5P.get_version

Return version information for file creation property list

[superblock,freelist,symtable,shhdr] = H5P.get_version(fcplID) returns the version of the super block, the global freelist, the symbol table, and the shared object header. Retrieving this information requires the file creation property list.

H5P.set_istore_k

Set size of parameter for indexing chunked datasets

H5P.set_istore_k(fcplID,ik) sets the size of the parameter used to control the B-trees for indexing chunked datasets in the file creation property list specified by fcplID. The ik argument is one half the rank of a tree that stores chunked raw data.

H5P.set_sizes

Set byte size of offsets and lengths

H5P.set_sizes(fcplID,offset,lengths) sets the byte size of the offsets and lengths used to address objects in an HDF5 file.

H5P.set_sym_k

Set size of parameters used to control symbol table nodes

H5P.set_sym_k(faplID,ik,lk) sets the size of parameters used to control the symbol table nodes for the file access property list specified by faplID. The ik argument is one half the rank of a tree that stores a symbol table for a group, and lk is one half of the number of symbols that can be stored in a symbol table node.

H5P.set_userblock

Set the user block size

H5P.set_userblock(fcplID,size) sets the user block size of the file creation property list specified by fcplID.

Object Copy and Object Creation Properties

H5P.get_attr_creation_order

Return tracking order and indexing settings

crtOrder = H5P.get_attr_creation_order(ocplID) retrieves tracking and indexing settings for attribute creation order.

 Details

H5P.get_attr_phase_change

Retrieve attribute phase change thresholds

[maxCompact,minDense] = H5P.get_attr_phase_change(ocplID) returns attribute phase change thresholds for the dataset or group with creation property list specified by ocplID.

 Details

H5P.get_copy_object

Return properties to be used when object is copied

options = H5P.get_copy_object(ocplID) retrieves the properties currently specified in the object copy property list identifier ocplID, which will be invoked when a new copy is made of an existing object.

H5P.set_attr_creation_order

Set tracking of attribute creation order

H5P.set_attr_creation_order(ocplID,flags) sets tracking and indexing of attribute creation order. By default, the attribute creation order is neither tracked nor indexed.

 Details

H5P.set_attr_phase_change

Set attribute storage phase change thresholds

H5P.set_attr_phase_change(ocplID,maxCompact,minDense) sets the attribute storage phase change thresholds for the group or dataset with creation order property list specified by ocplID.

 Details

H5P.set_copy_object

Set properties to be used when objects are copied

H5P.set_copy_object(ocplID,options) sets the properties in the object copy property list ocplID that will be invoked when a new copy is made of an existing object.

ocplID is the object copy property list and specifies the properties governing the copying of the object.

 Details

Group Creation Properties

H5P.get_create_intermediate_group

Determine creation of intermediate groups

tf = H5P.get_create_intermediate_group(lcplID) determines whether the link creation property list lcplID is set to enable creating missing intermediate groups.

H5P.get_link_creation_order

Query if link creation order is tracked

crtOrder = H5P.get_link_creation_order(gcplID) queries whether link creation order is tracked or indexed in a group with creation property list identifiergcplID.

 Details

H5P.get_link_phase_change

Query settings for conversion between groups

[maxCompact,minDense] = H5P.get_link_phase_change(gcplID) retrieves the settings for conversion between compact and dense groups.

 Details

H5P.set_create_intermediate_group

Set creation of intermediate groups

H5P.set_create_intermediate_group(lcplID,flag) specifies in the link creation property list lcplID whether to create missing intermediate groups.

H5P.set_link_creation_order

Set creation order tracking and indexing

H5P.set_link_creation_order(gcplID,crtOrder) sets creation order tracking and indexing for links in the group with group creation property list identifier gcplID.

 Details

H5P.set_link_phase_change

Set parameters for group conversion

H5P.set_link_phase_change(gcplID,maxCompact,minDense) sets the parameters for conversion between compact and dense groups.

 Details

HDF5 String Properties

H5P.get_char_encoding

Return character encoding

encoding = H5P.get_char_encoding(plistID) returns the character encoding used to encode strings or object names that are created with the property list specified by plistID.

 Details

H5P.set_char_encoding

Set character encoding used to encode strings

H5P.set_char_encoding(plistID,encoding) sets the character encoding used to encode strings or object names that are created with the property list specified by plistID.

 Details

Virtual Dataset (VDS) Properties

H5P.get_virtual_count

Number of mappings for the virtual dataset (since R2021b)

count = H5P.get_virtual_count(dcplID) gets the number of mappings for the virtual dataset count associated with the dataset creation property list identifier dcplID.

H5P.get_virtual_dsetname

Name of source dataset (since R2021b)

srcname = H5P.get_virtual_dsetname(dcplID,mapIdx) returns the name of the source dataset srcname used in the mapping for the virtual dataset.

 Details

H5P.get_virtual_filename

Name of file for source dataset (since R2021b)

srcname = H5P.get_virtual_filename(dcplID,mapIdx) returns the name of the file for a source dataset used in the mapping for the virtual dataset.

 Details

H5P.get_virtual_printf_gap

Maximum number of missing source files or datasets with printf-style names (since R2021b)

gapsize = H5P.get_virtual_printf_gap(daplID) returns the maximum number of printf-style files and/or datasets allowed to be missing for determining the extent of an unlimited virtual dataset with printf-style mappings. The default library value for gapsize is 0.

H5P.get_virtual_srcspace

Dataspace identifier for source dataset (since R2021b)

srcdspaceID = H5P.get_virtual_srcspace(dcplID,mapIdx) returns a dataspace identifier for the selection within the source dataset used in the mapping.

 Details

H5P.get_virtual_view

View of virtual dataset (since R2021b)

view = H5P.get_virtual_view(daplID) returns the view of a dataset access property list identifier for the virtual dataset daplID.

 Details

H5P.get_virtual_vspace

Dataspace identifier for selection (since R2021b)

vdspaceID = H5P.get_virtual_vspace(dcplID,mapIdx) returns a dataspace identifier for the selection within the virtual dataset used in the mapping. The dataspace identifier must be closed with H5S.close().

 Details

H5P.set_virtual

Set the mapping between virtual and source datasets (since R2021b)

H5P.set_virtual(dcplID,vspaceID,srcfilename,srcdsetname,srcspaceID) maps the elements of the virtual dataset, described by the virtual dataspace identifier vspaceID, to the elements of the source dataset described by the source dataspace identifier srcspaceID.

 Details

H5P.set_virtual_printf_gap

Set maximum number of missing source files or datasets with printf-style names (since R2021b)

H5P.set_virtual_printf_gap(daplID,gapsize) sets the access property list for the virtual dataset daplID to instruct the library to stop looking for the mapped data stored in the files and/or datasets with the printf-style names after not finding gapsize files and/or datasets. The found source files and datasets will determine the extent of the unlimited virtual dataset with the printf-style mappings.

 Details

H5P.set_virtual_view

Set view of virtual dataset (since R2021b)

H5P.set_virtual_view(daplID,view) sets the view of the virtual dataset to include or exclude missing mapped elements.

 Details

Metadata Cache Fine-Tuning Properties

H5P.get_metadata_read_attempts

Number of read attempts (since R2021b)

attempts = H5P.get_metadata_read_attempts(faplID) returns the number of read attempts from a file access property list specified by faplID.

 Details

H5P.set_metadata_read_attempts

Set number of read attempts (since R2021b)

H5P.set_metadata_read_attempts(faplID,attempts) sets the number of reads that the library will try when reading checksummed metadata in an HDF5 file opened with SWMR access. Specify attempts as a numeric value greater than zero.

Partial Edge Chunk Properties

H5P.get_chunk_opts

Edge chunk option setting (since R2021b)

options = H5P.get_chunk_opts(dcplID) returns the edge chunk option setting stored in the dataset creation property list specified by dcplID.

H5P.set_chunk_opts

Set edge chunk option setting (since R2021b)

H5P.set_chunk_opts(dcplID,options) specifies storage options for chunks on the edge of a dataset's dataspace for dataset creation property list. This allows for performance tuning in cases where the dataset size may not be a multiple of the chunk size and the handling of partial edge chunks can impact performance.

 Details

Examples

expand all

Query information about property lists associated with the file 'example.h5' and some datasets in the file.

Open the file and query the property lists.

fid = H5F.open('example.h5');
fapl = H5F.get_access_plist(fid);
fcpl = H5F.get_create_plist(fid);

Get the library version bounds.

[low,high] = H5P.get_libver_bounds(fapl);

Determine whether two property lists are equal.

if H5P.equal(fapl,fcpl)
    fprintf('property lists are equal\n');
else
    fprintf('property lists are not equal\n');
end

Determine whether a property in the property list exists.

if H5P.exist(fapl,'sieve_buf_size')
    fprintf('sieve buffer size property exists\n');
else
    fprintf('sieve buffer size property does not exist\n');
end

Return the size of chunks in a dataset.

dset_id = H5D.open(fid,'/g4/time');
dcpl = H5D.get_create_plist(dset_id);
[rank,chunk_dims] = H5P.get_chunk(dcpl);
H5D.close(dset_id);

Determine the layout of a dataset.

dset_id = H5D.open(fid,'/g3/integer');
dcpl = H5D.get_create_plist(dset_id);
layout = H5P.get_layout(dcpl);
switch(layout)
    case H5ML.get_constant_value('H5D_COMPACT')
        fprintf('layout is compact\n');
    case H5ML.get_constant_value('H5D_CONTIGUOUS')
        fprintf('layout is contiguous\n');
    case H5ML.get_constant_value('H5D_CHUNKED')
        fprintf('layout is chunked\n');
    case H5ML.get_constant_value('H5D_VIRTUAL')
        fprintf('layout is virtual\n');
end
H5D.close(dset_id);
H5F.close(fid);

Set the chunk size and compression settings for dataset creation.

Create new property lists.

fcpl = H5P.create('H5P_FILE_CREATE');
fapl = H5P.create('H5P_FILE_ACCESS');

Set the library version bounds, create the HDF5 file, and create a copy of its datatype.

H5P.set_libver_bounds(fapl,'H5F_LIBVER_LATEST','H5F_LIBVER_LATEST');
fid = H5F.create('myfile.h5','H5F_ACC_TRUNC',fcpl,fapl);
type_id = H5T.copy('H5T_NATIVE_DOUBLE');

Create a simple dataspace with the upper limit on the size of each dimension as unlimited.

unlimited = H5ML.get_constant_value('H5S_UNLIMITED');
dims = [512 1024];
h5_dims = fliplr(dims);
h5_maxdims = [unlimited unlimited];
space_id = H5S.create_simple(2,h5_dims,h5_maxdims);
dcpl = H5P.create('H5P_DATASET_CREATE');

Set the chunk size.

chunk_dims = [512 1024];
h5_chunk_dims = fliplr(chunk_dims);
H5P.set_chunk(dcpl,h5_chunk_dims);

Set the compression method to 'H5D_COMPRESS_DEFLATE' and the level to 5. Create the dataset.

H5P.set_deflate(dcpl,5);
dset_id1 = H5D.create(fid,'DS1',type_id,space_id,dcpl);

Close the identifiers.

H5P.close(dcpl);
H5D.close(dset_id1);

Create a dataset and set the storage type for dataset creation.

Create new property lists.

fcpl = H5P.create('H5P_FILE_CREATE');
fapl = H5P.create('H5P_FILE_ACCESS');

Set the library version bounds, create the HDF5 file, and create a copy of its datatype.

H5P.set_libver_bounds(fapl,'H5F_LIBVER_LATEST','H5F_LIBVER_LATEST');
fid = H5F.create('myfile.h5','H5F_ACC_TRUNC',fcpl,fapl);
type_id = H5T.copy('H5T_NATIVE_DOUBLE');

Create a simple dataspace.

dims = [100 200];
h5_dims = fliplr(dims);
space_id = H5S.create_simple(2,h5_dims,[]);

dcpl = H5P.create('H5P_DATASET_CREATE');
layout = H5ML.get_constant_value('H5D_CONTIGUOUS');

Set the storage layout of the dataset, then create the dataset.

H5P.set_layout(dcpl,layout);
dset_id2 = H5D.create(fid,'DS2',type_id,space_id,dcpl);

Close all identifiers.

H5P.close(dcpl);
H5D.close(dset_id2);

H5P.close(fcpl);
H5P.close(fapl);
H5F.close(fid);

Set the character encoding for a property list, get information about the filters of a dataset, and iterate over properties in its property list.

Set the character encoding and retrieve it.

plist_id1 = H5P.create( 'H5P_ATTRIBUTE_CREATE' );
H5P.set_char_encoding( plist_id1, 'H5T_CSET_UTF8' );
actValue1 = H5P.get_char_encoding( plist_id1 );
H5P.close( plist_id1 );

Return information about the specified filter, and set the N-Bit filter, H5Z_FILTER_NBIT, in dcpl.

filter_id = H5ML.get_constant_value( 'H5Z_FILTER_NBIT' );
dcpl = H5P.create( 'H5P_DATASET_CREATE' );

H5P.set_nbit( dcpl );
[~,~,actName] = H5P.get_filter_by_id( dcpl, filter_id );
H5P.close( dcpl );

Iterate over properties in the property list and invoke a callback function whose handle is @propertyIterator. Then, close the identifier.

fid = H5F.open('example.h5');
dset_id = H5D.open(fid,'/g1/g1.1/dset1.1.1');
plist = H5D.get_create_plist(dset_id);
[output, idx] = H5P.iterate(plist, 0, @propertyIterator);
H5P.close(dcpl);
H5D.close(dset_id);
H5F.close(fid);

The callback function propertyIterator is defined as the following:

function output = propertyIterator(~,prop_name)
fprintf( '%s\n', prop_name );
output = 0;
Introduced before R2006a