seidart.routines.sourcefunction module

seidart.routines.sourcefunction.main(prjfile: str, source_type: str, factor: float, multimodal: bool, make_plot: bool) None

Main function to generate and optionally plot a source function based on input parameters.

Parameters:
  • prjfile (str) – Path to the project file.

  • source_type (str) – Type of the source function to generate.

  • factor (float) – Amplitude scaling factor for the source.

  • multimodal (bool) – Indicates if a multimodal source should be generated. Defaults to False.

  • make_plot (bool) – Whether to plot the generated source function. Defaults to False.

seidart.routines.sourcefunction.multimodesrc(timevec: ndarray, f: float, stype: str) ndarray

Creates a multi-mode source by linearly combining wavelets at different frequencies.

Parameters:
  • timevec (np.ndarray) – The time vector for the source.

  • f (float) – The center frequency around which the modes are generated.

  • stype (str) – The type of wavelet to use for each mode.

Returns:

The combined multi-mode source.

Return type:

np.ndarray

seidart.routines.sourcefunction.plotsource(t: ndarray, x: ndarray) Tuple[Figure, ndarray]

Plots the source function and its power spectrum.

Parameters:
  • t (np.ndarray) – The time vector corresponding to the source function.

  • x (np.ndarray) – The source function.

Returns:

A tuple containing the matplotlib figure and axes array.

Return type:

Tuple[plt.Figure, np.ndarray]

seidart.routines.sourcefunction.sourcefunction(modelclass: Model, factor: float, source_type: str, multimodal: bool = False) Tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

Generates a source function based on the provided model class and parameters.

Parameters:
  • modelclass (Model) – The model class containing time steps, frequency, and orientation.

  • factor (float) – Amplitude scaling factor for the source.

  • source_type (str) – The type of source to generate.

  • multimodal (bool) – Whether to generate a multimodal source. Defaults to False.

Returns:

A tuple containing the time vector and the x, y, z components of the force, along with the source function.

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]

seidart.routines.sourcefunction.wavelet(timevec: ndarray, f: float, stype: str) ndarray

Generates a wavelet based on the specified type and parameters.

Parameters:
  • timevec (np.ndarray) – The time vector for the wavelet.

  • f (float) – The center frequency of the wavelet.

  • stype (str) – The type of wavelet to generate. Options include ‘gaus0’, ‘gaus1’, ‘gaus2’, ‘chirp’, and ‘chirplet’.

Returns:

The generated wavelet.

Return type:

np.ndarray

seidart.routines.sourcefunction.writesrc(fn: str, srcarray: ndarray) None

Writes a source array to a Fortran-formatted binary file.

Parameters:
  • fn (str) – The filename for the output file.

  • srcarray (np.ndarray) – The source array to write.