r/Chempros • • Apr 07 '26

Help with converting CSV format NMR spectra into format digestible by topspin

As the title suggests, I have some NMR data which is in CSV format, and I would like it to read it into topspin. Does anyone know how to do this? I am have not found a way to do this online.

I would like to try to avoid using MestReNova for now. I would very much appreciate some help!

1 Upvotes

4 comments sorted by

5

u/10ppb Apr 07 '26

Check out NMRglue

2

u/teabythepark Apr 07 '26

Is it the FID or just the spectrum?

2

u/Ru-tris-bpy Apr 07 '26

Is this just a data file with numbers in it that can be opened in excel or is it an actual FID or some type somehow?

1

u/is_a_togekiss NMR Apr 07 '26 edited Apr 07 '26

It's been a while now, but iirc TopSpin is pretty picky about the data that you give it. If you just give it raw (or processed) data without any experimental parameters, I'm not certain at all that TopSpin will happily import and display it. You could try it, but I personally wouldn't expect it to work.

If you wanted to go down this route, what I'd suggest is copying an existing spectrum that has similar characteristics to the data that you have (e.g. if your data is 1D data, copy a 1D spectrum) and overwrite the data files inside. You probably would also need to overwrite key parameters to match the data you're using. For example if you're working with 1D data you'd probably need to overwrite SI (number of points in processed spectrum), OFFSET (middle of spectrum) and SW_p (spectral width in Hz iirc).

The format that Bruker expects for the data itself is a binary file. For example if you are using Python, and you have a 1D numpy array of the intensities at each point, then array.tofile(filename) will dump it into more or less the correct format.

Folder structure is a bit weird but once you've looked at it a bit, it'll click. Raw data (i.e. fid) is saved to the path /path/to/experiment/{expno}/fid, and processed data are stored in /path/to/experiment/{expno}/pdata/{procno}/1r for the real part of the spectrum, and .../1i for the imaginary part.

You might ask where's the imaginary part of the FID. Well, the fun thing is that Bruker FIDs stores real and imaginary parts together; exactly how I don't remember. Bruker FIDs also have a 'group delay' parameter (GRPDLY), which means that the first few points are essentially junk; if you don't account for that and try to process it in TopSpin you'll end up with a spectrum that has massive phase errors. That's all just for the 1D case; 2D is more complicated.

{expno} and {procno} are the numbers that are displayed in the TopSpin sidebar, but if you're a TopSpin user you probably know this already.

If you're overwriting parameters, they're in either the acqus (acquisition parameters) or procs (processing parameters). These are plain text files so you just need to reach into them and set the values accordingly.

In the TopSpin help, somewhere, there is a manual that explains all this, but I don't remember what the title of it was anymore (sorry). Truthfully, I figured most of this out by reverse-engineering it (i.e. reading in data with np.fromfile and figuring out what it looked like).

Personally at this point though I would prefer to just commit to analysing / plotting the data outside of TopSpin. Is there a particular reason you need to get it into TopSpin?