Page 1 of 1

Example C-code to read nexus

Posted: Thu Mar 14, 2013 9:57 am
by tgruene

Zoe Fisher from LANL provided me neutron data from chymotrypsin which are HDF4 format (filename e.g. R7788.nx.hdf). Is there some example code how to read out data from hdf if you don't have the format description? Or is HDF meant to be self-explaining? If so, I would appreciate some tutorial. The library documentation for HDF seems too overwhelming to successfully read out data from such a file without knowing how it was written, and Zoe forwarded my request for help to somebody else who did the same and the last person would not reply.

Re: Example C-code to read nexus

Posted: Thu Jul 18, 2013 1:37 am
by yayahjb
You may find the code in CBFlib_0.9.2.12 ( helpful.
Take a look at cbf_hdf5.c. You should also find the examples at
helpful. Finally, for a summary of the state of the merger, see My apologies for not responding sooner, but I had a setting wrong on my post notifications from this forum.

Re: Example C-code to read nexus

Posted: Thu Jul 18, 2013 1:41 am
by yayahjb
P.S. All the current documentation and code is for hdf5, but the philosophy of reading from either hdf4 or hdf5 has a lot in common.
I would, however, suggest moving to hdf5 when you can.