本文整理汇总了Python中nmrglue.fileio.pipe.write函数的典型用法代码示例。如果您正苦于以下问题:Python write函数的具体用法?Python write怎么用?Python write使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了write函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
#! /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)
示例2:
#! /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")
示例3: check_call
#! /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)
示例4:
#! /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)
示例5:
#! /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)
示例6:
#! /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)
示例7:
#! /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)
示例8:
#! /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:
#! /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:
#! /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:
#! /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:
#! /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:
#! /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:
#! /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:
#! /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)