parameters of universal dictionary in Bruker spectra

Skip to first unread message


May 21, 2014, 4:43:22 PM5/21/14
Hi guys,

I was wondering if there is an easy way in order to create a unit conversion object for Bruker dataset as  for NMRPipe data by using the nmrglue.fileio.pipe.make_uc(dic, data, dim=-1) builtin function.

The nmrglue.fileio.bruker.guess_udic seems not working properly here since it returbs a dictionary of spectral parameters with no sense:

#! /usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import nmrglue as ng
import sys

# read in the data from a Bruker dataset from the command line
dic, data =[1])

# remove the digital filter
data = ng.bruker.remove_digital_filter(dic, data)

# process the direct dimension
data = ng.proc_base.sp(data, off=0.35, end=0.98, pow=2)
data = ng.proc_base.zf(data)
data = ng.proc_base.fft(data)
data =, p0=-50, p1=-8)
data = ng.proc_base.di(data)

# process the indirect dimension
data =
data = ng.proc_base.sp(data, off=0.35, end=0.9, pow=2)
data = ng.proc_base.zf(data)
data = ng.proc_base.fft(data)
data =, p0=-77, p1=-21.4)
data = ng.proc_base.di(data)
data =
uc_f1 = ng.fileio.bruker.guess_udic(dic, data)

then, when I inspect uc_f1 dictionary, I get the following:


{0: {'car': 999.99,
     'complex': True,
     'encoding': 'states',
     'freq': False,
     'label': 'X',
     'obs': 999.99,
     'size': 256,
     'sw': 999.99,
     'time': True},
 1: {'car': 999.99,
     'complex': True,
     'encoding': 'direct',
     'freq': False,
     'label': 'Y',
     'obs': 999.99,
     'size': 443,
     'sw': 999.99,
     'time': True},
 'ndim': 2}

Any help here?

Thanks a lot,

Jonathan Helmus

May 23, 2014, 7:12:25 PM5/23/14

    The guess_udic functions guess a universal dictionary from the data present, for some NMR data formats not all the information can be determined from the data presented.  In the case of Bruker data only the size parameter is set, the other values are set to default values that should be changed by the user.  This limited information in the universal dictionaries created from Bruker data is a result of 1) Me only having had a limited need to work with Bruker data (most the spectrometer I worked on were Varian/Agilent) and 2) The necessary metadata (carrier frequency, offset, spectral width) seems to be stored in the various acqus files in non-regular positions.  From my experience even NMRPipe's bruker command does not reliability determine these parameters, rather users must choose them from a list of possible choices. 

    There are two nmrglue forks [1], [2] and a open issue [3] which try to determine more of these spectral parameters from the metadata parsed from the acqus files but neither branch seems to get all the parameters correct.  If anyone would like to work on improving this I would welcome a pull request. For the time being universal dictionaries created using nmrglue.bruker.guess_udic must be corrected by hand.


    - Jonathan Helmus

You received this message because you are subscribed to the Google Groups "nmrglue-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Reply all
Reply to author
0 new messages