API#
All functions are available in the top-level namespace. But are defined in submodules modules to keep the directory structure clean.
- trace(traces: Union[List[Trace], Trace], *args, ax: matplotlib.axes._axes.Axes | None = None, limits: Optional[Tuple[UTCDateTime, UTCDateTime]] = None, nooffset: bool = False, colors: list = ['k', 'r', 'b'], labels: List[str] = ['Observed', 'Synthetic', 'New Synthetic'], origin_time: obspy.core.utcdatetime.UTCDateTime | None = None, lw: list | float = 1.0, ls: list | str = '-', absmax: float | None = None, normalization_type: str | int = 'all', plot_labels: bool = True, legend: bool = True, window: bool = False, windowkwargs: dict | None = None, **kwargs)[source]#
Plot a single or a list of traces.
- Parameters:
- tracestp.List[obspy.Trace] | obspy.Trace
obspy.Trace or list of traces
- axmatplotlib.axes.Axes | None, optional
plot into existing axes, by default None
- limitstp.Tuple[obspy.UTCDateTime, obspy.UTCDateTime] | None, optional
set axes limits to UTCDateTimes or floats if origin_time is given, by default None
- nooffsetbool, optional
if you are comparing two traces they are automatically offset, set True if you don’t want that, by default False
- colorslist, optional
list of colors for traces, has to be same length or longer than the number of traces provided, by default [‘k’, ‘r’, ‘b’]
- labelstp.List[str], optional
list of colors for labels, has to be same length or longer than the number of traces provided, by default [‘Observed’, ‘Synthetic’, ‘New Synthetic’]
- origin_timeobspy.UTCDateTime | None, optional
plot traces with respect to some origin time, by default None
- lwlist | float, optional
line width(s) can be single float or list thereof. List has to be same length or longer than the number of traces provided, by default 1.0
- lslist | str, optional
line styles(s) can be single float or list thereof. List has to be same length or longer than the number of traces provided, by default ‘-’
- absmaxfloat | None, optional
normalize traces with respect to a specific absmax, by default None
- normalization_typestr | int, optional
finds absmax to normalize by with respect trace with this index or with respect to ‘all’ traces, by default ‘all’
- plot_labelsbool, optional
Plot trace label, absmax amplitude, by default True
- legendbool, optional
plot a legend or not, by default True
- windowbool, optional
plot windows if available, by default False
- windowkwargsdict | None, optional
kwargs for window plotting, by default None
- Returns:
- matplotlib.axes.Axes
returns axes that the traces have been plotted to
- Raises:
- ValueError
Wrong normalization type input
- ValueError
- station(streams: Union[List[Stream], Stream], *args, components: str = 'ZRT', transparent_axes: bool = False, **kwargs)[source]#
Plots given set of components of stream(s). Is a wrapper around .trace() so
obsplotlib.seismogram.trace()
. Streams should only contain traces of a single station. Otherwise, result may be unpredictable.- Parameters:
- streamstp.List[obspy.Stream] | obspy.Stream
Stream or list of Streams to compare.
- componentsstr, optional
which components to plot, by default “ZRT”
- Returns:
- list of matplotlib.axes.Axes
Each axes contains a component. From top to bottom.
See also
- section(streams: List[Stream], *args, origin_time: obspy.core.utcdatetime.UTCDateTime | None = None, ax: matplotlib.axes._axes.Axes | None = None, comp='Z', limits: Optional[Tuple[UTCDateTime]] = None, scale: float = 1.0, colors=['k', 'r', 'b'], ls=['-', '-', '-'], lw=[0.75, 0.75, 0.75], labels=['Observed', 'Synthetic', 'New'], legendargs: dict | None = None, align: bool = False, absmax: float | None = None, window: bool = False, plot_geometry: bool = True, dist_label: bool = True, az_label: bool = True, plot_amplitudes: bool = True, plot_stations_right: bool = False, skip_station: int | None = None, invert: bool = False, **kwargs)[source]#
Plots a section of seismograms of given stream or stream set. The stream(s) need(s) to contain traces which have the distance parameter set.
- Parameters:
- streamstp.List[obspy.Stream]
obspy.Stream or list of obspy.Streams
- origin_timeobspy.UTCDateTime | None, optional
origin time to plot traces agains, by default None
- axmatplotlib.axes.Axes | None, optional
axes to plot the section into, by default None
- compstr, optional
which component to plot, by default ‘Z’
- limitstp.Tuple[obspy.UTCDateTime] | None, optional
time limits, by default None
- scalefloat, optional
since the traces have to be normalized, we can scale them after normalization, by default 1.0
- colorslist, optional
list of colors must be equal or longer than list of streams, by default [‘k’, ‘r’, ‘b’]
- labelslist, optional
list of labels must be equal or longer than list of streams, by default [‘Observed’, ‘Synthetic’, ‘New’]
- legendargsdict | None, optional
a set of arguments to be parsed to
plt.legend()
if None, no legend is plotted, by default None- alignbool, optional
align traces to a traveltime. traces must have stats.traveltime parameter and origin time must be given, by default False
- absmaxfloat | None, optional
optional value to normalize traces by. If none, automatically determined, by default None
- windowbool, optional
plot windows if available, by default False
- plot_geometrybool, optional
plot geometry information, by default True
- dist_labelbool, optional
plot distance label, by default True
- az_labelbool, optional
plot azimuth label, by default True
- plot_amplitudesbool, optional
plot amplitudes on the right axis, by default True
- Returns:
- tuple of matplotlib.axes.Axes
first axes is the main axes that is plotted into which handles yticklabels on the right, the second axes handles yticklabels on the right.
- Raises:
- ValueError
if
align=True
, but noorigin_time
given- ValueError
if
align=True
, but the traces’ stats objects do not have the traveltime attribute.