예제 #1
0
파일: modeller.py 프로젝트: dials/dials
  def compute(self):
    '''
    Integrate the data

    '''
    from dials.algorithms.integration.image_integrator import ProcessorImage
    from dials.util.command_line import heading

    # Init the report
    self.profile_model_report = None
    self.integration_report = None

    # Create summary format
    fmt = (
      ' Processing the following experiments:\n'
      '\n'
      ' Experiments: %d\n'
      ' Beams:       %d\n'
      ' Detectors:   %d\n'
      ' Goniometers: %d\n'
      ' Scans:       %d\n'
      ' Crystals:    %d\n'
      ' Imagesets:   %d\n'
    )

    # Print the summary
    logger.info(fmt % (
      len(self.experiments),
      len(self.experiments.beams()),
      len(self.experiments.detectors()),
      len(self.experiments.goniometers()),
      len(self.experiments.scans()),
      len(self.experiments.crystals()),
      len(self.experiments.imagesets())))

    # Print a heading
    logger.info("=" * 80)
    logger.info("")
    logger.info(heading("Modelling background"))
    logger.info("")

    # Compute some reflection properties
    self.reflections.compute_zeta_multi(self.experiments)
    self.reflections.compute_d(self.experiments)
    self.reflections.compute_bbox(self.experiments)

    # Construvt the image integrator processor
    processor = ProcessorImage(
      self.experiments,
      self.reflections,
      self.params)
    processor.executor = BackgroundModellerExecutor(
      self.experiments,
      self.params)

    # Do the processing
    _, time_info = processor.process()

    # Compute the model
    self.model = processor.executor.finalize_model()

    # Print the time info
    logger.info(str(time_info))
    logger.info("")

    # Return the reflections
    return self.model
예제 #2
0
    def compute(self):
        """
        Integrate the data
        """
        from dials.algorithms.integration.image_integrator import ProcessorImage
        from dials.util.command_line import heading

        # Init the report
        self.profile_model_report = None
        self.integration_report = None

        # Create summary format
        fmt = (" Processing the following experiments:\n"
               "\n"
               " Experiments: %d\n"
               " Beams:       %d\n"
               " Detectors:   %d\n"
               " Goniometers: %d\n"
               " Scans:       %d\n"
               " Crystals:    %d\n"
               " Imagesets:   %d\n")

        # Print the summary
        logger.info(fmt % (
            len(self.experiments),
            len(self.experiments.beams()),
            len(self.experiments.detectors()),
            len(self.experiments.goniometers()),
            len(self.experiments.scans()),
            len(self.experiments.crystals()),
            len(self.experiments.imagesets()),
        ))

        # Print a heading
        logger.info("=" * 80)
        logger.info("")
        logger.info(heading("Modelling background"))
        logger.info("")

        # Expand n_sigma
        for expt in self.experiments:
            expt.profile._n_sigma += 2

        # Compute some reflection properties
        self.reflections.compute_zeta_multi(self.experiments)
        self.reflections.compute_d(self.experiments)
        self.reflections.compute_bbox(self.experiments)

        # Construvt the image integrator processor
        processor = ProcessorImage(self.experiments, self.reflections,
                                   self.params)
        processor.executor = BackgroundModellerExecutor(
            self.experiments, self.params)

        # Do the processing
        _, time_info = processor.process()

        # Compute the model
        self.model = processor.executor.finalize_model()

        # Print the time info
        logger.info(str(time_info))
        logger.info("")

        # Return the reflections
        return self.model