• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python pipe.read函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中nmrglue.fileio.pipe.read函数的典型用法代码示例。如果您正苦于以下问题:Python read函数的具体用法?Python read怎么用?Python read使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了read函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: fromPipe

def fromPipe(file):
    dic, data = pipe.read(file)
    if dic['FDTRANSPOSED'] == 1.:
        dic, data = pp.tp(dic, data, auto=True)

    u = pipe.guess_udic(dic, data)
    u["original_format"] = 'Pipe'
    u["Name"] = get_name(file)
    
    uc = [make_uc_pipe(dic, data, dim) for dim in range(0, data.ndim)]
    return NMRSpectrum(data, u, uc=uc)
开发者ID:ahmohamed,项目名称:nmrpro,代码行数:11,代码来源:readers.py


示例2:

#! /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)
开发者ID:Tyf0n,项目名称:nmrglue,代码行数:17,代码来源:smo.py


示例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)
开发者ID:edward-dauvergne,项目名称:nmrglue,代码行数:31,代码来源:tp.py


示例4:

#! /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")
开发者ID:Tyf0n,项目名称:nmrglue,代码行数:31,代码来源:mir.py


示例5:

#! /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)
开发者ID:Tyf0n,项目名称:nmrglue,代码行数:30,代码来源:cs.py


示例6:

#! /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)
开发者ID:rpbarnes,项目名称:nmrglue,代码行数:12,代码来源:ha.py


示例7: zip

    d = suite[key]
    # run the nmrPipe program
    os.system(d["sh"])
    # run the python program
    os.system(d["py"])
    print key,"...",
    
    if verb1:
        print ""

    # check each file for match
    for f1,f2 in zip(d["f"][::2],d["f"][1::2]):
        
        if verb1:
            print "checking",f1,f2
        dic1,data1 = pipe.read(f1)
        dic2,data2 = pipe.read(f2)
        r1,r2 = util.pair_similar(dic1,data1,dic2,data2,verb2)
        if verb1:
            if r1:
                print "Data: Pass",
            else:
                print "Data: Fail",

            if r2:
                print "Dictionary: Pass"
            else: 
                print "Dictionary: Fail"

        k_test = k_test and r1 and r2
        # remove the files
开发者ID:rpbarnes,项目名称:nmrglue,代码行数:31,代码来源:test_pipe_proc.py


示例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)
开发者ID:Tyf0n,项目名称:nmrglue,代码行数:31,代码来源:to_fix.py


示例9:

#! /usr/bin/env python

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

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

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

d,a = pipe.read("time_real.fid")
d,a = p.rft(d,a)
pipe.write("rft3.glue",d,a,overwrite=True)

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

d,a = pipe.read("1D_time_real.fid")
d,a = p.rft(d,a,inv=True)
pipe.write("rft5.glue",d,a,overwrite=True)

d,a = pipe.read("1D_time.fid")
d,a = p.rft(d,a,inv=True)
pipe.write("rft6.glue",d,a,overwrite=True)

d,a = pipe.read("time_real.fid")
开发者ID:rpbarnes,项目名称:nmrglue,代码行数:31,代码来源:rft.py


示例10: setUp

 def setUp(self):
     dic, data = pipe.read("./test_files/bmse000281_hsqc.fid")        
     self.dic = dic
     self.data = data
     self.filename = "./test_files/bmse000281_hsqc.fid"
开发者ID:ahmohamed,项目名称:nmrpro,代码行数:5,代码来源:test_apod.py


示例11:

#! /usr/bin/env python

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")
d,a = p.ht(d,a,zf=True,td=True)
开发者ID:rpbarnes,项目名称:nmrglue,代码行数:31,代码来源:ht.py


示例12:

#! /usr/bin/env python
""" Create files for mixed_processing unit test """

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

# process 2D mixed mode data
d, a = pipe.read("time_real.fid")
d, a = p.gmb(d, a, gb=0.1, lb=-8, c=0.5)
d, a = p.zf(d, a, auto=True)
d, a = p.ft(d, a, alt=True) # BUG glue seems to double the data...?
#d, a = p.ps(d, a, p0=0, p1=0)
#d, a = p.tp(d, a, hyper=True)
#d, a = p.sp(d, a, off=0.5, pow=2, c=0.5)
#d, a = p.zf(d, a, auto=True)
#d, a = p.ft(d, a, auto=True)
#d, a = p.ps(d, a, p0=0, p1=0)
#d, a = p.di(d, a)
pipe.write("2d_mixed_processing1.glue", d, a, overwrite=True)

# process 2D mixed mode data
d, a = pipe.read("time_real.fid")
d, a = p.em(d, a, lb=8)
d, a = p.zf(d, a, auto=True)
d, a = p.ft(d, a, auto=True)
d, a = p.di(d, a)
d, a = p.tp(d, a)
d, a = p.sp(d, a, off=0.5, pow=1, c=0.5)
d, a = p.zf(d, a, auto=True)
d, a = p.ft(d, a, auto=True)
d, a = p.mc(d, a)
开发者ID:tjragan,项目名称:nmrglue,代码行数:31,代码来源:2d_mixed_processing.py



注:本文中的nmrglue.fileio.pipe.read函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pipe.write函数代码示例发布时间:2022-05-27
下一篇:
Python nm_utils.TypeConvert类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap