From c9a551b872ae4eb16a606d46a7cf118af24f75f5 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 12 Nov 2009 18:03:12 +0100 Subject: Loads of lattice stuff --- src/hdf5-file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/hdf5-file.c') diff --git a/src/hdf5-file.c b/src/hdf5-file.c index ca1d5450..6eb84aeb 100644 --- a/src/hdf5-file.c +++ b/src/hdf5-file.c @@ -22,7 +22,7 @@ #include "image.h" -int hdf5_write(const char *filename, const uint16_t *data, +int hdf5_write(const char *filename, const double *data, int width, int height) { hid_t fh, gh, sh, dh; /* File, group, dataspace and data handles */ @@ -49,7 +49,7 @@ int hdf5_write(const char *filename, const uint16_t *data, max_size[1] = height; sh = H5Screate_simple(2, size, max_size); - dh = H5Dcreate(gh, "data", H5T_NATIVE_UINT16, sh, + dh = H5Dcreate(gh, "data", H5T_NATIVE_FLOAT, sh, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if ( dh < 0 ) { fprintf(stderr, "Couldn't create dataset\n"); @@ -63,7 +63,7 @@ int hdf5_write(const char *filename, const uint16_t *data, (int)size[1], (int)size[0], (int)max_size[1], (int)max_size[0]); - r = H5Dwrite(dh, H5T_NATIVE_UINT16, H5S_ALL, + r = H5Dwrite(dh, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if ( r < 0 ) { fprintf(stderr, "Couldn't write data\n"); @@ -72,6 +72,8 @@ int hdf5_write(const char *filename, const uint16_t *data, return 1; } + H5Gclose(gh); + H5Dclose(dh); H5Fclose(fh); return 0; -- cgit v1.2.3