コード例 #1
0
#! /usr/bin/env python
""" Create files for set unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.set(d, a, r=1.0, i=2.0)
pipe.write("set1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.set(d, a, c=3.0)
pipe.write("set2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.set(d, a, r=8.0, i=-2.0, c=10.0)
pipe.write("set3.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.set(d, a, r=1.0, i=2.0, x1=50, xn=700)
pipe.write("set4.glue", d, a, overwrite=True)
コード例 #2
0
ファイル: to_fix.py プロジェクト: scollis/nmrglue
#! /usr/bin/env python
""" Tests which show a differences between NMRPipe's and nmrglue's processing
functions and a fix is desired.  """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

# FSH
# the first three tests will fail because MIN/MAX values are off a little
d, a = pipe.read("1D_freq_real.dat")
d, a = p.fsh(d, a, dir="ls", pts=1)
pipe.write("fsh1.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.fsh(d, a, dir="rs", pts=8)
pipe.write("fsh2.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.fsh(d, a, dir="rs", pts=6.7)
pipe.write("fsh3.glue", d, a, overwrite=True)

# this fails because NMRPipe performs a Hilbert transform? If this is true it
# should be moved to the known_fail.py script.
d, a = pipe.read("1D_freq_complex.dat")
d, a = p.fsh(d, a, dir="ls", pts=9.5)
pipe.write("fsh4.glue", d, a, overwrite=True)

# RFT
# these are off by small amounts, mostly min/max values
d, a = pipe.read("1D_freq_complex.dat")
d, a = p.rft(d, a)
コード例 #3
0
ファイル: gm.py プロジェクト: thegooglecodearchive/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d,a = pipe.read("time_complex.fid")
d,a = p.gm(d,a,g1=5.0,g2=2.0,g3=0.0,c=1.0)
pipe.write("gm.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.gm(d,a,g1=2.0,g2=5.0,g3=0.5,c=1.5,start=100,size=654,one=True)
pipe.write("gm2.glue",d,a,overwrite=True)


d,a = pipe.read("time_complex.fid")
d,a = p.gm(d,a,g1=2.0,g2=5.0,g3=0.5,c=1.5,start=100)
pipe.write("gm3.glue",d,a,overwrite=True)
コード例 #4
0
ファイル: mir.py プロジェクト: winter27/nmrglue
#! /usr/bin/env python
""" tests for MIR function """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.mir(d, a, mode="left", sw=True)
pipe.write("mir1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.mir(d, a, mode="right", sw=True)
pipe.write("mir2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.mir(d, a, mode="right", invr=True, sw=True)
pipe.write("mir3.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.mir(d, a, mode="left", invr=True, sw=True)
pipe.write("mir4.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.mir(d, a, mode="center", sw=True)
pipe.write("mir5.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.mir(d, a, mode="ps90-180", sw=True)
pipe.write("mir6.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
コード例 #5
0
ファイル: ls.py プロジェクト: Tyf0n/nmrglue
#! /usr/bin/env python
""" Create files for ls unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.ls(d, a, ls=2.0, sw=True)
pipe.write("ls1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ls(d, a, ls=-3.0, sw=True)
pipe.write("ls2.glue", d, a, overwrite=True)

# freq domain
d, a = pipe.read("freq_real.ft2")
d, a = p.ls(d, a, ls=2.0, sw=True)
pipe.write("ls3.glue", d, a, overwrite=True)

d, a = pipe.read("freq_real.ft2")
d, a = p.ls(d, a, ls=17.0, sw=True)
pipe.write("ls4.glue", d, a, overwrite=True)

d, a = pipe.read("freq_real.ft2")
d, a = p.ls(d, a, ls=-5.0, sw=True)
pipe.write("ls5.glue", d, a, overwrite=True)
コード例 #6
0
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d,a = pipe.read("time_complex.fid")
d,a = p.cbf(d,a)
pipe.write("cbf1.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.cbf(d,a,last=30)
pipe.write("cbf2.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.cbf(d,a,reg=slice(1,100))
pipe.write("cbf3.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.cbf(d,a,slice=slice(9,20))
pipe.write("cbf4.glue",d,a,overwrite=True)
コード例 #7
0
#! /usr/bin/env python
""" Create files for integ unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.integ(d, a)
pipe.write("integ1.glue", d, a, overwrite=True)
コード例 #8
0
ファイル: to_fix.py プロジェクト: Tyf0n/nmrglue
#! /usr/bin/env python
""" Tests which show a differences between NMRPipe's and nmrglue's processing
functions and a fix is desired.  """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

# FSH
# the first three tests will fail because MIN/MAX values are off a little
d, a = pipe.read("1D_freq_real.dat")
d, a = p.fsh(d, a, dir="ls", pts=1)
pipe.write("fsh1.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.fsh(d, a, dir="rs", pts=8)
pipe.write("fsh2.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.fsh(d, a, dir="rs", pts=6.7)
pipe.write("fsh3.glue", d, a, overwrite=True)

# this fails because NMRPipe performs a Hilbert transform? If this is true it
# should be moved to the known_fail.py script.
d, a = pipe.read("1D_freq_complex.dat")
d, a = p.fsh(d, a, dir="ls", pts=9.5)
pipe.write("fsh4.glue", d, a, overwrite=True)

# RFT 
# these are off by small amounts, mostly min/max values
d, a = pipe.read("1D_freq_complex.dat")
d, a = p.rft(d, a)
コード例 #9
0
ファイル: ha.py プロジェクト: rpbarnes/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d,a = pipe.read("1D_time.fid")
d,a = p.ha(d,a)
pipe.write("ha1.glue",d,a,overwrite=True)

d,a = pipe.read("1D_time.fid")
d,a = p.ha(d,a,inv=True)
pipe.write("ha2.glue",d,a,overwrite=True)
コード例 #10
0
ファイル: zd.py プロジェクト: rpbarnes/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d,a = pipe.read("time_complex.fid")
d,a = p.zd(d,a,wide=1.0,x0=20,slope=2,func=0)
pipe.write("zd.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.zd(d,a,wide=5.0,x0=10,slope=5,func=1)
pipe.write("zd2.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.zd(d,a,wide=3.0,x0=100,slope=1,func=2)
pipe.write("zd3.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.zd(d,a,wide=8.0,x0=15,slope=3,func=3,g=20)
pipe.write("zd4.glue",d,a,overwrite=True)
コード例 #11
0
ファイル: sine.py プロジェクト: rpbarnes/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d,a = pipe.read("time_complex.fid")
d,a = p.sine(d,a,off=0.35,end=0.98,pow=2.0,c=1.0)
pipe.write("sine.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.sine(d,a,off=0.10,end=0.75,pow=1.0,c=0.5,size=200,one=True)
pipe.write("sine2.glue",d,a,overwrite=True)
コード例 #12
0
ファイル: qmix.py プロジェクト: rpbarnes/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d,a = pipe.read("time_complex.fid")
d,a = p.qmix(d,a,ic=4,oc=2,cList=[0.1,0.2,0.3,0.4,
                                  0.5,0.6,0.7,0.8],time=False)
pipe.write("qmix.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.qmix(d,a,ic=2,oc=4,cList=[1.0,0.5,
                                  0.7,0.8,
                                  0.2,0.6,
                                  0.1,0.9],time=True)
pipe.write("qmix2.glue",d,a,overwrite=True)
コード例 #13
0
ファイル: apod.py プロジェクト: rpbarnes/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

# Apod Tests
d,a = pipe.read("time_complex.fid")
d,a = p.apod(d,a,qName="SP",q1=0.35,q2=0.98,q3=2.0)
pipe.write("apod1.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.apod(d,a,qName="EM",q1=10.0)
pipe.write("apod2.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.apod(d,a,qName="GM",q1=2.35,q2=1.25,q3=1.2)
pipe.write("apod3.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.apod(d,a,qName="GMB",q1=1.25,q2=3.0)
pipe.write("apod4.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.apod(d,a,qName="TM",q1=100,q2=200)
pipe.write("apod5.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.apod(d,a,qName="TRI",q1=500,q2=0.50,q3=0.8)
pipe.write("apod6.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
コード例 #14
0
ファイル: add.py プロジェクト: Tyf0n/nmrglue
#! /usr/bin/env python
""" Create files for add unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.add(d, a, r=2.0, i=-1.0)
pipe.write("add1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.add(d, a, c=10.0)
pipe.write("add2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.add(d, a, c=10.0, x1=10, xn=400)
pipe.write("add3.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.add(d, a, ri=True, x1=50, xn=300)
pipe.write("add4.glue", d, a, overwrite=True)

コード例 #15
0
ファイル: sine.py プロジェクト: thegooglecodearchive/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.sine(d, a, off=0.35, end=0.98, pow=2.0, c=1.0)
pipe.write("sine.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.sine(d, a, off=0.10, end=0.75, pow=1.0, c=0.5, size=200, one=True)
pipe.write("sine2.glue", d, a, overwrite=True)
コード例 #16
0
ファイル: tri.py プロジェクト: thegooglecodearchive/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d,a = pipe.read("time_complex.fid")
d,a = p.tri(d,a,loc=500,lHi=0.5,rHi=0.8,inv=True)
pipe.write("tri.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.tri(d,a,loc=750,lHi=0.1,rHi=0.5)
pipe.write("tri2.glue",d,a,overwrite=True)



コード例 #17
0
ファイル: tp.py プロジェクト: winter27/nmrglue
#! /usr/bin/env python
""" Create files for tp unit test """

from subprocess import check_call
import os

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.tp(d, a, auto=True)
pipe.write("tp1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.tp(d, a, hyper=True)
pipe.write("tp2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.tp(d, a, nohyper=True)
pipe.write("tp3.glue", d, a, overwrite=True)

pipe_command = """\
/bin/csh -c 'nmrPipe -in ./time_complex.fid                \
| nmrPipe  -fn FT  -auto \
-ov -out time-freq.c.ft1'"""
check_call(pipe_command, shell=True)

d, a = pipe.read("time-freq.c.ft1")
d, a = p.tp(d, a, hyper=True)
pipe.write("tp4.glue", d, a, overwrite=True)
コード例 #18
0
ファイル: shuf.py プロジェクト: winter27/nmrglue
#! /usr/bin/env python
""" Create files for shuf unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.shuf(d, a, mode="ri2c")
pipe.write("shuf1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.shuf(d, a, mode="c2ri")
pipe.write("shuf2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.shuf(d, a, mode="ri2rr")
pipe.write("shuf3.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.shuf(d, a, mode="exlr")
pipe.write("shuf4.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.shuf(d, a, mode="rolr")
pipe.write("shuf5.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.shuf(d, a, mode="swap")
pipe.write("shuf6.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
コード例 #19
0
ファイル: mc.py プロジェクト: rpbarnes/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p


d,a = pipe.read("time_complex.fid")
d,a = p.mc(d,a,mode="pow")
pipe.write("mc.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.mc(d,a,mode="mod")
pipe.write("mc2.glue",d,a,overwrite=True)
コード例 #20
0
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("1D_freq_real.dat")
d, a = p.base(d, a, nl=[100, 200, 300])
pipe.write("base1.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_complex.dat")
d, a = p.base(d, a, nl=[100, 200])
pipe.write("base2.glue", d, a, overwrite=True)

d, a = pipe.read("freq_real.ft2")
d, a = p.base(d, a, nl=[100, 200])
pipe.write("base3.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.base(d, a, nl=[200, 300, 800])
pipe.write("base4.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.base(d, a, nl=[200, 300, 650], first=True)
pipe.write("base5.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.base(d, a, nl=[200, 560], last=True)
pipe.write("base6.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.base(d, a, nl=[150, 250], nw=3)
コード例 #21
0
ファイル: ft.py プロジェクト: thegooglecodearchive/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.ft(d, a)
pipe.write("ft1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ft(d, a, real=True)
pipe.write("ft2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ft(d, a, inv=True)
pipe.write("ft3.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ft(d, a, alt=True)
pipe.write("ft4.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ft(d, a, neg=True)
pipe.write("ft5.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ft(d, a, null=True)
pipe.write("ft6.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ft(d, a, bruk=True)
コード例 #22
0
ファイル: null.py プロジェクト: thegooglecodearchive/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.null(d, a)
pipe.write("null.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.null(d, a)
d, a = p.di(d, a)
pipe.write("null2.glue", d, a, overwrite=True)
コード例 #23
0
ファイル: tp.py プロジェクト: edward-dauvergne/nmrglue
#! /usr/bin/env python
""" Create files for tp unit test """

from subprocess import check_call
import os

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.tp(d, a, auto=True)
pipe.write("tp1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.tp(d, a, hyper=True)
pipe.write("tp2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.tp(d, a, nohyper=True)
pipe.write("tp3.glue", d, a, overwrite=True)


pipe_command = """\
/bin/csh -c 'nmrPipe -in ./time_complex.fid                \
| nmrPipe  -fn FT  -auto \
-ov -out time-freq.c.ft1'"""
check_call(pipe_command, shell=True)

d, a = pipe.read("time-freq.c.ft1")
d, a = p.tp(d, a, hyper=True)
pipe.write("tp4.glue", d, a, overwrite=True)
コード例 #24
0
ファイル: units.py プロジェクト: Tyf0n/nmrglue
#! /usr/bin/env python
""" Create files for unit_conversion unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

# points
d, a = pipe.read("1D_time.fid")
d, a = p.ext(d, a, x1=30, xn=340.6)
pipe.write("units1.glue", d, a, overwrite=True)

# percent
d, a = pipe.read("1D_time.fid")
xc = p.make_uc(d, a)
d, a = p.ext(d, a, x1=xc("11%"), xn=xc("60.2%"))
pipe.write("units2.glue", d, a, overwrite=True)

d, a = pipe.read("1D_time.fid")
xc = p.make_uc(d, a)
d, a = p.ext(d, a, x1=xc("20.5%"), xn=xc("78.9%"))
pipe.write("units3.glue", d, a, overwrite=True)

# Hz
d, a = pipe.read("1D_freq_real.dat")
xc = p.make_uc(d, a)
d, a = p.ext(d, a, x1=xc("24000 Hz"), xn=xc("12000 Hz"))
pipe.write("units4.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
xc = p.make_uc(d, a)
d, a = p.ext(d, a, x1=xc("15693.7 Hz"), xn=xc("-1634.1 Hz"))
コード例 #25
0
ファイル: rev.py プロジェクト: rpbarnes/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d,a = pipe.read("time_complex.fid")
d,a = p.rev(d,a,sw=True)
pipe.write("rev1.glue",d,a,overwrite=True)

d,a = pipe.read("freq_real.ft2")
d,a = p.rev(d,a,sw=True)
pipe.write("rev2.glue",d,a,overwrite=True)

d,a = pipe.read("freq_real.ft2")
d,a = p.rev(d,a,sw=False)
pipe.write("rev3.glue",d,a,overwrite=True)
コード例 #26
0
ファイル: to_fix.py プロジェクト: winter27/nmrglue
#! /usr/bin/env python
""" Tests which show a differences between NMRPipe's and nmrglue's processing
functions and a fix is desired.  """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

# FSH
# the first three tests will fail because MIN/MAX values are off a little
d, a = pipe.read("1D_freq_real.dat")
d, a = p.fsh(d, a, dir="ls", pts=1)
pipe.write("fsh1.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.fsh(d, a, dir="rs", pts=8)
pipe.write("fsh2.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.fsh(d, a, dir="rs", pts=6.7)
pipe.write("fsh3.glue", d, a, overwrite=True)

# this fails because NMRPipe performs a Hilbert transform? If this is true it
# should be moved to the known_fail.py script.
d, a = pipe.read("1D_freq_complex.dat")
d, a = p.fsh(d, a, dir="ls", pts=9.5)
pipe.write("fsh4.glue", d, a, overwrite=True)

# RFT
# these are off by small amounts, mostly min/max values
d, a = pipe.read("1D_freq_complex.dat")
d, a = p.rft(d, a)
コード例 #27
0
ファイル: rs.py プロジェクト: thegooglecodearchive/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.rs(d, a, rs=2.0, sw=True)
pipe.write("rs1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.rs(d, a, rs=-3.0, sw=True)
pipe.write("rs2.glue", d, a, overwrite=True)

d, a = pipe.read("freq_real.ft2")
d, a = p.rs(d, a, rs=2.0, sw=True)
pipe.write("rs3.glue", d, a, overwrite=True)

d, a = pipe.read("freq_real.ft2")
d, a = p.rs(d, a, rs=17.0, sw=True)
pipe.write("rs4.glue", d, a, overwrite=True)

d, a = pipe.read("freq_real.ft2")
d, a = p.rs(d, a, rs=-5.0, sw=True)
pipe.write("rs5.glue", d, a, overwrite=True)
コード例 #28
0
#! /usr/bin/env python
""" Create files for ht unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("1D_time_real.fid")
d, a = p.ht(d, a)
pipe.write("ht1.glue", d, a, overwrite=True)

d, a = pipe.read("1D_time_real.fid")
d, a = p.ht(d, a, td=True)
pipe.write("ht2.glue", d, a, overwrite=True)

d, a = pipe.read("1D_time_real.fid")
d, a = p.ht(d, a, mode="ps0-0")
pipe.write("ht3.glue", d, a, overwrite=True)

d, a = pipe.read("1D_time_real.fid")
d, a = p.ht(d, a, zf=True)
pipe.write("ht5.glue", d, a, overwrite=True)

d, a = pipe.read("1D_time_real.fid")
d, a = p.ht(d, a, auto=True)
pipe.write("ht6.glue", d, a, overwrite=True)

d, a = pipe.read("freq_real.ft2")
d, a = p.ht(d, a)
pipe.write("ht7.glue", d, a, overwrite=True)

d, a = pipe.read("freq_real.ft2")
コード例 #29
0
ファイル: xy2yx.py プロジェクト: rpbarnes/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d,a = pipe.read("time_complex.fid")
d,a = p.xy2yx(d,a,auto=True)
pipe.write("xy.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.xy2yx(d,a,hyper=True)
pipe.write("xy2.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.xy2yx(d,a,nohyper=True)
pipe.write("xy3.glue",d,a,overwrite=True)
コード例 #30
0
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("1D_time.fid")
d, a = p.ha(d, a)
pipe.write("ha1.glue", d, a, overwrite=True)

d, a = pipe.read("1D_time.fid")
d, a = p.ha(d, a, inv=True)
pipe.write("ha2.glue", d, a, overwrite=True)
コード例 #31
0
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.add(d, a, r=2.0, i=-1.0)
pipe.write("add1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.add(d, a, c=10.0)
pipe.write("add2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.add(d, a, c=10.0, x1=10, xn=400)
pipe.write("add3.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.add(d, a, ri=True, x1=50, xn=300)
pipe.write("add4.glue", d, a, overwrite=True)
コード例 #32
0
ファイル: rev.py プロジェクト: winter27/nmrglue
#! /usr/bin/env python
""" Create files for rev unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.rev(d, a, sw=True)
pipe.write("rev1.glue", d, a, overwrite=True)

d, a = pipe.read("freq_real.ft2")
d, a = p.rev(d, a, sw=True)
pipe.write("rev2.glue", d, a, overwrite=True)

d, a = pipe.read("freq_real.ft2")
d, a = p.rev(d, a, sw=False)
pipe.write("rev3.glue", d, a, overwrite=True)
コード例 #33
0
ファイル: gmb.py プロジェクト: rpbarnes/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d,a = pipe.read("time_complex.fid")
d,a = p.gmb(d,a,lb=2.0,gb=0.5,c=1.0,inv=True)
pipe.write("gmb.glue",d,a,overwrite=True)

d,a = pipe.read("time_complex.fid")
d,a = p.gmb(d,a,lb=10,gb=0.2,c=0.5,start=20,size=800)
pipe.write("gmb2.glue",d,a,overwrite=True)
コード例 #34
0
ファイル: save.py プロジェクト: Tyf0n/nmrglue
#! /usr/bin/env python
""" Create files for save unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.save(d, a, "save1.glue", overwrite=True)
pipe.write("save2.glue", d, a, overwrite=True)
コード例 #35
0
ファイル: cs.py プロジェクト: winter27/nmrglue
#! /usr/bin/env python
""" Create files for cbf unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.cs(d, a, dir="rs", pts=5.0, neg=True, sw=True)
pipe.write("cs1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.cs(d, a, dir="rs", pts=-2.0, sw=True)
pipe.write("cs2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.cs(d, a, dir="ls", pts=3.0, neg=True, sw=True)
pipe.write("cs3.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.cs(d, a, dir="ls", pts=-8.0, neg=True, sw=True)
pipe.write("cs4.glue", d, a, overwrite=True)

# freq domain
d, a = pipe.read("freq_real.ft2")
d, a = p.cs(d, a, dir="ls", pts=7.0, neg=True, sw=True)
pipe.write("cs5.glue", d, a, overwrite=True)

d, a = pipe.read("freq_real.ft2")
d, a = p.cs(d, a, dir="ls", pts=-3.0, sw=True)
pipe.write("cs6.glue", d, a, overwrite=True)
コード例 #36
0
ファイル: mc.py プロジェクト: winter27/nmrglue
#! /usr/bin/env python
""" tests for MC function """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.mc(d, a, mode="pow")
pipe.write("mc1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.mc(d, a, mode="mod")
pipe.write("mc2.glue", d, a, overwrite=True)
コード例 #37
0
ファイル: units.py プロジェクト: thegooglecodearchive/nmrglue
#! /usr/bin/env python

# Now using the unit_conversion object

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

import numpy as np

# points
d, a = pipe.read("1D_time.fid")
d, a = p.ext(d, a, x1=30, xn=340.6)
pipe.write("u1.glue", d, a, overwrite=True)

# percent
d, a = pipe.read("1D_time.fid")
xc = p.make_uc(d, a)
d, a = p.ext(d, a, x1=xc("11%"), xn=xc("60.2%"))
pipe.write("u2.glue", d, a, overwrite=True)

d, a = pipe.read("1D_time.fid")
xc = p.make_uc(d, a)
d, a = p.ext(d, a, x1=xc("20.5%"), xn=xc("78.9%"))
pipe.write("u3.glue", d, a, overwrite=True)

# Hz
d, a = pipe.read("1D_freq_real.dat")
xc = p.make_uc(d, a)
d, a = p.ext(d, a, x1=xc("24000 Hz"), xn=xc("12000 Hz"))
pipe.write("u4.glue", d, a, overwrite=True)
コード例 #38
0
ファイル: save.py プロジェクト: thegooglecodearchive/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.save(d, a, "save.glue", overwrite=True)
pipe.write("save2.glue", d, a, overwrite=True)
コード例 #39
0
ファイル: xy2yx.py プロジェクト: thegooglecodearchive/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.xy2yx(d, a, auto=True)
pipe.write("xy.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.xy2yx(d, a, hyper=True)
pipe.write("xy2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.xy2yx(d, a, nohyper=True)
pipe.write("xy3.glue", d, a, overwrite=True)
コード例 #40
0
ファイル: jmod.py プロジェクト: tommichael/nmrglue
#! /usr/bin/env python
""" Create files for jmod unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.jmod(d, a, cos=True, j=10.0, lb=5.0, c=1.0)
pipe.write("jmod1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.jmod(d,
              a,
              sin=True,
              j=18.0,
              lb=1.4,
              c=0.5,
              start=100,
              size=800,
              one=True)
pipe.write("jmod2.glue", d, a, overwrite=True)
コード例 #41
0
ファイル: sp.py プロジェクト: rpbarnes/nmrglue
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.sp(d, a, off=0.35, end=0.98, pow=2.0, c=1.0)
pipe.write("sp.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.sp(d, a, off=0.10, end=0.75, pow=1.0, c=0.5, size=200, one=True)
pipe.write("sp2.glue", d, a, overwrite=True)
コード例 #42
0
#! /usr/bin/env python

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.dx(d, a)
pipe.write("dx.glue", d, a, overwrite=True)
コード例 #43
0
ファイル: apod.py プロジェクト: winter27/nmrglue
#! /usr/bin/env python
""" Create files for apod unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

# Apod Tests
d, a = pipe.read("time_complex.fid")
d, a = p.apod(d, a, qName="SP", q1=0.35, q2=0.98, q3=2.0)
pipe.write("apod1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.apod(d, a, qName="EM", q1=10.0)
pipe.write("apod2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.apod(d, a, qName="GM", q1=2.35, q2=1.25, q3=1.2)
pipe.write("apod3.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.apod(d, a, qName="GMB", q1=1.25, q2=3.0)
pipe.write("apod4.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.apod(d, a, qName="TM", q1=100, q2=200)
pipe.write("apod5.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.apod(d, a, qName="TRI", q1=500, q2=0.50, q3=0.8)
pipe.write("apod6.glue", d, a, overwrite=True)
コード例 #44
0
ファイル: tm.py プロジェクト: winter27/nmrglue
#! /usr/bin/env python
""" Create files for tm unit test """

# ignore RuntimeWarnings created by division by zero when appling apodization
import warnings
warnings.simplefilter('ignore', RuntimeWarning)

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.tm(d, a, t1=100, t2=200, c=1.0, inv=True)
pipe.write("tm1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.tm(d, a, t1=10, t2=1400, c=1.5, start=5, size=1490)
pipe.write("tm2.glue", d, a, overwrite=True)
コード例 #45
0
ファイル: ext.py プロジェクト: scollis/nmrglue
#! /usr/bin/env python
""" Create files for ext unit test """

from subprocess import check_output

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.ext(d, a, left=True, sw=True)
pipe.write("ext1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ext(d, a, right=True)
pipe.write("ext2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ext(d, a, mid=True)
pipe.write("ext3.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ext(d, a, x1=1, xn=100)
pipe.write("ext4.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ext(d, a, xn=200, y1=50, yn=75)
pipe.write("ext5.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ext(d, a, x1=5, xn=200, pow2=True)
pipe.write("ext6.glue", d, a, overwrite=True)
コード例 #46
0
ファイル: ps.py プロジェクト: winter27/nmrglue
#! /usr/bin/env python
""" Create files for ps unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.ps(d, a, p0=11.1, p1=16.0, noup=True)
pipe.write("ps1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ps(d, a, p0=11.1, p1=16.0, noup=True)
pipe.write("ps2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.ps(d, a, p0=0.1, p1=0.5, tc=1.1, exp=True, noup=True)
pipe.write("ps3.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_complex.dat")
d, a = p.ps(d, a, p0=-27.0, p1=0.0)
pipe.write("ps4.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.ps(d, a, p0=-27.0, p1=0.0, ht=True)
pipe.write("ps5.glue", d, a, overwrite=True)

d, a = pipe.read("1D_freq_real.dat")
d, a = p.ps(d, a, p0=-27.0, p1=0.0, ht=True, zf=True)
pipe.write("ps6.glue", d, a, overwrite=True)
コード例 #47
0
ファイル: smo.py プロジェクト: winter27/nmrglue
#! /usr/bin/env python
""" Create files for smo unit test """

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

d, a = pipe.read("time_complex.fid")
d, a = p.smo(d, a)
pipe.write("smo1.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.smo(d, a, n=5)
pipe.write("smo2.glue", d, a, overwrite=True)

d, a = pipe.read("time_complex.fid")
d, a = p.smo(d, a, center=True)
pipe.write("smo3.glue", d, a, overwrite=True)
コード例 #48
0
ファイル: broken.py プロジェクト: rpbarnes/nmrglue
#! /usr/bin/env python

# A Collection of pipe_proc tests which do not match NMRPipe

import nmrglue.fileio.pipe as pipe
import nmrglue.process.pipe_proc as p

# FSH

# the first three tests will fail because MIN/MAX values are off a little
d,a = pipe.read("1D_freq_real.dat")
d,a = p.fsh(d,a,dir="ls",pts=1)
pipe.write("fsh1.glue",d,a,overwrite=True)

d,a = pipe.read("1D_freq_real.dat")
d,a = p.fsh(d,a,dir="rs",pts=8)
pipe.write("fsh2.glue",d,a,overwrite=True)

d,a = pipe.read("1D_freq_real.dat")
d,a = p.fsh(d,a,dir="rs",pts=6.7)
pipe.write("fsh3.glue",d,a,overwrite=True)

# this fails because NMRPipe performs a Hilbert transform?
d,a = pipe.read("1D_freq_complex.dat")
d,a = p.fsh(d,a,dir="ls",pts=9.5)
pipe.write("fsh4.glue",d,a,overwrite=True)

# RFT 
# these are off by small amounts, mostly min/max values
d,a = pipe.read("1D_freq_complex.dat")
d,a = p.rft(d,a)