aboutsummaryrefslogtreecommitdiff
path: root/src/hdf5-file.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-10 14:25:42 +0100
committerThomas White <taw@physics.org>2010-02-17 10:33:25 +0100
commit6563de76906d6a8562a4b25c4c0582f8b7c2d5bd (patch)
treef94dd20410f5c97a6abe0ec7d7890d9a846c73d0 /src/hdf5-file.c
parent1b5c5d980742c358debb6cf2783362d847a90230 (diff)
Add --powder option for generating powder patterns directly
Diffstat (limited to 'src/hdf5-file.c')
-rw-r--r--src/hdf5-file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hdf5-file.c b/src/hdf5-file.c
index d8aee21d..130be3a0 100644
--- a/src/hdf5-file.c
+++ b/src/hdf5-file.c
@@ -100,8 +100,8 @@ void hdfile_close(struct hdfile *f)
}
-int hdf5_write(const char *filename, const int16_t *data,
- int width, int height)
+int hdf5_write(const char *filename, const void *data,
+ int width, int height, int type)
{
hid_t fh, gh, sh, dh; /* File, group, dataspace and data handles */
herr_t r;
@@ -127,7 +127,7 @@ int hdf5_write(const char *filename, const int16_t *data,
max_size[1] = height;
sh = H5Screate_simple(2, size, max_size);
- dh = H5Dcreate(gh, "data", H5T_NATIVE_INT16, sh,
+ dh = H5Dcreate(gh, "data", type, sh,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if ( dh < 0 ) {
ERROR("Couldn't create dataset\n");
@@ -138,7 +138,7 @@ int hdf5_write(const char *filename, const int16_t *data,
/* Muppet check */
H5Sget_simple_extent_dims(sh, size, max_size);
- r = H5Dwrite(dh, H5T_NATIVE_UINT16, H5S_ALL,
+ r = H5Dwrite(dh, type, H5S_ALL,
H5S_ALL, H5P_DEFAULT, data);
if ( r < 0 ) {
ERROR("Couldn't write data\n");