示例#1
0
文件: model.py 项目: kmdalton/dials
    def predict_reflections(
        self,
        imageset,
        crystal,
        beam,
        detector,
        goniometer=None,
        scan=None,
        dmin=None,
        dmax=None,
        margin=1,
        force_static=False,
        padding=0,
        **kwargs,
    ):
        """
        Given an experiment, predict the reflections.

        :param crystal: The crystal model
        :param beam: The beam model
        :param detector: The detector model
        :param goniometer: The goniometer model
        :param scan: The scan model
        """
        from dxtbx.model.experiment_list import Experiment

        from dials.algorithms.spot_prediction.reflection_predictor import (
            ReflectionPredictor,
        )

        predict = ReflectionPredictor(
            Experiment(
                imageset=imageset,
                crystal=crystal,
                beam=beam,
                detector=detector,
                goniometer=goniometer,
                scan=scan,
            ),
            dmin=dmin,
            dmax=dmax,
            margin=margin,
            force_static=force_static,
            padding=padding,
        )
        return predict()
示例#2
0
    def from_predictions(
        experiment, dmin=None, dmax=None, margin=1, force_static=False, padding=0
    ):
        """
        Construct a reflection table from predictions.

        :param experiment: The experiment to predict from
        :param dmin: The maximum resolution
        :param dmax: The minimum resolution
        :param margin: The margin to predict around
        :param force_static: Do static prediction with a scan varying model
        :param padding: Padding in degrees
        :return: The reflection table of predictions
        """
        if experiment.profile is not None:
            return experiment.profile.predict_reflections(
                experiment.imageset,
                experiment.crystal,
                experiment.beam,
                experiment.detector,
                experiment.goniometer,
                experiment.scan,
                dmin=dmin,
                dmax=dmax,
                margin=margin,
                force_static=force_static,
                padding=padding,
            )
        from dials.algorithms.spot_prediction.reflection_predictor import (
            ReflectionPredictor,
        )

        predict = ReflectionPredictor(
            experiment,
            dmin=dmin,
            dmax=dmax,
            margin=margin,
            force_static=force_static,
            padding=padding,
        )
        return predict()