Showing posts with label mathematica. Show all posts
Showing posts with label mathematica. Show all posts

23 August 2013

498. Briefly: Drawing NMR pulse sequences using APSEQ and Mathematica

There are two things that have been bothering me on linux -- one is the difficulty of creating annotated PDF documents, but it seems like things are slowly improving (we still don't have a really good way of creating /editable/ annotations). Another is the issue of creating NMR pulse-sequence drawings. To be fair, it doesn't seem like the situation is much better on Windows or OSX.

Anyway, I still don't have a good way of doing this, but at least I have A way of getting it done: APSEQ. The main drawback is that it requires Mathematica, which I don't like much (I get by with octave and maxima) in addition to being proprietary. But it will do for now.

NOTE: I just needed to 'Get It Done' quickly, so I didn't spend any time looking at the following potential alternatives: (metapost -- which should be tex compatible, right) (python code) (the URL is fairly descriptive)
They all seem to depend on latex in some way or another.

There's also but I haven't actually found the sources.

Anyway, here's how to get started with APSEQ:

mkdir ~/tmp/apseq -p
cd ~/tmp/apseq
tar xvf apsDistribution.tar.gz
cd zip.feb15/
Mathematica 7.0 for Linux x86 (64-bit) Copyright 1988-2009 Wolfram Research, Inc. In[1]:= << part01 loaded part02 loaded part03 loaded part04 loaded mscp loaded nmr.extra loaded loaded In[2]:= draw[pulseSeq[hahn, echo]={channels[1H],pulse[90],delay[t1],pulse[180],delay[t1],delay[t2],acquire[taq]}] Out[2]= hahn_echo.pdf In[3]:=

which gives you something like this:
Spin echo sequence
The figure is output as a pdf, but it's easy enough to open it in inkscape and converting it to an .eps file.