Пример #1
0
    def get_goniometer_shadow_masker(self, goniometer=None):
        if goniometer is None:
            goniometer = self.get_goniometer()

        assert goniometer is not None
        if goniometer.get_names()[1] == "GON_CHI":
            return GoniometerMaskerFactory.smargon(goniometer)

        elif goniometer.get_names()[1] == "GON_KAPPA":
            return GoniometerMaskerFactory.mini_kappa(goniometer)

        else:
            raise ValueError("Don't understand this goniometer: %s" %
                             list(goniometer.get_names()))
Пример #2
0
    def _construct_shadow_masker(goniometer):
        if request.param == "cpp":
            return GoniometerMaskerFactory.mini_kappa(goniometer)

        # Simple model of cone around goniometer phi axis
        # Exact values don't matter, only the ratio of height/radius
        height = 50  # mm
        radius = 20  # mm

        steps_per_degree = 1
        theta = (
            flex.double(range(360 * steps_per_degree))
            * math.pi
            / 180
            * 1
            / steps_per_degree
        )
        y = radius * flex.cos(-theta)
        z = radius * flex.sin(-theta)
        x = flex.double(theta.size(), height)

        coords = flex.vec3_double(zip(x, y, z))
        coords.insert(0, (0, 0, 0))

        return PyGoniometerShadowMasker(goniometer, coords, flex.size_t(len(coords), 0))
Пример #3
0
    def get_goniometer_shadow_masker(self, goniometer=None):
        if goniometer is None:
            goniometer = self.get_goniometer()

        return GoniometerMaskerFactory.diamond_anvil_cell(
            goniometer, cone_opening_angle=2 * 38 * math.pi / 180
        )
Пример #4
0
    def get_goniometer_shadow_masker(self, goniometer=None):
        if not self._dynamic_shadowing:
            return None

        if goniometer is None:
            goniometer = self.get_goniometer()

        assert goniometer is not None

        if goniometer.get_names()[1] == "chi":
            return GoniometerMaskerFactory.smargon(goniometer)
        elif goniometer.get_names()[1] == "kappa":
            return GoniometerMaskerFactory.mini_kappa(goniometer)

        else:
            raise RuntimeError("Don't understand this goniometer: %s" %
                               list(goniometer.get_names()))
Пример #5
0
    def get_goniometer_shadow_masker(self, goniometer=None):
        if goniometer is None:
            goniometer = self.get_goniometer()

        if not goniometer or not len(self.get_goniometer().get_names()) == 3:
            return None  # No dynamic shadowing available

        if goniometer.get_names()[1] == "GON_CHI":
            # SmarGon
            return GoniometerMaskerFactory.smargon(goniometer)

        else:
            raise RuntimeError("Don't understand this goniometer: %s" %
                               list(goniometer.get_names()))
Пример #6
0
 def _construct_shadow_masker(goniometer):
     return GoniometerMaskerFactory.diamond_anvil_cell(
         goniometer, cone_opening_angle=2 * 38 * math.pi / 180
     )
Пример #7
0
 def _construct_shadow_masker(goniometer):
     return GoniometerMaskerFactory.dls_i23_kappa(goniometer)
Пример #8
0
 def _construct_shadow_masker(goniometer):
     if request.param == "python":
         return PySmarGonShadowMasker(goniometer)
     return GoniometerMaskerFactory.smargon(goniometer)
 def get_goniometer_shadow_masker(self, goniometer=None):
     return GoniometerMaskerFactory.mini_kappa(goniometer)
Пример #10
0
 def get_goniometer_shadow_masker(self, goniometer=None):
     if goniometer is None:
         goniometer = self.get_goniometer()
     return GoniometerMaskerFactory.dls_i23_kappa(goniometer)