コード例 #1
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)
コード例 #2
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)
コード例 #3
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"))