From f35fd8c3733e207bed0d049d5dab6d8d62327b20 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 12 Dec 2010 15:30:16 -0800 Subject: Be consistent with HDF5 array specification http://www.hdfgroup.org/HDF5/doc/UG/UG_frame12Dataspaces.html says: "Dataspace dimensions are numbered from 1 to rank. HDF5 uses C storage conventions, assuming that the last listed dimension is the fastest-changing dimension and the first-listed dimension is the slowest changing." --- src/hdf5-file.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hdf5-file.c b/src/hdf5-file.c index 4bc39449..2a99939c 100644 --- a/src/hdf5-file.c +++ b/src/hdf5-file.c @@ -91,13 +91,13 @@ int hdfile_set_image(struct hdfile *f, const char *path) int hdfile_get_width(struct hdfile *f) { - return f->nx; + return f->ny; } int hdfile_get_height(struct hdfile *f) { - return f->ny; + return f->nx; } @@ -242,10 +242,10 @@ int hdf5_write(const char *filename, const void *data, return 1; } - size[0] = width; - size[1] = height; - max_size[0] = width; - max_size[1] = height; + size[0] = height; + size[1] = width; + max_size[0] = height; + max_size[1] = width; sh = H5Screate_simple(2, size, max_size); dh = H5Dcreate(gh, "data", type, sh, @@ -401,8 +401,8 @@ int hdf5_read(struct hdfile *f, struct image *image, int satcorr, uint16_t *flags; hid_t mask_dh; - image->height = f->nx; - image->width = f->ny; + image->width = hdfile_get_width(f); + image->height = hdfile_get_height(f); buf = malloc(sizeof(float)*f->nx*f->ny); -- cgit v1.2.3