Ejemplo n.º 1
0
    def get_photons(self, particle, device=None):
        """
        Get a simulated photon patterns stack
        :param particle: The paticle object
        :param device: 'cpu' or 'gpu'
        :return: A image stack of photons
        """
        if device:
            deprecation_message("Device option is deprecated. "
                                "Everything now runs on the GPU.")

        raw_data = self.get_pattern_without_corrections(particle=particle)
        return self.add_correction_and_quantization(raw_data)
Ejemplo n.º 2
0
    def get_adu(self, particle, path, device=None):
        """
        Get a simulated adu pattern stack

        :param particle: The particle object.
        :param path: The path to the crosstalk effect library.
        :param device: 'cpu' or 'gpu'
        :return: An image stack of adu.
        """
        if device:
            deprecation_message("Device option is deprecated. "
                                "Everything now runs on the GPU.")

        raw_photon = self.get_photons(particle=particle)
        return pc.add_cross_talk_effect_panel(db_path=path, photons=raw_photon)
Ejemplo n.º 3
0
    def get_intensity_field(self, particle, device=None):
        """
        Generate a single diffraction pattern without any correction from the particle object.

        :param particle: The particle object.
        :return: A diffraction pattern.
        """
        if device:
            deprecation_message("Device option is deprecated. "
                                "Everything now runs on the GPU.")

        diffraction_pattern = pgd.calculate_diffraction_pattern_gpu(
            self.pixel_position_reciprocal, particle, "intensity")

        return np.multiply(diffraction_pattern, self.linear_correction)
Ejemplo n.º 4
0
    def get_pattern_without_corrections(self,
                                        particle,
                                        device=None,
                                        return_type="intensity"):
        """
        Generate a single diffraction pattern without any correction from the particle object.

        :param particle: The particle object.
        :return: A diffraction pattern.
        """
        if device:
            deprecation_message("Device option is deprecated. "
                                "Everything now runs on the GPU.")

        diffraction_pattern = pgd.calculate_diffraction_pattern_gpu(
            self.pixel_position_reciprocal, particle, return_type)

        return diffraction_pattern