Пример #1
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))
Пример #2
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()))
Пример #3
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()))
 def get_goniometer_shadow_masker(self, goniometer=None):
     return GoniometerMaskerFactory.mini_kappa(goniometer)