Karl, attached is an IronPython script that demonstrates what
I believe you are trying achieve (for a 2d 32-bit integer array).
The property list you're using is not quite what you want.
The minor difference is:
...
H5P_DEFAULT = H5PropertyListId(H5P.Template.DEFAULT)
H5S_ALL = H5DataSpaceId(H5S.H5SType.ALL)
status = H5D.write(dset, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
H5Array[Int32](data))
...
Best, G.
-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Karl Petersen
Sent: Sunday, January 22, 2012 3:40 PM
To: '[email protected]'
Subject: [Hdf-forum] Selections in Hdf5DotNet
I'm trying to write using selections in Hdf5DotNet 1.8.8 x86-64. The two
writes below should be equivalent, but the first one succeeds and the second
one fails. Why?
(If they are not equivalent, how can I write the equivalent statement with
selections?)
Dim allspace As H5DataSpaceId = New H5DataSpaceId(H5S.H5SType.ALL) Dim DA As
H5PropertyListId = H5P.create(H5P.PropertyListClass.DATASET_ACCESS)
H5D.write(d, double_t, data)
H5D.write(d, double_t, allspace, allspace, DA, data)
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
#===============================================================================
import clr
clr.AddReferenceToFile('HDF5DotNet.dll')
import HDF5DotNet
from HDF5DotNet import *
#===============================================================================
import System
from System import Array, Int32, Int64
#===============================================================================
print '\nInitializing HDF5 library\n'
status = H5.Open()
shape = Array[Int64]((5, 6))
data = Array.CreateInstance(Int32, shape)
for row in range(0, shape[0]):
for col in range(0, shape[1]):
data[row,col] = Int32(row+col)
h5file = H5F.create('SDS.h5', H5F.CreateMode.ACC_TRUNC)
dspace = H5S.create_simple(shape.Length, shape)
dtype = H5T.copy(H5T.H5Type.NATIVE_INT)
status = H5T.setOrder(dtype, H5T.Order.LE)
dset = H5D.create(h5file, 'IntArray', dtype, dspace)
dtype = H5T.copy(H5T.H5Type.NATIVE_INT)
#status = H5D.write(dset, dtype, H5Array[Int32](data))
H5P_DEFAULT = H5PropertyListId(H5P.Template.DEFAULT)
H5S_ALL = H5DataSpaceId(H5S.H5SType.ALL)
status = H5D.write(dset, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
H5Array[Int32](data))
H5D.close(dset)
H5T.close(dtype)
H5S.close(dspace)
H5F.close(h5file)
print '\nShutting down HDF5 library\n'
status = H5.Close()
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org