Is there a way to directly access HDF5 files directly via a GMT command?
Right now, I run a data staging script that makes h5dump calls to save data into binary files, then use GMT commands to reset them to all be the same type (double precision), then use gmtconvert to form a binary table. Then, I can access the resulting multi-column binary file with my GMT plotting scripts, as needed. Just a lot of steps.
I guess what I was thinking of is something akin to gmtconvert. But I suspect it is very ugly prospect to actually implement, since the user would need to know, before-hand, the structure, group and variable names inside the HDF5 file.
Hereās a little code snippet to show you what I do to create a multi-column binary file:
# indsn is an HDF5 file, defined as an input parameter to the script
beam="gt1l"
p_param=${beam}"/ssh_segments"
echo -n " delta_time"
h5dump -y -A 0 -o t0.bin -b LE -d ${p_param}/delta_time $indsn >& /dev/null
echo -n " heights/h"
h5dump -y -A 0 -o t1.bin -b LE -d ${p_param}/heights/h $indsn >& /dev/null
echo " heights/h_var"
h5dump -y -A 0 -o t2.bin -b LE -d ${p_param}/heights/h_var $indsn >& /dev/null
# h5dump initially stages the data
# the -y option is to: Do not print array indices with the data
# the -A 0 option shuts off all the attribute screen dump
# the -o option routes the data to a file
# the -b LE option sets the output as little endian binary
# the -d option selects the specified dataset in the hdf5 file
# gather the data, suppress h5dump messages, too
# convert single precision parameters to double precision
gmt gmtconvert -bi1f -bo1d t2.bin > t2a.bin; mv t2a.bin t2.bin
# gmtconvert command to pull data together into one data set
gmt gmtconvert -bi1d -A -bo3d t0.bin t1.bin t2.bin > outdata.bin