Exemplo n.º 1
0
def test_getters():
    from dials.algorithms.profile_model.modeller import SingleSampler

    scan_range = (2, 12)
    depth = scan_range[1] - scan_range[0]
    nz = 2
    sampler = SingleSampler(scan_range, nz)
    scan_range = sampler.scan_range()
    grid_size = sampler.grid_size()
    step_size = sampler.step_size()
    size = len(sampler)

    assert scan_range[0] == scan_range[0]
    assert scan_range[1] == scan_range[1]
    assert nz == grid_size
    assert step_size == depth / nz
    assert nz == size
Exemplo n.º 2
0
  def tst_getters(self):
    from dials.algorithms.profile_model.modeller import SingleSampler
    width = 1000
    height = 1000
    scan_range = (2, 12)
    depth = scan_range[1] - scan_range[0]
    nz = 2
    sampler = SingleSampler(scan_range, nz)
    scan_range = sampler.scan_range()
    grid_size = sampler.grid_size()
    step_size = sampler.step_size()
    size = len(sampler)

    assert(scan_range[0] == scan_range[0])
    assert(scan_range[1] == scan_range[1])
    assert(nz == grid_size)
    assert(step_size == depth / nz)
    assert(nz == size)
    print 'OK'
Exemplo n.º 3
0
    def tst_getters(self):
        from dials.algorithms.profile_model.modeller import SingleSampler
        width = 1000
        height = 1000
        scan_range = (2, 12)
        depth = scan_range[1] - scan_range[0]
        nz = 2
        sampler = SingleSampler(scan_range, nz)
        scan_range = sampler.scan_range()
        grid_size = sampler.grid_size()
        step_size = sampler.step_size()
        size = len(sampler)

        assert (scan_range[0] == scan_range[0])
        assert (scan_range[1] == scan_range[1])
        assert (nz == grid_size)
        assert (step_size == depth / nz)
        assert (nz == size)
        print 'OK'
Exemplo n.º 4
0
def test_indexing():
    from dials.algorithms.profile_model.modeller import SingleSampler

    width = 1000
    height = 1000
    scan_range = (2, 12)
    nz = 2
    sampler = SingleSampler(scan_range, nz)
    zstep = sampler.step_size()
    zind = list(range(nz))

    xp = [width * 0.5 for k in range(nz)]
    yp = [height * 0.5 for k in range(nz)]
    zp = [(z + 0.5) * zstep + scan_range[0] for z in zind]

    eps = 1e-10

    for x0, y0, z0, i in zip(xp, yp, zp, range(len(sampler))):
        x1, y1, z1 = sampler.coord(i)
        assert abs(z0 - z1) <= eps
Exemplo n.º 5
0
  def tst_indexing(self):
    from dials.algorithms.profile_model.modeller import SingleSampler
    width = 1000
    height = 1000
    scan_range = (2, 12)
    depth = scan_range[1] - scan_range[0]
    nz = 2
    sampler = SingleSampler(scan_range, nz)
    zstep = sampler.step_size()
    zind = [k for k in range(nz)]

    xp = [width *0.5 for k in range(nz)]
    yp = [height *0.5 for k in range(nz)]
    zp = [(z + 0.5) * zstep + scan_range[0] for z in zind]

    eps = 1e-10

    for x0, y0, z0, i in zip(xp, yp, zp, range(len(sampler))):
      x1, y1, z1 = sampler.coord(i)
      assert(abs(z0 - z1) <= eps)

    print 'OK'