c# - Reading and Operating on a HDF5 File -
i found similar question @ c# hdf5 illustration code i'm having problem viewing hdf5 dataset contents correctly.
the dataset i'm looking @ contains string headers strings in first column , doubles in others.
here's code looks like:
public static void readh5(string path, string filename) { h5.open(); var fileid = h5f.open(path + filename, h5f.openmode.acc_rdonly); var groupid = h5g.open(fileid, "/example group/"); var datasetid = h5d.open(groupid, "events"); var dataspace = h5d.getspace(datasetid); var size = h5s.getsimpleextentdims(dataspace); var datatype = h5d.gettype(datasetid); double[,] dataarray = new double[size[0],11]; var wraparray = new h5array<double>(dataarray); h5d.read(datasetid, datatype, wraparray); console.writeline(wraparray); }
when debug , wraparray each element incredibly big or little doubles 10^300 10^-300 in value , don't know why. don't think id numbers of elements. i've tried changing datatype of wraparray , dataarray object still doesn't give me exact contents of dataset.
the output i'm getting wraparray looks like:
[0,0] 4.0633928641260729e+87 [0,1] 9.77854726248995e-320 [0,2] 1.52021104712121e-312
etc.
but want is:
[0,0] event1 [0,1] 2 [0,2] 56
etc.
after reading in dataset want loop through first column find specific strings, , corresponding elements in other columns. have figure out out.
for me worked checking actual datatype of dataset (using hdfview) , create arrays containing datatype instead of doubles.
c# hdf5
No comments:
Post a Comment