pygmt.Figure.sac
- Figure.sac(data, pen=None, time_window=False, offset=None, profile=None, trace_number_start=0, preprocess=None, positive_fill=None, negative_fill=None, fill_zero=None, fill_time_window=None, amplitude_scale=None, vertical=False, time_scale=None, reduction_velocity=None, time_shift=None, time_reference=None, projection=None, region=None, frame=False, verbose=False, panel=False, perspective=False, transparency=None, **kwargs)
Plot seismograms in SAC format.
Reads SAC waveform files and plots seismic traces. Only evenly spaced SAC data is supported.
Full GMT docs at https://docs.generic-mapping-tools.org/6.7/supplements/seis/sac.html.
Aliases:
B = frame
C = time_window
D = offset
E = profile, trace_number_start
F = preprocess
G = positive_fill, negative_fill, fill_zero, fill_time_window
J = projection
M = amplitude_scale
Q = vertical
R = region
S = time_scale
T = +r: reduction_velocity, +s: time_shift, +t: time_reference
V = verbose
W = pen
c = panel
p = perspective
t = transparency
- Parameters:
data (
str|PathLike|Sequence[str|PathLike]) – The SAC waveform file(s) to plot.pen (
str|None, default:None) – Set pen attributes for all traces [Default is"0.25p,black,solid"].time_window (
Sequence[float] |bool, default:False) – (t0, t1). Read and plot seismograms in the time window between t0 and t1 only, where t0 and t1 are relative to the reference time (seetime_reference). If no reference time is set, the reference time in the SAC header is used. Set toTrueto determine t0 and t1 from the xmin/xmax of theregionparameter.offset (
float|Sequence[float] |None, default:None) – offset or (offset_x, offset_y). Offset the seismogram positions by offset_x and offset_y [Default is no offset]. If a single value offset is given, offset_x = offset_y = offset.profile (
Literal['azimuth','back_azimuth','distance_in_km','distance_in_degree','trace_number','user0','user1','user2','user3','user4','user5','user6','user7','user8','user9'] |None, default:None) – Choose the profile type, i.e., the type of the y axis. Choose from"azimuth","back_azimuth","distance_in_km","distance_in_degree","trace_number", or"user0"to"user9". User-defined profiles use the corresponding SAC header variable, e.g.,"user0"usesuser0.trace_number_start (
int, default:0) – Set the number of the first trace whenprofile="trace_number". [Default is 0].preprocess (
Sequence[Literal['integral','square','demean']] |None, default:None) – Preprocess the data before plotting. Choose from"integral","square", and"demean". Operations are applied in the given order and can be repeated, e.g.,["demean", "integral", "integral"]converts acceleration to displacement.positive_fill (
str|None, default:None) – Set the color or pattern for filling the positive portion of the traces.negative_fill (
str|None, default:None) – Set the color or pattern for filling the negative portion of the traces.fill_zero (
float|None, default:None) – Set the zero line forpositive_fillandnegative_fill.fill_time_window (
Sequence[float] |None, default:None) – Set the time window t0/t1 forpositive_fillandnegative_fill.amplitude_scale (
float|str|Sequence[float|str] |None, default:None) –Set the vertical scaling of the traces.
If only size is given (optionally with a unit), all traces are scaled to the given height on the map.
If size/alpha is given with a negative alpha, all traces use the same scaling factor determined by the first trace, which is scaled to size.
If alpha is 0, all traces are multiplied by size [no unit is allowed].
If alpha is positive, all traces are multiplied by size times the epicentral distance (in km) raised to the power alpha.
vertical (
bool, default:False) – Plot traces vertically, i.e., the y axis is time and the x axis is amplitude.time_scale (
float|str|None, default:None) – Set the time scale in seconds per unit while plotting on geographic plots. Append a unit (c,i, orp); if omitted, the unit is controlled by PROJ_LENGTH_UNIT. Use theiprefix to give the reciprocal scale, i.e., unit per second.reduction_velocity (
float|None, default:None) – Set the reduction velocity in km/s. The trace times are reduced by distance/reduction_velocity, where distance is the epicentral distance in the SAC header.time_shift (
float|None, default:None) – Shift all traces by the given number of seconds.time_reference (
Literal['b','e','o','a','t0','t1','t2','t3','t4','t5','t6','t7','t8','t9'] |None, default:None) – Align all traces along the given time mark. Choose from"b","e","o","a", or"t0"to"t9".projection (
str|None, default:None) – projcode[projparams/]width|scale. Select map projection.region (
Sequence[float|str] |str|None, default:None) – [xmin, xmax, ymin, ymax] or xmin/xmax/ymin/ymax[+r][+uunit]. Specify the region of interest.frame (
Frame|Axis|Literal['none'] |str|Sequence[str] |bool, default:False) – Set frame and axes attributes for the plot. It can be a bool,"none", apygmt.params.Frameorpygmt.params.Axisobject. Raw GMT strings or sequences of strings are also supported for backward compatibility. Ifframe=True, the frame will be drawn with the default attributes. Ifframe="none", no frame will be drawn. Use apygmt.params.Frameorpygmt.params.Axisobject for more control over the attributes of the frame and axes. A tutorial is available at frame and axes attributes. Full documentation is at https://docs.generic-mapping-tools.org/6.7/gmt.html#b-full.verbose (
Literal['quiet','error','warning','timing','info','compat','debug'] |bool, default:False) – Select verbosity level [Full usage].panel (
int|Sequence[int] |bool, default:False) –Select a specific subplot panel. Only allowed when used in
Figure.subplotmode.Trueto advance to the next panel in the selected order.index to specify the index of the desired panel.
(row, col) to specify the row and column of the desired panel.
The panel order is determined by the
Figure.subplotmethod. row, col and index all start at 0.perspective (
float|Sequence[float] |str|bool, default:False) –Select perspective view and set the azimuth and elevation of the viewpoint.
Accepts a single value or a sequence of two or three values: azimuth, (azimuth, elevation), or (azimuth, elevation, zlevel).
azimuth: Azimuth angle of the viewpoint in degrees [Default is 180, i.e., looking from south to north].
elevation: Elevation angle of the viewpoint above the horizon [Default is 90, i.e., looking straight down at nadir].
zlevel: Z-level at which 2-D elements (e.g., the plot frame) are drawn. Only applied when used together with
zsizeorzscale. [Default is at the bottom of the z-axis].
Alternatively, set
perspective=Trueto reuse the perspective setting from the previous plotting method, or pass a string following the full GMT syntax for finer control (e.g., adding+wor+vmodifiers to select an axis location other than the plot origin). See https://docs.generic-mapping-tools.org/6.7/gmt.html#perspective-full for details.transparency (
float|None, default:None) – Set transparency level, in [0-100] percent range [Default is0, i.e., opaque]. Only visible when PDF or raster format output is selected. Only the PNG format selection adds a transparency layer in the image (for further processing).