Esempio n. 1
0
    def with_random_intensity(self, N, Imax, Bamax, Bbmax, Bcmax, Bdmax):
        """ Generate reflections with a random intensity and background. """
        from dials.array_family import flex

        if Imax == 0:
            I = flex.size_t(N).as_int()
        else:
            I = flex.random_size_t(N, Imax).as_int()
        if Bamax == 0:
            Ba = flex.size_t(N).as_int()
        else:
            Ba = flex.random_size_t(N, Bamax).as_int()
        if Bbmax == 0:
            Bb = flex.size_t(N).as_int()
        else:
            Bb = flex.random_size_t(N, Bbmax).as_int()
        if Bcmax == 0:
            Bc = flex.size_t(N).as_int()
        else:
            Bc = flex.random_size_t(N, Bcmax).as_int()
        if Bdmax == 0:
            Bd = flex.size_t(N).as_int()
        else:
            Bd = flex.random_size_t(N, Bdmax).as_int()
        return self.with_individual_given_intensity(N, I, Ba, Bb, Bc, Bd)
Esempio n. 2
0
    def with_random_intensity(self, N, Imax, Bamax, Bbmax, Bcmax, Bdmax):
        """ Generate reflections with a random intensity and background. """
        from dials.array_family import flex

        if Imax == 0:
            I = flex.size_t(N).as_int()
        else:
            I = flex.random_size_t(N, Imax).as_int()
        if Bamax == 0:
            Ba = flex.size_t(N).as_int()
        else:
            Ba = flex.random_size_t(N, Bamax).as_int()
        if Bbmax == 0:
            Bb = flex.size_t(N).as_int()
        else:
            Bb = flex.random_size_t(N, Bbmax).as_int()
        if Bcmax == 0:
            Bc = flex.size_t(N).as_int()
        else:
            Bc = flex.random_size_t(N, Bcmax).as_int()
        if Bdmax == 0:
            Bd = flex.size_t(N).as_int()
        else:
            Bd = flex.random_size_t(N, Bdmax).as_int()
        return self.with_individual_given_intensity(N, I, Ba, Bb, Bc, Bd)