Beispiel #1
0
    def summarise(self):
        summary = ["Sweep: %s" % self._name]

        if self._template and self._directory:
            summary.append("Files %s" %
                           os.path.join(self._directory, self._template))

        if self._frames_to_process:
            summary.append("Images: %d to %d" % tuple(self._frames_to_process))
            off = self._imageset.get_scan().get_batch_offset()
            first = self._frames_to_process[0]
            start = self._frames_to_process[0] - first + off
            end = self._frames_to_process[1] - first + 1 + off
            self._imageset = self._imageset[start:end]

        indxr = self._get_indexer()
        if indxr:
            # print the comparative values
            from xia2.Schema.Interfaces.FrameProcessor import get_beam_centre

            imgset = self.get_input_imageset()
            hbeam = get_beam_centre(imgset.get_detector(), imgset.get_beam())
            ibeam = indxr.get_indexer_beam_centre()

            if (hbeam and ibeam and len(hbeam) == 2 and len(ibeam) == 2
                    and all(hbeam) and all(ibeam)):
                summary.append("Beam %.2f %.2f => %.2f %.2f" %
                               (hbeam[0], hbeam[1], ibeam[0], ibeam[1]))
            else:
                summary.append("Beam not on detector")

            hdist = imgset.get_detector()[0].get_directed_distance()
            idist = indxr.get_indexer_distance()

            if hdist and idist:
                summary.append(f"Distance {hdist:.2f} => {idist:.2f}")

            summary.append(
                "Date: %s" %
                time.asctime(time.gmtime(imgset.get_scan().get_epochs()[0])))

        return summary
Beispiel #2
0
  def summarise(self):

    summary = ['Sweep: %s' % self._name]

    if self._template and self._directory:
      summary.append('Files %s' % os.path.join(self._directory,
                                               self._template))

    if self._frames_to_process:
      summary.append('Images: %d to %d' % tuple(self._frames_to_process))


    if self._frames_to_process:
      first = self._frames_to_process[0]
      start = self._frames_to_process[0] - first
      end = self._frames_to_process[1] - first + 1
      self._imageset = self._imageset[start:end]

    if self._get_indexer():
      # print the comparative values

      indxr = self._get_indexer()

      from xia2.Schema.Interfaces.FrameProcessor import get_beam_centre
      imgset = self.get_input_imageset()
      hbeam = get_beam_centre(imgset.get_detector(), imgset.get_beam())
      ibeam = indxr.get_indexer_beam_centre()

      if hbeam and ibeam:
        summary.append('Beam %.2f %.2f => %.2f %.2f' % \
        (hbeam[0], hbeam[1], ibeam[0], ibeam[1]))

      hdist = imgset.get_detector()[0].get_distance()
      idist = indxr.get_indexer_distance()

      if hdist and idist:
        summary.append('Distance %.2f => %.2f' % (hdist, idist))

      summary.append('Date: %s' %time.asctime(
        time.gmtime(imgset.get_scan().get_epochs()[0])))

    return summary
Beispiel #3
0
    def summarise(self):

        summary = ['Sweep: %s' % self._name]

        if self._template and self._directory:
            summary.append('Files %s' %
                           os.path.join(self._directory, self._template))

        if self._frames_to_process:
            summary.append('Images: %d to %d' % tuple(self._frames_to_process))
            first = self._frames_to_process[0]
            start = self._frames_to_process[0] - first
            end = self._frames_to_process[1] - first + 1
            self._imageset = self._imageset[start:end]

        indxr = self._get_indexer()
        if indxr:
            # print the comparative values
            from xia2.Schema.Interfaces.FrameProcessor import get_beam_centre
            imgset = self.get_input_imageset()
            hbeam = get_beam_centre(imgset.get_detector(), imgset.get_beam())
            ibeam = indxr.get_indexer_beam_centre()

            if hbeam and ibeam and \
                len(hbeam) == 2 and len(ibeam) == 2 \
                and all(hbeam) and all(ibeam):
                summary.append('Beam %.2f %.2f => %.2f %.2f' % \
                (hbeam[0], hbeam[1], ibeam[0], ibeam[1]))
            else:
                summary.append('Beam not on detector')

            hdist = imgset.get_detector()[0].get_directed_distance()
            idist = indxr.get_indexer_distance()

            if hdist and idist:
                summary.append('Distance %.2f => %.2f' % (hdist, idist))

            summary.append(
                'Date: %s' %
                time.asctime(time.gmtime(imgset.get_scan().get_epochs()[0])))

        return summary
Beispiel #4
0
 def get_beam_centre(self):
     from xia2.Schema.Interfaces.FrameProcessor import get_beam_centre
     detector = self._imageset.get_detector()
     beam = self._imageset.get_beam()
     return get_beam_centre(detector, beam)
Beispiel #5
0
 def get_beam_centre(self):
   from xia2.Schema.Interfaces.FrameProcessor import get_beam_centre
   detector = self._imageset.get_detector()
   beam = self._imageset.get_beam()
   return get_beam_centre(detector, beam)