Example #1
0
File: Sweep.py Project: hainm/xia2
  def update(self):
    '''Check to see if any more frames have appeared - if they
    have update myself and reset.'''

    images = find_matching_images(self._template,
                                  self._directory)

    if len(images) > len(self._images):

      self._images = images

      from xia2.Schema import load_imagesets
      imagesets = load_imagesets(
        self._template, self._directory, id_image=self._id_image,
        use_cache=False, reversephi=Flags.get_reversephi())

      max_images = 0
      best_sweep = None
      for imageset in imagesets:
        scan = imageset.get_scan()
        if scan is None: continue
        if imageset.get_scan().get_num_images() > max_images:
          best_sweep = imageset

      self._imageset = best_sweep

    return
Example #2
0
    def _setup_from_image(self, image):
        """Configure myself from an image name."""
        template, directory = image2template_directory(image)
        self._fp_matching_images = find_matching_images(template, directory)

        # trim this down to only allowed images...
        if self._fp_wedge:
            start, end = self._fp_wedge
            images = []
            for j in self._fp_matching_images:
                if j < start or j > end:
                    continue
                images.append(j)
            self._fp_matching_images = images

        from xia2.Schema import load_imagesets

        imagesets = load_imagesets(
            template,
            directory,
            image_range=(self._fp_matching_images[0],
                         self._fp_matching_images[-1]),
        )
        assert len(imagesets) == 1, "multiple imagesets match %s" % template
        imageset = imagesets[0]

        self._setup_from_imageset(imageset)
Example #3
0
    def update(self):
        '''Check to see if any more frames have appeared - if they
    have update myself and reset.'''

        from xia2.Applications.xia2setup import is_hd5f_name
        if is_hd5f_name(os.path.join(self._directory, self._template)):
            return

        images = find_matching_images(self._template, self._directory)

        if len(images) > len(self._images):

            self._images = images

            from xia2.Schema import load_imagesets
            imagesets = load_imagesets(
                self._template,
                self._directory,
                id_image=self._id_image,
                use_cache=False,
                reversephi=PhilIndex.params.xia2.settings.input.reverse_phi)

            max_images = 0
            best_sweep = None
            for imageset in imagesets:
                scan = imageset.get_scan()
                if scan is None: continue
                if imageset.get_scan().get_num_images() > max_images:
                    best_sweep = imageset

            self._imageset = best_sweep

        return
Example #4
0
File: Sweep.py Project: xia2/xia2
  def update(self):
    '''Check to see if any more frames have appeared - if they
    have update myself and reset.'''

    from xia2.Applications.xia2setup import is_hd5f_name
    if is_hd5f_name(os.path.join(self._directory, self._template)):
      return

    images = find_matching_images(self._template,
                                  self._directory)

    if len(images) > len(self._images):

      self._images = images

      from xia2.Schema import load_imagesets
      imagesets = load_imagesets(
        self._template, self._directory, id_image=self._id_image,
        use_cache=False,
        reversephi=PhilIndex.params.xia2.settings.input.reverse_phi)

      max_images = 0
      best_sweep = None
      for imageset in imagesets:
        scan = imageset.get_scan()
        if scan is None: continue
        if imageset.get_scan().get_num_images() > max_images:
          best_sweep = imageset

      self._imageset = best_sweep

    return
Example #5
0
  def _setup_from_image(self, image):
    '''Configure myself from an image name.'''
    template, directory = image2template_directory(image)
    self._fp_matching_images = find_matching_images(template, directory)

    # trim this down to only allowed images...
    if self._fp_wedge:
      start, end = self._fp_wedge
      images = []
      for j in self._fp_matching_images:
        if j < start or j > end:
          continue
        images.append(j)
      self._fp_matching_images = images

    from xia2.Schema import load_imagesets
    imagesets = load_imagesets(
      template, directory,
      image_range=(self._fp_matching_images[0], self._fp_matching_images[-1]))
    assert len(imagesets) == 1, 'multiple imagesets match %s' % template
    imageset = imagesets[0]

    self._setup_from_imageset(imageset)
    return
Example #6
0
        'thau_lores_1_###.mccd': 1000,
        '27032_1_E1_###.mccd': 0,
        '27032_1_E2_###.mccd': 100,
        '27032_2_###.mccd': 200
    }

    batches = {}

    from xia2.Experts.FindImages import find_matching_images, \
         template_directory_number2image, image2template_directory

    image_names = []
    for image in sys.argv[1:]:

        template, directory = image2template_directory(image)
        images = find_matching_images(template, directory)

        batch_images = []

        for i in images:
            image = template_directory_number2image(template, directory, i)
            image_names.append(image)
            batch_images.append(image)

        epochs = epocher(batch_images)
        for j in range(len(epochs)):
            batch = images[j] + offsets[template]
            batches[epochs[j][1]] = batch

    dose = accumulate(image_names)
    epochs = sorted(dose.keys())
Example #7
0
      }

  batches = { }

  from xia2.Experts.FindImages import find_matching_images, \
       template_directory_number2image, image2template_directory
  from xia2.Handlers.Flags import Flags

  # just cos we can...
  Flags.set_trust_timestamps(True)

  image_names = []
  for image in sys.argv[1:]:

    template, directory = image2template_directory(image)
    images = find_matching_images(template, directory)

    batch_images = []

    for i in images:
      image = template_directory_number2image(
          template, directory, i)
      image_names.append(image)
      batch_images.append(image)

    epochs = epocher(batch_images)
    for j in range(len(epochs)):
      batch = images[j] + offsets[template]
      batches[epochs[j][1]] = batch

  dose = accumulate(image_names)