seidart.visualization.imgen module

Functions for plotting a 2D vector/quiver plot over the model image

class seidart.visualization.imgen.FDTDImage(prjfile, inputfile, is_complex: bool = False, is_single_precision: bool = True, plottype: str = 'magnitude')

Bases: object

A class to represent an FDTD image for visualization.

This class provides methods to build and manipulate images generated from FDTD modeling.

Parameters:
  • prjfile (str) – The full file path for the project file.

  • inputfile (str) – The name of the input file containing simulation data.

  • is_complex (bool) – Indicates if the data is complex valued.

  • is_single_precision (bool, optional) – Indicates if the data is in single precision format.

  • plottype (str, optional) – The type of plot to generate (‘magnitude’, ‘quiver’, ‘phase’, ‘energy_density’).

addlabels() None

Adds labels to the plot and updates the axis and figure objects.

addrcx()
addsource() None

Adds the source location to the plot.

build()

Builds the domain, material, seismic, and electromagnetic models from the project file.

getprjvals()

Retrieves project values and initializes domain parameters.

imvector() None

Generates a vector image from the project values and saves it.

magnitudeplot(alpha: float = 0.3, papercolumnwidth: float = 7.2) None

Plots the real data as a magnitude plot.

Parameters:
  • alpha (float, optional) – Transparency of the model plotted in the background.

  • papercolumnwidth (float, optional) – The width of the paper column for the plot.

quiverplot(papercolumnwidth: float = 7.2) None

Generates a quiver plot for seismic outputs.

Parameters:

papercolumnwidth (float, optional) – The width of the paper column for the plot.

sliceplot(dat: ndarray, axscale: tuple, sliceaxes: str, alpha: float = 0.3, papercolumnwidth: float = 7.2) None

Generates a slice plot from the given data.

Parameters:
  • dat (np.ndarray) – The data array to plot.

  • axscale (tuple) – The scale for the axes.

  • sliceaxes (str) – The axes to slice (‘xy’, ‘xz’, ‘yz’).

  • alpha (float, optional) – Transparency of the model plotted in the background.

  • papercolumnwidth (float, optional) – The width of the paper column for the plot.

vectoranim(files: list = []) None

Creates an animation of vector images from a list of files.

Parameters:

files (list, optional) – A list of file names to create the animation from.