Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [chemclipse-dev] What is the suitable file format for spectrum data store?

I used MATLAB 7.10.0 (R2010a) to write and read hdf5 file with chinese filename. The hdf5write() and hdf5read() function worked fine, but hdf5info() ran into error.
Then I used HDF5View 2.13 from HDF Group to open the above file, failed.


Best regards,

Trig

2016-09-28 17:30 GMT+08:00 Trig Chen <trigchen@xxxxxxxxx>:
The HDF Group have knew this bug. http://hdf-forum.184993.n3.nabble.com/Cross-platform-Unicode-filename-support-tc4028996.html
But it seems this bug would not be fixed soon. Sad for that.


Best regards,

Trig

2016-09-28 17:21 GMT+08:00 Philip Wenig <philip.wenig@xxxxxxxxxxxxx>:
Hi Trig,

please repost this message in the science working group mailing list.


Best,
Philip


Am 28.09.2016 um 11:16 schrieb Trig Chen:
I found there was a big problem: HDF5 can't correctly resolve the unicode filename in Windows system!
Digging the web, it seems a long time problem. :( .
Is there any workaround  to read or write HDF5 file with UTF-8 filename in Windows system in Java?


Best regards,

Trig

2016-09-07 15:55 GMT+08:00 Philip Wenig <philip.wenig@xxxxxxxxxxxxx>:
Looks good :-).
Maybe, you could try to use the file extension *.tms.


Am 06.09.2016 um 05:03 schrieb Trig Chen:
HDF5 concurrent read & write test code snippet:

package hdf5;

import java.io.PrintStream;
import java.util.Arrays;
import java.util.Random;

import ch.systemsx.cisd.hdf5.HDF5Factory;
import ch.systemsx.cisd.hdf5.IHDF5SimpleReader;
import ch.systemsx.cisd.hdf5.IHDF5SimpleWriter;

public class Hdf5Test {
static final String hdf5FileName = "myfile.h5";
static final String tag = "mydata";

public static void main(final String[] args) {

// write thread
new Thread(new Runnable() {
@Override
public void run() {
final IHDF5SimpleWriter writer = HDF5Factory.open(hdf5FileName);
final Random r = new Random();
for (int i = 0; i < 10; i++) {
pause(500);
final float[] data = "" float[1000];
for (int n = 0; n < data.length; n++) {
data[n] = r.nextFloat() * 10000f;
}
writer.writeFloatArray(tag + i, data);
printData(data, 5, System.out);
}
writer.close();
}
}).start();

pause(1000);
// read thread
new Thread(new Runnable() {
@Override
public void run() {
final IHDF5SimpleReader reader = HDF5Factory.open(hdf5FileName);
for (int i = 0; i < 10; i++) {
pause(600);
float[] mydata = new float[1000];
mydata = reader.readFloatArray(tag + i);
printData(mydata, 5, System.err);
}
reader.close();
}
}).start();

}

private static void pause(final int millisecond) {
try {
Thread.sleep(millisecond);
} catch (final InterruptedException e) {
e.printStackTrace();
}
}

private static void printData(final float[] data, final int size, final PrintStream out) {
if ((data == null) || (data.length < size)) {
return;
}
final float[] temp = new float[size];
System.arraycopy(data, 0, temp, 0, size);
out.println(Arrays.toString(temp));
}
}



Best regards,

Trig


_______________________________________________
chemclipse-dev mailing list
chemclipse-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/chemclipse-dev
-- 
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________ chemclipse-dev mailing list chemclipse-dev@xxxxxxxxxxx To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/chemclipse-dev
_______________________________________________
chemclipse-dev mailing list
chemclipse-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/chemclipse-dev
-- 
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~

_______________________________________________
chemclipse-dev mailing list
chemclipse-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/chemclipse-dev



Attachment: matlab-hdf5.png
Description: PNG image

Attachment: HDFView-error.png
Description: PNG image


Back to the top