Пример #1
0
    def __init__(self, mesh, sources, **kwargs):
        """Constructor for the SourceSet class.

        Parameters
        ----------
        mesh : pysit.Mesh
            Physical (and numerical) domain on which the source is defined.
        sources : list of PointSource objects
        **kwargs : dict, optional
            May be used to specify `approximation` and `approximation_width` to
            base class.
        """

        self.source_list = sources
        # Populate parameters from the base class.
        SourceBase.__init__(self, **kwargs)
        MeshRepresentationBase.__init__(self, mesh, **kwargs)

        # Create the basis array
        if self._sample_interp_method == 'sparse':
            self.sampling_operator = spsp.vstack([s.sampling_operator for s in self.source_list])
            self.adjoint_sampling_operator = spsp.hstack([s.adjoint_sampling_operator for s in self.source_list])
        else: # dense
            self.sampling_operator = np.vstack([s.sampling_operator for s in self.source_list])
            self.adjoint_sampling_operator = np.hstack([s.adjoint_sampling_operator for s in self.source_list])
Пример #2
0
    def __init__(self, mesh, receivers, **kwargs):
        """Constructor for the PointSource class.

        Parameters
        ----------
        mesh : pysit.Mesh
            Computation domain on which the source is defined.
        position : tuple of float
            Coordinates of the point in the physical coordinates of the domain.
        **kwargs : dict, optional
            May be used to specify `approximation` and `approximation_width` to
            base class.
        """

        self.receiver_list = receivers
        # Populate parameters from the base class.
        ReceiverBase.__init__(self, **kwargs)
        MeshRepresentationBase.__init__(self, mesh, **kwargs)

        # time_window is an n-tuple, n[0] is the type, and any remaining entries are type dependent.
        self._time_window = ('Set',) # for special handling of ReceiverSets
#       # directwave_muting is an n-tuple, n[0] is the type, and any remaining entries are type dependent.
#       self._directwave_muting = ('Set',) # for special handling of ReceiverSets

        # Create the basis array
        if self._sample_interp_method == 'sparse':
            self.sampling_operator = spsp.vstack([r.sampling_operator for r in self.receiver_list])
            self.adjoint_sampling_operator = spsp.hstack([r.adjoint_sampling_operator for r in self.receiver_list])
        else: # dense
            self.sampling_operator = np.vstack([r.sampling_operator for r in self.receiver_list])
            self.adjoint_sampling_operator = np.hstack([r.adjoint_sampling_operator for r in self.receiver_list])

        self.data_dft = dict()
Пример #3
0
    def __init__(self, mesh, sources, **kwargs):
        """Constructor for the SourceSet class.

        Parameters
        ----------
        mesh : pysit.Mesh
            Physical (and numerical) domain on which the source is defined.
        sources : list of PointSource objects
        **kwargs : dict, optional
            May be used to specify `approximation` and `approximation_width` to
            base class.
        """

        self.source_list = sources
        # Populate parameters from the base class.
        SourceBase.__init__(self, **kwargs)
        MeshRepresentationBase.__init__(self, mesh, **kwargs)

        # Create the basis array
        if self._sample_interp_method == 'sparse':
            self.sampling_operator = spsp.vstack(
                [s.sampling_operator for s in self.source_list])
            self.adjoint_sampling_operator = spsp.hstack(
                [s.adjoint_sampling_operator for s in self.source_list])
        else:  # dense
            self.sampling_operator = np.vstack(
                [s.sampling_operator for s in self.source_list])
            self.adjoint_sampling_operator = np.hstack(
                [s.adjoint_sampling_operator for s in self.source_list])
Пример #4
0
    def __init__(self, mesh, receivers, **kwargs):
        """Constructor for the PointSource class.

        Parameters
        ----------
        mesh : pysit.Mesh
            Computation domain on which the source is defined.
        position : tuple of float
            Coordinates of the point in the physical coordinates of the domain.
        **kwargs : dict, optional
            May be used to specify `approximation` and `approximation_width` to
            base class.
        """

        self.receiver_list = receivers
        # Populate parameters from the base class.
        ReceiverBase.__init__(self, **kwargs)
        MeshRepresentationBase.__init__(self, mesh, **kwargs)

        # time_window is an n-tuple, n[0] is the type, and any remaining entries are type dependent.
        self._time_window = ('Set', )  # for special handling of ReceiverSets
        #       # directwave_muting is an n-tuple, n[0] is the type, and any remaining entries are type dependent.
        #       self._directwave_muting = ('Set',) # for special handling of ReceiverSets

        # Create the basis array
        if self._sample_interp_method == 'sparse':
            self.sampling_operator = spsp.vstack(
                [r.sampling_operator for r in self.receiver_list])
            self.adjoint_sampling_operator = spsp.hstack(
                [r.adjoint_sampling_operator for r in self.receiver_list])
        else:  # dense
            self.sampling_operator = np.vstack(
                [r.sampling_operator for r in self.receiver_list])
            self.adjoint_sampling_operator = np.hstack(
                [r.adjoint_sampling_operator for r in self.receiver_list])

        self.data_dft = dict()