Sparky to NMRPipe example


This example is taken from Listing S1 in the 2013 JBNMR nmrglue paper. In this example a 2D Sparky file (data.ucsf) is converted to a NMRPipe file (data.ft2) by the Python script


Execute python to perform the conversion. The file data.ft2 will be created.

The data used in this example is available for download.

Listing S1


import nmrglue as ng

# read in the Sparky file
sdic, sdata ='data.ucsf')

# convert to NMRPipe format
C = ng.convert.converter()
C.from_sparky(sdic, sdata)
pdic, pdata = C.to_pipe()

# write results to NMRPipe file
ng.pipe.write('data.ft2', pdic, pdata)