Seperated interleaved example


This example is taken from Listing S5 in the 2013 JBNMR nmrglue paper. In this example a pseudo-3D NMRPipe data set is seperated into 2D data sets using the script


Execute python to seperate the pseudo-3D data set into 2D data sets. Six directories with names techo_XXXX.fid will be created.

The data used in this example is available for download. [78.42 MB]

Listing S5


import nmrglue as ng

# read in the NMR data
dic, data ='arrayed_data.fid')

# set the new size of the separated data
dic['nblocks'] = data.shape[0]

# loop over the echo times, separating and saving each 2D
for i, techo in enumerate(dic['procpar']['techo']['values']):
    dir_name = 'techo_' + techo + '.fid'
    print "Creating directory:", dir_name
    ng.varian.write(dir_name, dic, data[:, i, :], overwrite=True)