Beispiel #1
0
def test_experiment_consistent(dials_regression):
    # Create a sequence
    sequence_filenames = os.path.join(dials_regression, "centroid_test_data",
                                      "centroid*.cbf")
    sequence = ImageSetFactory.new(sorted(glob(sequence_filenames)))[0]

    # Create experiment with sequence and good scan
    e = Experiment(imageset=sequence, scan=sequence.get_scan())
    assert e.is_consistent()

    # Create experiment with sequence and defective scan
    scan = sequence.get_scan()
    scan.set_image_range((1, 1))
    e = Experiment(imageset=sequence, scan=scan)
def test_experiment_consistent(dials_data):
    # Create a sequence
    sequence_filenames = dials_data("centroid_test_data").listdir(
        "centroid*.cbf")
    sequence = ImageSetFactory.new(
        sorted(f.strpath for f in sequence_filenames))[0]

    # Create experiment with sequence and good scan
    e = Experiment(imageset=sequence, scan=sequence.get_scan())
    assert e.is_consistent()

    # Create experiment with sequence and defective scan
    scan = sequence.get_scan()
    scan.set_image_range((1, 1))
    e = Experiment(imageset=sequence, scan=scan)
def test_experiment_consistent(dials_regression):
  from dxtbx.imageset import ImageSetFactory
  from dxtbx.model import Scan

  # Create a sweep
  sweep_filenames = os.path.join(dials_regression, 'centroid_test_data', 'centroid*.cbf')
  sweep = ImageSetFactory.new(sorted(glob(sweep_filenames)))[0]

  # Create experiment with sweep and good scan
  e = Experiment(imageset=sweep, scan=sweep.get_scan())
  assert e.is_consistent()

  # Create experiment with sweep and defective scan
  scan = sweep.get_scan()
  scan.set_image_range((1, 1))
  e = Experiment(imageset=sweep, scan=scan)
Beispiel #4
0
    def tst_consistent(self):

        from dxtbx.imageset import ImageSetFactory
        from glob import glob
        from os.path import join
        from dxtbx.model import Scan

        # Create a sweep
        sweep_filenames = join(self.path, 'centroid_test_data',
                               'centroid*.cbf')
        sweep = ImageSetFactory.new(sorted(glob(sweep_filenames)))[0]

        # Create experiment with sweep and good scan
        e = Experiment(imageset=sweep, scan=sweep.get_scan())
        assert (e.is_consistent())

        # Create experiment with sweep and defective scan
        scan = sweep.get_scan()
        scan.set_image_range((1, 1))
        e = Experiment(imageset=sweep, scan=scan)
        #assert(not e.is_consistent()) # FIXME

        ## Create experiment with imageset and good scan
        #assert(e.is_consistent())

        ## Create experiment with imageset and non-still scan
        #assert(not e.is_consistent())

        ## Create experiment with imageset and scan with more than 1 image
        #assert(not e.is_consistent())

        ## Create experiment with imageset and defective scan
        #assert(not e.is_consistent())

        # Test passed
        print 'OK'