Esempio n. 1
0
    def __init__(self, image_number, *args):
        ScanVaryingBeamParameterisation.__init__(self, *args)

        # set overloads now, after construction of the base class
        self.compose = self._compose
        self.get_state = self._get_state

        self.set_time_point(image_number)
  def __init__(self, image_number, *args):

    ScanVaryingBeamParameterisation.__init__(self, *args)

    # set overloads now, after construction of the base class
    self.compose = self._compose
    self.get_state = self._get_state

    self.set_time_point(image_number)
Esempio n. 3
0
    def create_models(self, cmdline_overrides=None):
        from dxtbx.model import ScanFactory
        from libtbx.phil import parse

        from dials.test.algorithms.refinement.setup_geometry import Extract

        if cmdline_overrides is None:
            cmdline_overrides = []
        overrides = """geometry.parameters.crystal.a.length.range = 10 50
geometry.parameters.crystal.b.length.range = 10 50
geometry.parameters.crystal.c.length.range = 10 50"""

        master_phil = parse(
            """
    include scope dials.test.algorithms.refinement.geometry_phil
    """,
            process_includes=True,
        )

        # Extract models
        models = Extract(master_phil,
                         overrides,
                         cmdline_args=cmdline_overrides)
        self.detector = models.detector
        self.goniometer = models.goniometer
        self.crystal = models.crystal
        self.beam = models.beam

        # Make a scan of 1-20 * 0.5 deg images
        sf = ScanFactory()
        self.scan = sf.make_scan((1, 20), 0.5, (0, 0.5), list(range(20)))

        # Generate an ExperimentList
        self.experiments = ExperimentList()
        self.experiments.append(
            Experiment(
                beam=self.beam,
                detector=self.detector,
                goniometer=self.goniometer,
                scan=self.scan,
                crystal=self.crystal,
                imageset=None,
            ))

        # Create a reflection predictor for the experiments
        self.ref_predictor = ScansExperimentsPredictor(self.experiments)

        # Create scan-varying parameterisations of these models, with 3 samples
        self.det_param = ScanVaryingDetectorParameterisationSinglePanel(
            self.detector, self.scan.get_array_range(), 3)
        self.s0_param = ScanVaryingBeamParameterisation(
            self.beam, self.scan.get_array_range(), 3, self.goniometer)
        self.xlo_param = ScanVaryingCrystalOrientationParameterisation(
            self.crystal, self.scan.get_array_range(), 3)
        self.xluc_param = ScanVaryingCrystalUnitCellParameterisation(
            self.crystal, self.scan.get_array_range(), 3)
        self.gon_param = ScanVaryingGoniometerParameterisation(
            self.goniometer, self.scan.get_array_range(), 3, self.beam)
  def _get_state(self):
    """override for get_state to do so only at the requested t"""

    # ensure the state is updated by re-composing
    self.compose()
    return ScanVaryingBeamParameterisation.get_state(self)
  def _compose(self):
    """override for compose to pass in the requested t"""

    ScanVaryingBeamParameterisation.compose(self,
            self.image_number)
Esempio n. 6
0
    def _get_state(self):
        """override for get_state to do so only at the requested t"""

        # ensure the state is updated by re-composing
        self.compose()
        return ScanVaryingBeamParameterisation.get_state(self)
Esempio n. 7
0
    def _compose(self):
        """override for compose to pass in the requested t"""

        ScanVaryingBeamParameterisation.compose(self, self.image_number)