Exemple #1
0
  def tst_getters(self):
    from math import sqrt
    from dials.algorithms.profile_model.modeller import CircleSampler
    width = 1000
    height = 1000
    scan_range = (2, 12)
    depth = scan_range[1] - scan_range[0]
    nz = 2
    sampler = CircleSampler((width, height), scan_range, nz)
    image_size = sampler.image_size()
    scan_range = sampler.scan_range()
    image_centre = sampler.image_centre()
    r0 = sampler.r0()
    r1 = sampler.r1()
    r2 = sampler.r2()
    size = len(sampler)

    assert(width == image_size[0])
    assert(height == image_size[1])
    assert(width // 2 == image_centre[0])
    assert(height // 2 == image_centre[1])
    assert(r0 == min([width // 2, height // 2]))
    assert(r1 == r0 / 3.0)
    assert(r2 == r1 * sqrt(5.0))
    assert(9 * nz == size)
    print 'OK'
    def tst_getters(self):
        from math import sqrt
        from dials.algorithms.profile_model.modeller import CircleSampler
        width = 1000
        height = 1000
        scan_range = (2, 12)
        depth = scan_range[1] - scan_range[0]
        nz = 2
        sampler = CircleSampler((width, height), scan_range, nz)
        image_size = sampler.image_size()
        scan_range = sampler.scan_range()
        image_centre = sampler.image_centre()
        r0 = sampler.r0()
        r1 = sampler.r1()
        r2 = sampler.r2()
        size = len(sampler)

        assert (width == image_size[0])
        assert (height == image_size[1])
        assert (width // 2 == image_centre[0])
        assert (height // 2 == image_centre[1])
        assert (r0 == min([width // 2, height // 2]))
        assert (r1 == r0 / 3.0)
        assert (r2 == r1 * sqrt(5.0))
        assert (9 * nz == size)
        print 'OK'