当前位置: 首页>>代码示例>>Python>>正文


Python UtilsTest.getimage方法代码示例

本文整理汇总了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)
开发者ID:tonnrueter,项目名称:pyFAI,代码行数:27,代码来源:testAzimuthalIntegrator.py

示例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
开发者ID:blackw1ng,项目名称:pyFAI,代码行数:9,代码来源:testMask.py

示例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
开发者ID:GiannisA,项目名称:pyFAI,代码行数:11,代码来源:testDistortion.py

示例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
开发者ID:mik854e,项目名称:pyFAI,代码行数:17,代码来源:testGeometry.py

示例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()
开发者ID:ddale,项目名称:fabio,代码行数:9,代码来源:testOXDimage.py

示例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])
开发者ID:ddale,项目名称:fabio,代码行数:9,代码来源:testkcdimage.py

示例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()
开发者ID:GiannisA,项目名称:fabio,代码行数:9,代码来源:testbrukerimage.py

示例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])
开发者ID:GiannisA,项目名称:fabio,代码行数:10,代码来源:testmccdimage.py

示例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])
开发者ID:ddale,项目名称:fabio,代码行数:10,代码来源:testpnmimage.py

示例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)
开发者ID:sameera2004,项目名称:pyFAI,代码行数:10,代码来源:testPeakPicking.py

示例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)
开发者ID:GiannisA,项目名称:fabio,代码行数:21,代码来源:testedfimage.py

示例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)
开发者ID:tonnrueter,项目名称:pyFAI,代码行数:12,代码来源:testPeakPicking.py

示例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)
开发者ID:GiannisA,项目名称:pyFAI,代码行数:13,代码来源:test_mask.py

示例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")
开发者ID:barberie,项目名称:pyFAI,代码行数:23,代码来源:testAzimuthalIntegrator.py

示例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")
开发者ID:coquellen,项目名称:fabio,代码行数:20,代码来源:testmar345image.py


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