Import resulting data into other applications
Data exported to the HDF5 format can be imported into other applications.
Contents |
Exported HDF5 file
The exported file is an HDF5 file. More information about this format can be found here.
The structure of the HDF5 format is a tree-like structure with data elements as leaves, which are called data sets. All the indices start from 0. This structure is as follows:
PSTD
since version 2.1, wasframe
in version 2.0- <domain index>
- <frame index>
- <domain index>
DG
since version 2.1- <frame index>
receiver
since version 2.0- <receiver index>
Settings
since version 2.1- <setting name>
Version 2.0 used /frame
in place of /PSTD
. This change was made to make a difference between the PSTD data and the DG data
For example if you want frame 100 of domain 4, the 5th domain, the data element is at /PSTD/4/100
. Or if you want the data of receiver 6, that is the 7th receiver, then the resulting data is in element /receiver/6
.
Settings
In this group are data sets of size 1 that specify a certain calculation setting. These are the settings with which the calculations are done. Settings with the following names are exported:
- RenderTime
- SoundSpeed
- AttenuationOfPMLCells
- MaxFrequency
- DensityOfAir
- PatchError
- FactRK
- GridSpacing
- BandWidth
- WaveLength
- SpectralInterpolation
- PMLCells
Applications
Here is a list of some of the applications that can import this data.
Matlab
Matlab can import the data. This can be done by the following command:
h5read(filename,datasetname)
where file name is the hdf5 file name and the datasetname is the data set name, eg /PSTD/4/100
or /receiver/6
. For example to read frame 42 from domain 4 that is in hdf5 file "result.h5", the following matlab command can be used h5read('result.h5','/PSTD/4/42')
.
For more info see Matlab hdf5 reference pages. There are also functions that can query the file. The file can be queried for which domains are in it, which frames of each domain and which receivers are in it.
Mathematica
More information about import in mathematica can be found at Mathematica hdf5 reference pages.
Python
Python has also an interface to HDF5. This interface can be found at h5py.org
R
R has also an interface to the HDF5 format. This interface can be found at the CRAN repo. [1]