Esempio n. 1
0
def test_detector():
    """A test class for the detector class."""

    d = detector_factory.simple("CCD", 100.0, (45.0, 52.0), "+x", "-y", (0.172, 0.172), (516, 590), (0, 1024), [])
    t = detector_factory.two_theta(
        "CCD", 60.0, (35.0, 34.0), "+x", "+y", "+x", 30, (0.07, 0.07), (1042, 1042), (0, 1024), []
    )

    import libtbx.load_env
    import os

    dxtbx_dir = libtbx.env.dist_path("dxtbx")

    image = os.path.join(dxtbx_dir, "tests", "phi_scan_001.cbf")
    xparm = os.path.join(dxtbx_dir, "tests", "example-xparm.xds")

    c = detector_factory.imgCIF(image, "CCD")
    # x = detector_factory.XDS(xparm)

    print "OK"
Esempio n. 2
0
def test_detector():
    '''A test class for the detector class.'''

    d = detector_factory.simple('CCD', 100.0, (45.0, 52.0), '+x', '-y',
                                (0.172, 0.172), (516, 590), (0, 1024), [])
    t = detector_factory.two_theta('CCD', 60.0, (35.0, 34.0), '+x', '+y', '+x',
                                   30, (0.07, 0.07), (1042, 1042), (0, 1024),
                                   [])

    import libtbx.load_env
    import os

    dxtbx_dir = libtbx.env.dist_path('dxtbx')

    image = os.path.join(dxtbx_dir, 'tests', 'phi_scan_001.cbf')
    xparm = os.path.join(dxtbx_dir, 'tests', 'example-xparm.xds')

    c = detector_factory.imgCIF(image, 'CCD')
    #x = detector_factory.XDS(xparm)

    print 'OK'
Esempio n. 3
0
             r['score'] / r['degrees'])

if __name__ == '__main__':
  script = Script()
  script.run()
  sys.exit(0)

  from dxtbx.model.detector import detector_factory
  sensor = 'PAD'
  distance = 85
  beam_centre = (0, 0)
  pixel_size = (0.172, 0.172)
  image_size = (487, 619)

  two_theta_angle = 30
  d = detector_factory.two_theta(sensor, distance, beam_centre, '+x', '-y', '-x', two_theta_angle, pixel_size, image_size, trusted_range = (0.0, 0.0), mask = [], px_mm = None)
  print d

  two_theta_angle = 10
  d = detector_factory.two_theta(sensor, distance, beam_centre, '+x', '-y', '-x', two_theta_angle, pixel_size, image_size, trusted_range = (0.0, 0.0), mask = [], px_mm = None)
  print d

  for p in d:
    print p
    print dir(p)

    from scitbx import matrix
    # Obtain and normalize axes
    fast_axis = matrix.col(p.get_fast_axis()).normalize()
    slow_axis = matrix.col(p.get_slow_axis()).normalize()
    normal = fast_axis.cross(slow_axis)
Esempio n. 4
0
    from dxtbx.model.detector import detector_factory

    sensor = "PAD"
    distance = 85
    beam_centre = (0, 0)
    pixel_size = (0.172, 0.172)
    image_size = (487, 619)

    two_theta_angle = 30
    d = detector_factory.two_theta(
        sensor,
        distance,
        beam_centre,
        "+x",
        "-y",
        "-x",
        two_theta_angle,
        pixel_size,
        image_size,
        trusted_range=(0.0, 0.0),
        mask=[],
        px_mm=None,
    )
    print(d)

    two_theta_angle = 10
    d = detector_factory.two_theta(
        sensor,
        distance,
        beam_centre,
        "+x",
        "-y",