convert example: pipe2sparky_2d

This example shows how to use nmrglue to convert a 2D NMRPipe file into a Sparky formatted file.

The data used in this example is available for download.

[source code]

#! /usr/bin/env python

import nmrglue as ng

# read in the NMRPipe data
dic,data = ng.pipe.read("nmrpipe_2d/test.ft2")

# Set the spectral parameters 
udic = ng.pipe.guess_udic(dic, data)

# create the converter object and initilize with NMRPipe data
C = ng.convert.converter()
C.from_pipe(dic, data, udic)

# create Sparky data and then write it out
ng.sparky.write("sparky_2d.ucsf", *C.to_sparky(), overwrite=True)