Exemplo n.º 1
0
def test_cbf(dials_regression, cbf_image):
    filename = os.path.join(dials_regression, cbf_image)

    image = CBFReader(filename).image().as_int()
    assert image.n_tiles() == 1

    data1 = image.tile(0).data()
    data2 = read_cbf_image(filename)
    diff = flex.abs(data1 - data2)
    assert flex.max(diff) < 1e-7
Exemplo n.º 2
0
def test_multitile_cbf(dials_regression, cbf_image):
    filename = os.path.join(dials_regression, cbf_image)

    image = CBFReader(filename).image().as_int()
    data1 = tuple(image.tile(i).data() for i in range(image.n_tiles()))
    data2 = read_multitile_cbf_image(filename)

    assert len(data1) == len(data2)
    for d1, d2 in zip(data1, data2):
        diff = flex.abs(d1 - d2)
        assert flex.max(diff) < 1e-7
Exemplo n.º 3
0
def tst_cbf(filename):
    from dxtbx.datablock import DataBlockFactory
    from scitbx.array_family import flex
    from dxtbx.format.image import CBFReader

    image = CBFReader(filename).image()
    data1 = tuple(image.tile(i).as_int() for i in range(image.n_tiles()))

    try:
        data2 = read_multitile_cbf_image(filename)
    except Exception, e:
        data2 = (read_cbf_image(filename), )
Exemplo n.º 4
0
def tst_cbf(filename):
    from scitbx.array_family import flex
    from dxtbx.format.image import CBFReader

    image = CBFReader(filename).image()
    data1 = tuple(image.tile(i).as_int() for i in range(image.n_tiles()))

    try:
        data2 = read_multitile_cbf_image(filename)
    except Exception:
        data2 = (read_cbf_image(filename), )

    assert len(data1) == len(data2)

    for d1, d2 in zip(data1, data2):
        diff = flex.abs(d1 - d2)
        assert flex.max(diff) < 1e-7

    print 'OK'
Exemplo n.º 5
0
def test_cbf(dials_regression, cbf_image):
    from scitbx.array_family import flex
    from dxtbx.format.image import CBFReader
    filename = os.path.join(dials_regression, cbf_image)

    image = CBFReader(filename).image()
    if image.is_double():
        image = image.as_double()
    else:
        image = image.as_int()

    data1 = tuple(image.tile(i).data() for i in range(image.n_tiles()))

    try:
        data2 = read_multitile_cbf_image(filename)
    except Exception:
        data2 = (read_cbf_image(filename), )

    assert len(data1) == len(data2)

    for d1, d2 in zip(data1, data2):
        diff = flex.abs(d1 - d2)
        assert flex.max(diff) < 1e-7