[Hdf-forum] Any c++ samples

2013-04-12 Thread Ramesh Sridharan
Hi all,

I am new to hdf forum. I have few ascii files with filled with vertices and I 
am trying to convert them to layers each containing the arrays. I use the C++ 
code for this. I tried to download the simple c++ samples for this conversion 
along with necessary lib/dlls but I for some reason i am having hard time. Does 
anyone have a sample for this or any pointers? I really appreciate your help. 
Thanks. 

Regards,
Ramesh Sridharan
Ph: 505-463-3960
http://www.linkedin.com/in/rameshs

Its only weird if it doesn't work.     
___
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


Re: [Hdf-forum] Any c++ samples

2013-04-12 Thread dashesy
This is not really c++ (am using C interface) but it is an example for
converting some in-house binary format to hdf5
https://github.com/dashesy/CereLink/tree/master/n2h5

I myself appreciate if there are more examples to look



On Thu, Apr 11, 2013 at 11:07 PM, Ramesh Sridharan 
ramesh.sridha...@yahoo.com wrote:

 Hi all,

 I am new to hdf forum. I have few ascii files with filled with vertices
 and I am trying to convert them to layers each containing the arrays. I use
 the C++ code for this. I tried to download the simple c++ samples for this
 conversion along with necessary lib/dlls but I for some reason i am having
 hard time. Does anyone have a sample for this or any pointers? I really
 appreciate your help. Thanks.

 Regards,
 Ramesh Sridharan
 Ph: 505-463-3960
 http://www.linkedin.com/in/rameshs

 Its only weird if it doesn't work.

 ___
 Hdf-forum is for HDF software users discussion.
 Hdf-forum@hdfgroup.org
 http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


___
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


Re: [Hdf-forum] c# read different datatypes

2013-04-12 Thread Insane
Can anyone show how to read string data and compound data,cause all my
attempts end up with unreadable output and without this data i can't go
ahead -__- to make some calculations.
TRAAAVO128F93133D4.h5
http://hdf-forum.184993.n3.nabble.com/file/n4026086/TRAAAVO128F93133D4.h5  
The majority of similar questions in this forum are unanswered (





--
View this message in context: 
http://hdf-forum.184993.n3.nabble.com/c-read-different-datatypes-tp4026057p4026086.html
Sent from the hdf-forum mailing list archive at Nabble.com.

___
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


Re: [Hdf-forum] c# read different datatypes

2013-04-12 Thread coolshashi
Here is a C# class that i created for my application to read / write some 2D
and 3D arrays and basic data types. It has functions to read / write
strings. I have not used compound data. Hope this helps a bit.

Shashi

class HDFFileHandler
{
public enum DataTypes
{
STRING,
INTEGER,
DOUBLE,
BYTE,
USHORT,
FLOAT
}

public H5FileId CreateFile(string filename)
{
return H5F.create(filename, H5F.CreateMode.ACC_TRUNC);
}
public H5GroupId CreateGroup(string groupName, H5LocId parentGroup)
{
return H5G.create(parentGroup, groupName);
}
public H5DataSetId Create1DDataSet(string datasetName,
H5FileOrGroupId parentGroup, DataTypes datatype, int size)
{
long[] dims = new long[1];
dims[0] = size;

H5DataSpaceId spaceId = H5S.create_simple(1, dims);
H5DataTypeId typeId = null;
switch (datatype)
{
case DataTypes.BYTE:
typeId = H5T.copy(H5T.H5Type.NATIVE_UCHAR);
break;
case DataTypes.DOUBLE:
typeId = H5T.copy(H5T.H5Type.NATIVE_DOUBLE);
break;
case DataTypes.INTEGER:
typeId = H5T.copy(H5T.H5Type.NATIVE_INT);
break;
case DataTypes.STRING:
typeId = H5T.copy(H5T.H5Type.C_S1);
break;
case DataTypes.FLOAT:
typeId = H5T.copy(H5T.H5Type.NATIVE_FLOAT);
break;
case DataTypes.USHORT:
typeId = H5T.copy(H5T.H5Type.NATIVE_USHORT);
break;
default:
break;
}
return H5D.create(parentGroup, datasetName, typeId, spaceId);
}
public H5DataSetId Create2DDataSet(string datasetName,
H5FileOrGroupId parentGroup, DataTypes datatype, int sizeX, int sizeY)
{
long[] dims = new long[2];
dims[0] = sizeX;
dims[1] = sizeY;

H5DataSpaceId spaceId = H5S.create_simple(2, dims);
H5DataTypeId typeId = null;
switch (datatype)
{
case DataTypes.BYTE:
typeId = H5T.copy(H5T.H5Type.NATIVE_UCHAR);
break;
case DataTypes.DOUBLE:
typeId = H5T.copy(H5T.H5Type.NATIVE_DOUBLE);
break;
case DataTypes.INTEGER:
typeId = H5T.copy(H5T.H5Type.NATIVE_INT);
break;
case DataTypes.STRING:
typeId = H5T.copy(H5T.H5Type.C_S1);
break;
case DataTypes.FLOAT:
typeId = H5T.copy(H5T.H5Type.NATIVE_FLOAT);
break;
case DataTypes.USHORT:
typeId = H5T.copy(H5T.H5Type.NATIVE_USHORT);
break;
default:
break;
}
return H5D.create(parentGroup, datasetName, typeId, spaceId);
}
public H5DataSetId Create3DDataSet(string datasetName,
H5FileOrGroupId parentGroup, DataTypes datatype, int sizeX, int sizeY, int
nSizeZ)
{
long[] dims = new long[3];
dims[0] = sizeX;
dims[1] = sizeY;
dims[2] = nSizeZ;

H5DataSpaceId spaceId = H5S.create_simple(3, dims);
H5DataTypeId typeId = null;
switch (datatype)
{
case DataTypes.BYTE:
typeId = H5T.copy(H5T.H5Type.NATIVE_UCHAR);
break;
case DataTypes.DOUBLE:
typeId = H5T.copy(H5T.H5Type.NATIVE_DOUBLE);
break;
case DataTypes.INTEGER:
typeId = H5T.copy(H5T.H5Type.NATIVE_INT);
break;
case DataTypes.STRING:
typeId = H5T.copy(H5T.H5Type.C_S1);
break;
case DataTypes.FLOAT:
typeId = H5T.copy(H5T.H5Type.NATIVE_FLOAT);
break;
case DataTypes.USHORT:
typeId = H5T.copy(H5T.H5Type.NATIVE_USHORT);
break;
default:
break;
}
return H5D.create(parentGroup, datasetName, typeId, spaceId);
}
public void CloseFile(H5FileId fileId)
{
H5F.close(fileId);
}
public void CloseGroup(H5GroupId grpId)
{
H5G.close(grpId);
}
public void CloseDataset(H5DataSetId datasetId)
{
H5D.close(datasetId);
}
public H5FileId OpenFile(string filename, 

Re: [Hdf-forum] c# read different datatypes

2013-04-12 Thread Insane
Thx,unfortunately,i have already tried reading string as byte array and it
returns 0 .



--
View this message in context: 
http://hdf-forum.184993.n3.nabble.com/c-read-different-datatypes-tp4026057p4026088.html
Sent from the hdf-forum mailing list archive at Nabble.com.

___
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


Re: [Hdf-forum] c# read different datatypes

2013-04-12 Thread coolshashi
I use that class in my project to read and write strings..And it works
perfectly.

If you had written the string using the write method i have in my class the
read should work..May be the way you have written is different than mine.



--
View this message in context: 
http://hdf-forum.184993.n3.nabble.com/c-read-different-datatypes-tp4026057p4026089.html
Sent from the hdf-forum mailing list archive at Nabble.com.

___
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


Re: [Hdf-forum] c# read different datatypes

2013-04-12 Thread Insane
The problem is ,that i don't write data,i only have a file to read)
but finaly i got the byte array [,] and got data from string table,
now i need just to transfer the values in  [] array and use  
System.Text.Encoding.ASCII.GetString(); to make them readable
I hope it will be fine.
Then i`ll try byte array with compound dataset,just need time)




--
View this message in context: 
http://hdf-forum.184993.n3.nabble.com/c-read-different-datatypes-tp4026057p4026090.html
Sent from the hdf-forum mailing list archive at Nabble.com.___
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


Re: [Hdf-forum] c# read different datatypes

2013-04-12 Thread Insane
Is it possible to read only 1 definite data field and not the hole  dataset
of a table?



--
View this message in context: 
http://hdf-forum.184993.n3.nabble.com/c-read-different-datatypes-tp4026057p4026091.html
Sent from the hdf-forum mailing list archive at Nabble.com.

___
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


[Hdf-forum] HDF5 1.8.11 release candidate is available for testing

2013-04-12 Thread Albert Cheng

Hello everyone,

A pre-release candidate version of HDF5 1.8.11 is available for testing 
and can be downloaded at the following link:


http://www.hdfgroup.uiuc.edu/ftp/pub/outgoing/hdf5/hdf5-1.8.11/hdf5-1.8.11-pre1.tar.gz

If you have some time to test this pre-release, we would greatly 
appreciate it. We try to test on a wide variety of platforms and 
environments but are unable to test everywhere so feedback from the user 
community is always welcome.


Please note that while the release notes contained in the pre-release 
are reflective of the changes and additions present in this release, the 
'platforms tested' and 'tested configurations' sections have yet to be 
updated for this version of HDF5.


We plan to release HDF5 1.8.11 in mid-May barring the discovery of any 
critical issues.


Thank you!

The HDF Group


___
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org