Open cheminux opened 8 years ago
This project is just a fork of the orphaned project on sf.net (https://sourceforge.net/projects/jcamp-dx/). Never used NMR data before. Have you tried this fork: https://github.com/kerner1000/jcamp-dx ?
Mayn thanks for the hint.
But my first try with the above mentioned fork failed, I could not even read my data and I do not have time to look in detail.
Anyway I will use your code for my purpos and save my calculated data in separat file.
Thanks for letting me know. Can you send through an example NMR file that exhibits this behavior?
Any example show this behavior. E.g. in your test data with jcamp60.jdx (you have to remove all lines with starting with %% because the parser does not like them)
The library only supports version 5.01 (at least according to NMRJCAMPWriter
), not version 6.0.
jcamp60.jdx
is version 6.0, however.
I also get corrupt (FID) data, try to read it back results in
org.jcamp.parser.JCAMPException: parsing failed
expecting EOL, found '-7'
at org.jcamp.parser.ASDFDecoder.decode(ASDFDecoder.java:60)
at org.jcamp.parser.JCAMPNTuplePage.getXYData(JCAMPNTuplePage.java:224)
at org.jcamp.parser.NMRJCAMPReader.createFID(NMRJCAMPReader.java:130)
at org.jcamp.parser.NMRJCAMPReader.createSpectrum(NMRJCAMPReader.java:325)
at org.jcamp.parser.JCAMPReader.createSpectrum(JCAMPReader.java:109)
I only use the library for NIR data.
I have debugged a little bit and it seems that either the parser or the generator for the compressed data has some problem, I had to read the spec a little bit more to understand what happens. It might also be good to have a uncompressed version of data available but currently all that stuff is hardcoded.
Its me again, sorry for annoying you!
I read a jcamp file with complex nmr data (which works like a charm!) and write directly the produced data with the JCAMPWriter:
... Reading again the new jcamp file lead to multiple messages like:
WARNUNG: x check failed in line1: expected x = 1325727.744000001 but got 7716.745205020741 SCHWERWIEGEND: bad x check value
and
WARNUNG: incorrect ##NPOINTS= or bad ##XYDATA= found 154130, but ##NPOINTS= 131072, setting NPOINTS to 154130
In the end the spectrum is corrupt.
I get the same multiple messages from your test on compiling your source code.
What can I do to write correct nmr jcamp file?
Anyway I would like to thank you for the fantastic work with jcamp-dx. I appreciate your project and would like to use it intensively.
Best regards,
Sven