Moderators: cyao, michael_borland
-
libov
- Posts: 32
- Joined: 30 May 2013, 07:14
Post
by libov » 21 Jan 2014, 10:09
Michael,
I'm trying to convert HDF5 file to SDDS with the following command:
Code: Select all
hdf2sdds RAW-injected-electrons-001510.h5 RAW-injected-electrons-001510.sdds
It terminates with the error message:
Code: Select all
unable to convert HDF file of 1 dimensions
What am I doing wrong? Or is it not possible to convert such a file? Here is the link to HDF file:
http://www-zeus.desy.de/~libov/download ... -001510.h5
Thanks in advance!
Slava
-
michael_borland
- Posts: 2008
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
-
Contact:
Post
by michael_borland » 21 Mar 2014, 16:45
I've asked Bob Soliday to have a look at this.
--Michael
-
soliday
- Posts: 408
- Joined: 28 May 2008, 09:15
Post
by soliday » 24 Mar 2014, 11:26
Unfortunately, hdf2sdds is not a general purpose conversion program like sdds2hdf is. It was written for a very specific type of HDF file. There are a million ways HDF files can be formatted and not all directly translate into something that fits SDDS. But the file you are trying to convert does. Here are commands you can put into a script to convert this file into SDDS:
h5ls -d -w1 RAW-injected-electrons-001510.h5/ene > tmp.ene
h5ls -d -w1 RAW-injected-electrons-001510.h5/p1 > tmp.p1
h5ls -d -w1 RAW-injected-electrons-001510.h5/p2 > tmp.p2
h5ls -d -w1 RAW-injected-electrons-001510.h5/p3 > tmp.p3
h5ls -d -w1 RAW-injected-electrons-001510.h5/q > tmp.q
h5ls -d -w1 RAW-injected-electrons-001510.h5/x1 > tmp.x1
h5ls -d -w1 RAW-injected-electrons-001510.h5/x2 > tmp.x2
h5ls -d -w1 RAW-injected-electrons-001510.h5/x3 > tmp.x3
plaindata2sdds tmp.ene tmp.ene.sdds -skiplines=3 -skipcolumn=string -noRowCount -column=env,double
plaindata2sdds tmp.p1 tmp.p1.sdds -skiplines=3 -skipcolumn=string -noRowCount -column=p1,double
plaindata2sdds tmp.p2 tmp.p2.sdds -skiplines=3 -skipcolumn=string -noRowCount -column=p2,double
plaindata2sdds tmp.p3 tmp.p3.sdds -skiplines=3 -skipcolumn=string -noRowCount -column=p3,double
plaindata2sdds tmp.q tmp.q.sdds -skiplines=3 -skipcolumn=string -noRowCount -column=q,double
plaindata2sdds tmp.x1 tmp.x1.sdds -skiplines=3 -skipcolumn=string -noRowCount -column=x1,double
plaindata2sdds tmp.x2 tmp.x2.sdds -skiplines=3 -skipcolumn=string -noRowCount -column=x2,double
plaindata2sdds tmp.x3 tmp.x3.sdds -skiplines=3 -skipcolumn=string -noRowCount -column=x3,double
rm -f tmp.ene tmp.p1 tmp.p2 tmp.p3 tmp.q tmp.x1 tmp.x2 tmp.x3
sddsxref tmp.ene.sdds tmp.p1.sdds tmp.p2.sdds tmp.p3.sdds tmp.q.sdds tmp.x1.sdds tmp.x2.sdds tmp.x3.sdds RAW-injected-electrons-001510.sdds
rm -f tmp.ene.sdds tmp.p1.sdds tmp.p2.sdds tmp.p3.sdds tmp.q.sdds tmp.x1.sdds tmp.x2.sdds tmp.x3.sdds