nmrglue.bruker

Functions for reading and writing Bruker binary (ser/fid) files, Bruker JCAMP-DX parameter (acqus) files, and Bruker pulse program (pulseprogram) files.

This modules is imported as nmrglue.bruker and can be called as such.

User Information

User Functions

These are functions which are targetted for users of nmrglue.

read([dir, bin_file, acqus_files, ...]) Read Bruker files from a directory.
write(dir, dic, data[, bin_file, ...]) Write Bruker files to disk.
read_pdata([dir, bin_files, procs_files, ...]) Read processed Bruker files from a directory.
remove_digital_filter(dic, data[, truncate, ...]) Remove the digital filter from Bruker data.
read_lowmem([dir, bin_file, acqus_files, ...]) Read Bruker files from a directory using minimal amounts of memory.
write_lowmem(dir, dic, data[, bin_file, ...]) Write Bruker files using minimal amounts of memory (trace by trace).
read_binary(filename[, shape, cplex, big]) Read Bruker binary data from file and return dic,data pair.
write_binary(filename, dic, data[, ...]) Write Bruker binary data to file.
read_pdata_binary(filename[, shape, ...]) Read a processed Bruker binary file and return dic, data pair.
scale_pdata(dic, data) Scale Bruker processed data using parameters from the procs file.
read_binary_lowmem(filename[, shape, cplex, big]) Read Bruker binary data from file using minimal memory.
write_binary_lowmem(filename, dic, data[, ...]) Write Bruker binary data to file using minimal memory (trace by trace).
read_jcamp(filename) Read a Bruker JCAMP-DX file into a dictionary.
write_jcamp(dic, filename[, overwrite]) Write a Bruker JCAMP-DX file from a dictionary.
read_pprog(filename) Read a Bruker pulse program (pulseprogram) file.
write_pprog(filename, dic[, overwrite]) Write a minimal Bruker pulse program to file.
guess_udic(dic, data[, strip_fake]) Guess parameters of universal dictionary from dic, data pair.
create_dic(udic) Create a Bruker parameter dictionary from a universal dictionary.

Developer Infomation

from __future__ import print_function, division

__developer_info__ = “”” Bruker file format information ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Bruker binary files (ser/fid) store data as an array of int32s whose endiness is determinded by the parameter BYTORDA (1 = big endian, 0 = little endian). Typically the direct dimension is digitally filtered. The exact method of removing this filter is unknown but an approximation is avaliable.

Bruker JCAMP-DX files (acqus, etc) are text file which are described by the JCAMP-DX standard. Bruker parameters are prefixed with a ‘$’.

Bruker pulseprogram files are text files described in various Bruker manuals. Of special important are lines which describe external variable assignments (surrounded by “‘s), loops (begin with lo), phases (contain ip of dp) or

Developer Functions

These functions are typically not used directly by users. Developers who want fine control over Bruker files may be interested in these functions.

create_data(data) Create a bruker data array (recast into a complex128 or int32)
add_axis_to_udic(udic, dic, udim, strip_fake) Add axis parameters to a udic.
create_acqus_dic(adic[, direct]) Create a Bruker acqus dictionary from an Universal axis dictionary.
guess_shape(dic) Determine data shape and complexity from Bruker dictionary.
guess_shape_and_submatrix_shape(dic) Guess the data shape and the shape of the processed data submatrix.
get_data(f, big) Get binary data from file object with given endiness.
put_data(f, data[, big]) Put data to file object with given endiness.
complexify_data(data) Complexify data packed real, imag.
uncomplexify_data(data_in) Uncomplexify data (pack real,imag) into a int32 array.
reorder_submatrix(data, shape, submatrix_shape) Reorder processed binary Bruker data.
rm_dig_filter(data, decim, dspfvs[, grpdly, ...]) Remove the digital filter from Bruker data.
parse_jcamp_line(line, f) Parse a single JCAMP-DX line.
parse_jcamp_value(text) Parse value text from Bruker JCAMP-DX file returning the value.
write_jcamp_pair(f, key, value) Write out a line of a JCAMP file.
read_acqus_file([dir, acqus_files]) Read Bruker acquisition files from a directory.
read_procs_file([dir, procs_files]) Read Bruker processing files from a directory.

Developer Classes

bruker_nd(filename, fshape, cplex, big[, order]) Emulate a ndarray objects without loading data into memory for low memory reading of Bruker fid/ser files.