-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writing JCAMP-DX files? #28
Comments
Yes, it is certainly within the scope of the project, and there must be some users who would welcome having a JCAMP writer.. If you have a proposal, I'd be glad to add it in. |
I was able to find two libraries that implement this: https://github.com/r-hyperspec/pyspc-write-jdx I think @nzhagen if you wanted to incorporate one of these modules (since they are both freely licensed) that would be nice. Your package is much easier to find then those two |
Bumping this issue because this is something that I would find useful as well. I can try and work on a PR to pull in one of the libraries that @andychase mentioned to write out dx files from a dictionary. |
@frenchytheasian - thanks for raising the issue again. Seeing that there is more need for this than I expected, I went ahead and adapted some code to write JCAMP-DX files. I tried it out using a couple of the infrared spectra in the repo's data folder, but if you are interested, please give it a try and test it out. Let me know if there are any issues! |
Hey @nzhagen! Thanks for the response and the PR. I noticed that the new function does not work on infrared spectra that contain multiple blocks of spectra. I looked at some of the existing infrared files and noticed that they only contain one long block of data. I tested it on data/hnmr_spectra/ethanol_nmr.jdx which also failed with the same error. I can try adding onto the function you've built to handle blocks of data. |
@frenchytheasian - Yeah, I saw that I could quickly implement a function to create a standardized fixed-format single spectrum, but the JCAMP-DX format has so many options that I decided to start with a minimalist approach and work from there. If you are willing to give it a try to add functionality to handle multiple blocks, that would be great! I'd be glad to add that to the codebase. |
@nzhagen - Ahh I see. I haven't dove too deep into the official spec. There are just some specific DX files that I'm trying to parse. I'll write code that can handle those and then possibly go on from there. |
At the moment the
jcamp
module offers only the ability to parse JCAMP-DX files.Would you consider it to be within the scope of the project to export to a file, too?
In this case I would be willing to propose an initial implementation.
The text was updated successfully, but these errors were encountered: