up

Python Plotting and Analysis Files

The files listed on this page are for analyzing data acquired with the SpinCore Technologies iSpin NMR spectrometer.   These files are written in the python programming language.  Inexpensive or free versions of this software can be downloaded from Enthought, Inc. at https://www.enthought.com/products/epd/.  A zip file containing all the files on this page can be downloaded by clicking HERE.

In the analysis files lested below, it is assumed that the data to be analyzed have been saved as a SpinCore ".txt" file. 

Tycho Sleator
New York University
Department of Physics
4 Washington Place
New York, NY 10003
tycho.sleator@nyu.edu

analyze_plot_ispin_echo_sweep_data.py

This file reads in a sequence of spincore ".txt" files generated by the program "hahn_echo_sweep", and extracts the size of the echo from each of those files and plots the result. The echo size is determined by integrating the absolute value of the signal over a region of the echo. The program outputs an array can that can be pasted into a fitting program for further analysis.

Last update: 11/05/2013

ispin_nmr_cpmg_analysis.py

Program to plot and analyze CPMG data, in which just a few points (n) are taken from the top of each echo. The data are generated in the Spincore LabView interface from the specification of the number of points per echo, n. At the beginning of the FID, and in the middle of each echo, n points are collected at the rate given by the parameter 'SW' in the LabVeiw interface, (or 'bw' in this program). The n points from each echo are averaged, and the average is plotted as a function of the time of the given echo. The data are fit to a decaying exponential, from which the value of T2 can be extracted.

Last update: 9/22/2013

ispin_nmr_T1_analysis.py

This program determines T1 from a set of spincore ".txt" files, generated by running the spincore batch file called 'T1_IR_sweep.bat'. Each ".txt" file contains the data from an "inversion recovery" sequence, where a pi pulse inverts the signal, and after a variable delay "tau", a pi/2 pulse is applied and the resulting free-induction decay (FID) is recorded. The data in the files differ only in the value of tau. Fitting the size of the FID as a function of tau to an exponential decay allows one to extract the spin-lattice relaxation time T1.

More specifically, this program:
Last update: 2/21/2012

manipulate_plot_ispin_nmr_data.py

This routine reads in a spincore ".txt" file, and plots the data as well as the fft of the data in that file.

Last update: 10/7/2012

NMR_diffusion_fit.py

This program reads in a sequence of spincore ".txt" files generated by the iSpin NMR spectrometer as a result of running the batch file "hahn_echo_sweep.bat". The program extracts the "amplitude" of the echo in each file by integrating the absolute value over the width of the echo. The range of integration is given by the parameter sequence, extracts the `echo amplitude' from each file, generates and prints an array from these numbers and plots the result, and fits a theoretical curve modeling the effects of diffusion to the data. The effects of T2, the "spin-spin" relaxation time is also taken into account. User needs to set some parameters before running this program. These parameters are: rootname: taumin: Minimum value of tau Delta_tau: Increment in tau from one file to the next Ntaus: Number of different values of tau They can be obtained from the file `Hahn_echo_sweep.bat'. The parameters can be set by editing the values between the two signs that say: "User sets values of parameters".

Last update: 11/05/2013

plot_ispin_data_sequence.py

This routine reads in and plots a sequence of spincore '.txt' files. The plots are saved to disk with filename 'xxx.pdf', where 'xxx.txt' is the file name containing the data. Derived from the program plot_ispin_forloop, written by Greg Lemberskiy.

Last update: 1/30/2012

plot_ispin_nmr_data_FFT.py

This routine reads in a spincore ".txt" file, and plots the time data in that file as well as the frequency data (FFT). Since the interesting part of the data is at low frequencies, the frequency range of the plot is reduced by a scale factor 'sf'.

Last update: 10/07/2012

plot_ispin_nmr_data.py

This routine reads in a spincore ".txt" file, and plots the data in that file

Last update: 11/5/2013