本文整理汇总了Python中utilstest.UtilsTest.getimage方法的典型用法代码示例。如果您正苦于以下问题:Python UtilsTest.getimage方法的具体用法?Python UtilsTest.getimage怎么用?Python UtilsTest.getimage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utilstest.UtilsTest
的用法示例。
在下文中一共展示了UtilsTest.getimage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
"""Download files"""
self.fit2dFile = UtilsTest.getimage(self.__class__.fit2dFile)
self.halfFrelon = UtilsTest.getimage(self.__class__.halfFrelon)
self.splineFile = UtilsTest.getimage(self.__class__.splineFile)
poniFile = UtilsTest.getimage(self.__class__.poniFile)
with open(poniFile) as f:
data = []
for line in f:
if line.startswith("SplineFile:"):
data.append("SplineFile: " + self.splineFile)
else:
data.append(line.strip())
self.poniFile = os.path.join(self.tmp_dir, os.path.basename(poniFile))
with open(self.poniFile, "w") as f:
f.write(os.linesep.join(data))
self.fit2d = numpy.loadtxt(self.fit2dFile)
self.ai = AzimuthalIntegrator()
self.ai.load(self.poniFile)
self.data = fabio.open(self.halfFrelon).data
if not os.path.isdir(self.tmp_dir):
os.makedirs(self.tmp_dir)
for tmpfile in self.tmpfiles.values():
if os.path.isfile(tmpfile):
os.unlink(tmpfile)
示例2: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
"""Download files"""
self.dataFile = UtilsTest.getimage(self.__class__.dataFile)
self.poniFile = UtilsTest.getimage(self.__class__.poniFile)
self.ai = pyFAI.load(self.poniFile)
self.data = fabio.open(self.dataFile).data
self.mask = self.data < 0
示例3: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
"""Download files"""
self.fit2dFile = UtilsTest.getimage(self.__class__.fit2d_cor)
self.halfFrelon = UtilsTest.getimage(self.__class__.halfFrelon)
self.splineFile = UtilsTest.getimage(self.__class__.splineFile)
self.det = detectors.FReLoN(self.splineFile)
self.dis = _distortion.Distortion(self.det)
self.fit2d = fabio.open(self.fit2dFile).data
self.raw = fabio.open(self.halfFrelon).data
示例4: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
"""Download files"""
self.fit2dFile = UtilsTest.getimage(self.__class__.fit2dFile)
self.pilatusFile = UtilsTest.getimage(self.__class__.pilatusFile)
self.tth_fit2d, self.I_fit2d = numpy.loadtxt(self.fit2dFile, unpack=True)
self.ai = pyFAI.AzimuthalIntegrator(dist=1.994993e-01,
poni1=2.143248e-01,
poni2=2.133315e-01,
rot1=0.007823,
rot2=0.006716,
rot3=0,
pixel1=172e-6,
pixel2=172e-6)
self.data = fabio.open(self.pilatusFile).data
self.data[self.data < 0] = 0 #discard negative pixels
示例5: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
self.fn = {}
for i in ["b191_1_9_1.img", "b191_1_9_1_uncompressed.img"]:
self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
for i in self.fn:
assert os.path.exists(self.fn[i])
self.tempdir = tempfile.mkdtemp()
示例6: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
"""Download files"""
self.fn = {}
for i in ["i01f0001.kcd", "i01f0001.edf"]:
self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
for i in self.fn:
assert os.path.exists(self.fn[i])
示例7: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
"""
download images
"""
self.im_dir = os.path.dirname(UtilsTest.getimage("Cr8F8140k103.0026.bz2"))
self.tempdir = tempfile.mkdtemp()
示例8: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
self.fn = {}
for i in ["corkcont2_H_0089.mccd", "somedata_0001.mccd"]:
self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
self.fn[i + ".bz2"] = self.fn[i] + ".bz2"
self.fn[i + ".gz"] = self.fn[i] + ".gz"
for i in self.fn:
assert os.path.exists(self.fn[i])
示例9: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
"""Download files"""
self.fn = {}
for j in self.results.split("\n"):
i = j.split()[0]
self.fn[i] = UtilsTest.getimage(i + ".bz2")[:-4]
for i in self.fn:
assert os.path.exists(self.fn[i])
示例10: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
"""Download files"""
self.img = UtilsTest.getimage(self.__class__.calibFile)
self.pp = PeakPicker(self.img, dSpacing=self.ds, wavelength=self.wavelength)
dirname = os.path.dirname(os.path.abspath(__file__))
self.tmpdir = os.path.join(dirname, "tmp")
if not os.path.isdir(self.tmpdir):
os.mkdir(self.tmpdir)
示例11: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
self.multiFrameFilename = UtilsTest.getimage("MultiFrame.edf.bz2")[:-4]
self.Frame0Filename = UtilsTest.getimage("MultiFrame-Frame0.edf.bz2")[:-4]
self.Frame1Filename = UtilsTest.getimage("MultiFrame-Frame1.edf.bz2")[:-4]
self.ref = edfimage()
self.frame0 = edfimage()
self.frame1 = edfimage()
try:
self.ref.read(self.multiFrameFilename)
except:
raise RuntimeError("Cannot read image multiFrameFilename image %s" % self.multiFrameFilename)
try:
self.frame0.read(self.Frame0Filename)
except:
raise RuntimeError("Cannot read image Frame0File image %s" % self.Frame0File)
try:
self.frame1.read(self.Frame1Filename)
except:
raise RuntimeError("Cannot read image Frame1File image %s" % self.Frame1File)
示例12: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
"""Download files"""
self.img = UtilsTest.getimage(self.__class__.calibFile)
self.pp = PeakPicker(self.img, dSpacing=self.ds, wavelength=self.wavelength)
if not os.path.isdir(self.tmp_dir):
os.makedirs(self.tmp_dir)
if os.path.isfile(self.logfile):
os.unlink(self.logfile)
if os.path.isfile(self.nptfile):
os.unlink(self.nptfile)
示例13: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
"""
Download files
Create a mask for tth<3.7 deg
"""
self.dataFile = UtilsTest.getimage(self.__class__.dataFile)
detector = pyFAI.detectors.Detector(pixel1=0.0001, pixel2=0.0001)
self.ai = pyFAI.AzimuthalIntegrator(dist=0.1, poni1=0.03, poni2=0.03, detector=detector)
self.data = fabio.open(self.dataFile).data
self.tth, self.I = self.ai.integrate1d(self.data, 1000, unit="2th_deg")
self.mask = self.ai.ttha < numpy.deg2rad(3.7)
示例14: setUp
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def setUp(self):
"""Download files"""
self.fit2dFile = UtilsTest.getimage(self.__class__.fit2dFile)
self.halfFrelon = UtilsTest.getimage(self.__class__.halfFrelon)
self.splineFile = UtilsTest.getimage(self.__class__.splineFile)
self.poniFile = UtilsTest.getimage(self.__class__.poniFile)
with open(self.poniFile) as f:
data = []
for line in f:
if line.startswith("SplineFile:"):
data.append("SplineFile: " + self.splineFile)
else:
data.append(line.strip())
with open(self.poniFile, "w") as f:
f.write(os.linesep.join(data))
self.fit2d = numpy.loadtxt(self.fit2dFile)
self.ai = AzimuthalIntegrator()
self.ai.load(self.poniFile)
self.data = fabio.open(self.halfFrelon).data
if not os.path.isdir("tmp"):
os.mkdir("tmp")
示例15: test_read
# 需要导入模块: from utilstest import UtilsTest [as 别名]
# 或者: from utilstest.UtilsTest import getimage [as 别名]
def test_read(self):
"""
Test the reading of Mar345 images
"""
for line in TESTIMAGES.split('\n'):
vals = line.strip().split()
name = vals[0]
dim1, dim2 = [int(x) for x in vals[1:3]]
mini, maxi, mean, stddev = [float(x) for x in vals[3:]]
obj = mar345image()
obj.read(UtilsTest.getimage(name))
self.assertAlmostEqual(mini, obj.getmin(), 2, "getmin [%s,%s]" % (mini, obj.getmin()))
self.assertAlmostEqual(maxi, obj.getmax(), 2, "getmax [%s,%s]" % (maxi, obj.getmax()))
self.assertAlmostEqual(mean, obj.getmean(), 2, "getmean [%s,%s]" % (mean, obj.getmean()))
self.assertAlmostEqual(stddev, obj.getstddev(), 2, "getstddev [%s,%s]" % (stddev, obj.getstddev()))
self.assertEqual(dim1, obj.dim1, "dim1")
self.assertEqual(dim2, obj.dim2, "dim2")