Classes¶
rfpy
defines the following base classes:
RFData¶

class
rfpy.rfdata.
RFData
(sta)¶ A RFData object contains Class attributes that associate station information with a single event (i.e., earthquake) metadata, corresponding raw and rotated seismograms and receiver functions.
Note
The object is initialized with the
sta
field only, and other attributes are added to the object as the analysis proceeds. Parameters
sta (object) – Object containing station information  from
stdb
database.meta (
Meta
) – Object of metadata information for single event (initially set to None)data (
Stream
) – Stream object containing the threecomponent seismograms (either unrotated or rotated by the methodrotate()
)

add_event
(event, gacmin=30.0, gacmax=90.0, phase='P', returned=False)¶ Adds event metadata to RFData object, including travel time info of P wave.
 Parameters
event (
event
) – Event XML objectreturned (bool) – Whether or not to return the
accept
attribute
 Returns
accept – Whether or not the object is accepted for further analysis
 Return type
bool

add_data
(stream, returned=False, new_sr=5.0)¶ Adds stream as object attribute
 Parameters
stream (
Stream
) – Stream container for NEZ seismogramsreturned (bool) – Whether or not to return the
accept
attribute

zne_data
¶ Stream container for NEZ seismograms
 Type
Stream
 Returns
accept – Whether or not the object is accepted for further analysis
 Return type
bool

download_data
(client, stdata=[], ndval=nan, new_sr=5.0, dts=120.0, returned=False, verbose=False)¶ Downloads seismograms based on event origin time and P phase arrival.
 Parameters
client (
Client
) – Client objectndval (float) – Fill in value for missing data
new_sr (float) – New sampling rate (Hz)
dts (float) – Time duration (sec)
stdata (List) – Station list
returned (bool) – Whether or not to return the
accept
attribute
 Returns
accept – Whether or not the object is accepted for further analysis
 Return type
bool

data
¶ Stream containing
Trace
objects Type
Stream

rotate
(vp=None, vs=None, align=None)¶ Rotates 3component seismograms from vertical (Z), east (E) and north (N) to longitudinal (L), radial (Q) and tangential (T) components of motion. Note that the method ‘rotate’ from
obspy.core.stream.Stream
is used for the rotation'ZNE>ZRT'
and'ZNE>LQT'
. Rotation'ZNE>PVH'
is implemented separately here due to different conventions. Parameters
vp (float) – Pwave velocity at surface (km/s)
vs (float) – Swave velocity at surface (km/s)
align (str) – Alignment of coordinate system for rotation (‘ZRT’, ‘LQT’, or ‘PVH’)
 Returns
rotated – Whether or not the object has been rotated
 Return type
bool

calc_snr
(dt=30.0, fmin=0.05, fmax=1.0)¶ Calculates signaltonoise ratio on either Z, L or P component
 Parameters
dt (float) – Duration (sec)
fmin (float) – Minimum frequency corner for SNR filter (Hz)
fmax (float) – Maximum frequency corner for SNR filter (Hz)

snr
¶ Signaltonoise ratio on vertical component (dB)
 Type
float

snrh
¶ Signaltonoise ratio on radial component (dB)
 Type
float

deconvolve
(phase='P', vp=None, vs=None, align=None, method='wiener', pre_filt=None, gfilt=None, wlevel=0.01)¶ Deconvolves threecompoent data using one component as the source wavelet. The source component is always taken as the dominant compressional component, which can be either ‘Z’, ‘L’, or ‘P’.
 Parameters
vp (float) – Pwave velocity at surface (km/s)
vs (float) – Swave velocity at surface (km/s)
align (str) – Alignment of coordinate system for rotation (‘ZRT’, ‘LQT’, or ‘PVH’)
method (str) – Method for deconvolution. Options are ‘wiener’ or ‘multitaper’
gfilt (float) – Center frequency of Gaussian filter (Hz).
wlevel (float) – Water level used in
method='water'
.

rf
¶ Stream containing the receiver function traces
 Type
Stream

to_stream
()¶ Method to switch from RFData object to Stream object. This allows easier manipulation of the receiver functions for postprocessing.

save
(file)¶ Saves RFData object to file
 Parameters
file (str) – File name for RFData object
Class Meta¶

class
rfpy.rfdata.
Meta
(sta, event, gacmin=30.0, gacmax=90.0, phase='P')¶ A Meta object contains attributes associated with the metadata for a single receiver function analysis.
 Parameters
time (
UTCDateTime
) – Origin time of earthquakedep (float) – Depth of hypocenter (km)
lon (float) – Longitude coordinate of epicenter
lat (float) – Latitude coordinate of epicenter
mag (float) – Magnitude of earthquake
gac (float) – Great arc circle between station and epicenter (degrees)
epi_dist (float) – Epicentral distance between station and epicenter (km)
baz (float) – Backazimuth  pointing to earthquake from station (degrees)
az (float) – Azimuth  pointing to station from earthquake (degrees)
ttime (float) – Predicted arrival time (sec)
ph (str) – Phase name
slow (float) – Horizontal slowness of phase
inc (float) – Incidence angle of phase at surface
vp (float) – Pwave velocity at surface (km/s)
vs (float) – Swave velocity at surface (km/s)
align (str) – Alignment of coordinate system for rotation (‘ZRT’, ‘LQT’, or ‘PVH’)
rotated (bool) – Whether or not data have been rotated to
align
coordinate system
HkStack¶

class
rfpy.hk.
HkStack
(rfV1, rfV2=None, strike=None, dip=None, vp=6.0)¶ A HkStack object contains attributes and methods to stack radial receiver functions along moveout curves for point measurements of the depth to Moho (H) and PtoS velocity ratio (k) beneath a seismic stations. The object is initialized with at least one
Stream
containing observed (or synthetised) radial receiver functions. The methods available can produce linear weighted stacks or product stacks, and can be used in the presence of flat or dipping Moho (with known strike and dip).Note
The object is initialized with the
rfV1
field only, and other attributes are added to the object as the analysis proceeds. A secondrfV2
can be included, which is typically a copy ofrfV1
filtered at different corner frequencies and is used to stack along the Pps and Pss moveout curves. Parameters
rfV1 (
Stream
) – Stream object containing the radialcomponent receiver function seismogramsrfV2 (
Stream
) – Stream object containing the radialcomponent receiver function seismograms (typically filtered at lower frequencies)strike (float) – Strike angle of dipping Moho (has to be known or estimated a priori)
dip (float) – Dip angle of Moho (has to be known or estimated a priori)
vp (float) – Mean Pwave velocity of the crust (km/s)
 Other Parameters
kbound (list) – List of 2 floats that determine the range of Vp/Vs values to search
dk (float) – Spacing between adjacent Vp/Vs search values
hbound (list) – List of 2 floats that determine the range of Moho depth values to search
dh (float) – Spacing between adjacent Moho depth search values
weights (list) – List of 3 floats that determine the relative weights of the individual phase stacks to be used in the final stack. The third weight is negative since Pss amplitudes are opposite to those of the Ps and Pps phases.
phases (list) – List of 3 strings (‘ps’, ‘pps’, ‘pss’) corresponding to the thre phases of interest (do not modify this attribute)

stack
(vp=None)¶ Method to calculate Hk stacks from radial receiver functions. The stacks are calculated using phaseweighted stacking for individual phases and take the median of the weighted stack to avoid bias by outliers.
Note
If two streams are available as attributes, the method will assume that the second stream should be used for stacking along the Pps and Pss move out curves (e.g., if the second stream contains lower frequency signals). Furthermore, If the
vp
argument is not specified, the method will use the value set during initialization (vp=6.0
km/s) Parameters
vp (float) – Mean crust Pwave velocity (km/s).

pws
¶ Array of phase stacks, where the outer dimension corresponds to the phase index (shape
nH, nk, nph
) Type
ndarray

sig
¶ Variance of phase stacks, where the outer dimension corresponds to the phase index (shape
nH, nk, nph
) Type
ndarray

stack_dip
(vp=None, strike=None, dip=None)¶ Method to calculate Hk stacks from radial receiver functions using known stike and dip angles of the Moho. The stacks are calculated using phaseweighted stacking for individual phases and take the median of the weighted stack to avoid bias by outliers.
Note
If two streams are available as attributes, the method will assume that the second stream should be used for stacking along the Pps and Pss move out curves (e.g., if the second stream contains lower frequency signals). Furthermore, If the arguments are not specified, the method will use the values set during initialization (
vp=6.0
km/s,strike=0.
,dip=0.
) Parameters
vp (float) – Mean crust Pwave velocity (km/s).
strike (float) – Strike angle of dipping Moho (has to be known or estimated a priori)
dip (float) – Dip angle of Moho (has to be known or estimated a priori)

pws
¶ Array of phase stacks, where the outer dimension corresponds to the phase index (shape
nH, nk, nph
) Type
ndarray

sig
¶ Variance of phase stacks, where the outer dimension corresponds to the phase index (shape
nH, nk, nph
) Type
ndarray

average
(typ='sum', q=0.05, err_method='amp')¶ Method to combine the phaseweighted stacks to produce a final stack, from which to estimate the H and k parameters and their associated errors.
 Parameters
typ (str) – How the phaseweigthed stacks should be combined to produce a final stack. Available options are: weighted sum (
typ=sum
) or product (typ=product
).q (float) – Confidence level for the error estimate
err_method (str) – How errors should be estimated. Options are
err_method='amp'
to estimate errors from amplitude, orerr_method='stats'
to use a statistical F test from the residuals.

error
(q=0.05, err_method='amp')¶ Method to determine the error on H and k estimates.
From Walsh, JGR, 2013
 Parameters
q (float) – Confidence level for the error estimate
err_method (str) – How errors should be estimated. Options are
err_method='amp'
to estimate errors from amplitude, orerr_method='stats'
to use a statistical F test from the residuals.

plot
(save=False, title=None, form='png')¶ Method to plot HK stacks. By default all 4 panels are plotted: The
ps
,pps
andpss
stacks, and the final (averaged) stack. Error contours are also plotted, as well as the position of the maximum stack values. Parameters
save (bool) – Whether or not to save the Figure
title (str) – Title of plot

save
(file)¶ Saves HkStack object to file
 Parameters
file (str) – File name for HkStack object
Harmonics¶

class
rfpy.harmonics.
Harmonics
(radialRF, transvRF=None, azim=0, xmin=0.0, xmax=10.0)¶ A Harmonics object contains attributes and methods to decompose radial and transverse component receiver functions into backazimuth harmonics. The object is initialized with two
Stream
objects containing observed (or synthetised) radial and transverse receiver functions. The methods available can decompose the receiver functions along a fixed azimuth, or search for the optimal azimuth within a time range by minimizing one component.Note
The object is initialized with the
rfV1
field only, and other attributes are added to the object as the analysis proceeds. A secondrfV2
can be included, which is typically a copy ofrfV1
filtered at different corner frequencies and is used to stack along the Pps and Pss moveout curves. Parameters
radialRF (
Stream
) – Stream object containing the radialcomponent receiver function seismogramstransvRF (
Stream
) – Stream object containing the transversecomponent receiver function seismogramsazim (float) – Direction (azimuth) along which the B1 component of the stream is minimized (between
xmin
andxmax
)xmin (float) – Minimum x axis value over which to calculate
azim
xmax (float) – Maximum x axis value over which to calculate
azim
 Other Parameters
hstream (
Stream
) – Stream containing the 5 harmonics, oriented in directionazim
radial_forward (
Stream
, optional) – Stream containing the radial receiver functionstransv_forward (
Stream
, optional) – Stream containing the transverse receiver functions

dcomp_find_azim
(xmin=None, xmax=None)¶ Method to decompose radial and transverse receiver function streams into backazimuth harmonics and determine the main orientation
azim
, obtained by minimizing the B1 component betweenxmin
andxmax
(i.e., time or depth). Parameters
xmin (float) – Minimum x axis value over which to calculate
azim
xmax (float) – Maximum x axis value over which to calculate
azim

hstream
¶ Stream containing the 5 harmonics, oriented in direction
azim
 Type
Stream

azim
¶ Direction (azimuth) along which the B1 component of the stream is minimized (between
xmin
andxmax
) Type
float

var
¶ Variance of the 5 harmonics between
xmin
andxmax
 Type
ndarray

dcomp_fix_azim
(azim=None)¶ Method to decompose radial and transverse receiver function streams into backazimuth harmonics along direction
azim
. Parameters
azim (float) – Direction (azimuth) along which the B1 component of the stream is minimized (between
xmin
andxmax
)

hstream
¶ Stream containing the 5 harmonics, oriented in direction
azim
 Type
Stream

forward
(baz_list=None)¶ Method to forward calculate radial and transverse component receiver functions given the 5 predetermined harmonics and a list of backazimuth values. The receiver function signal parameters (length, sampling rate, etc.) will be identical to those in the stream of harmonic components.
 Parameters
baz_list (list) – List of backazimuth directions over which to calculate the receiver functions. If no list is specified, the method will use the same backazimuths as those in the original receiver function streams

radial_forward
¶ Stream containing the radial receiver functions
 Type
Stream

transv_forward
¶ Stream containing the transverse receiver functions
 Type
Stream

plot
(ymax=30.0, scale=10.0, save=False, title=None, form='png')¶ Method to plot the 5 harmonic components.
 Parameters
ymax (float) – Maximum y axis value (time or depth) over which to plot the harmonic components
scale (float) – Scaling factor for the amplitudes (typically > 1)
save (bool) – Whether or not to save the plot
title (str) – Title of plot, to be used in the Figure and the file name (if
save==True
)

save
(file)¶ Saves harmonics object to file
 Parameters
file (str) – File name for Harmonics object
CCPimage¶

class
rfpy.ccp.
CCPimage
(coord_start=[None, None], coord_end=[None, None], weights=[1.0, 3.0,  3.0], dep=array([0.0, 4.0, 8.0, 14.0, 30.0, 35.0, 45.0, 110.0]), vp=array([4.0, 5.9, 6.2, 6.3, 6.8, 7.2, 8.0, 8.1]), vs=None, vpvs=1.73, dx=2.5, dz=1.0)¶ A CCPimage object contains attributes and methods to produce Common Conversion Point (CCP) stacks for each of the main three main phases (Ps, Pps and Pss) using radialcomponent receiver functions. The object is used to project the stacks along a linear profile, specified by start and end geographical coordinate locations, which are subsequently averaged to produce a final CCP image. The averaging can be done using a linear weighted sum, or a phaseweighted sum. Methods should be used in the appropriate sequence (see
rfpy_ccp.py
for details).Note
By default, the object initializes with undefined coordinate locations for the profile. If not specified during initialization, make sure they are specified later, before the other methods are used, e.g.
ccpimage.xs_lat1 = 10.; ccpimage.xs_lon1 = 110.
, etc. Note also that the default 1D velocity model may not be applicable to your region of interest and a different model can be implemented during initialization or later during processing. Parameters
coord_start (list) – List of two floats corresponding to the (latitude, longitude) pair for the start point of the profile
coord_end (list) – List of two floats corresponding to the (latitude, longitude) pair for the end point of the profile
weights (list) – List of three floats with corresponding weights for the Ps, Pps and Pss phases used during linear, weighted averaging
dep (
ndarray
) – Array of depth values defining the 1D background seismic velocity model. Note that the maximum depth defined here sets the maximum depth in each of the CCP stacks and the final CCP image.vp (
ndarray
) – Array of Vp values defining the 1D background seismic velocity modelvpvs (float) – Constant Vp/Vs ratio for the 1D model.
 Other Parameters
radialRF (list) – List of
Stream
objects containing the radial receiver functions along the line. Each item in the list contains the streams for one single station.vs (
ndarray
) – Array of Vp values defining the 1D background seismic velocity modelxs_lat1 (float) – Latitude of start point defining the linear profile.
xs_lon1 (float) – Longitude of start point defining the linear profile.
xs_lat2 (float) – Latitude of end point defining the linear profile.
xs_lon2 (float) – Longitude of end point defining the linear profile.
is_ready_for_prep (boolean) – Whether or not the object is ready for the method
prep_data
is_ready_for_prestack (boolean) – Whether or not the object is ready for the method
prestack
is_ready_for_ccp (boolean) – Whether or not the object is ready for the method
ccp
is_ready_for_gccp (boolean) – Whether or not the object is ready for the method
gccp

add_rfstream
(rfstream)¶ Method to add a
Stream
object to the listradialRF
. With at least one stream inradialRF
, the object is ready for theprep_data
method, and the corresponding flag is updated. Parameters
rfstream (
Stream
) – Stream object containing radial receiver functions for one station

prep_data
(f1=0.05, f2ps=0.5, f2pps=0.25, f2pss=0.2, nbaz=37, nslow=41)¶ Method to preprocess the data and calculate the CCP points for each of the receiver functions. Preprocessing includes the binning to backazimuth and slowness bins to reduce processing time and generate cleaner stacks, as well as filtering to emphasize the energy of the various phases as a function of depth. As a general rule, the high frequency corner of the 2 reverberated phases (Pps and Pss) should be approximately half of the high frequency corner of the direct (Ps) phase. At the end of this step, the object is updated with the amplitude at the lat, lon and depth values corresponding to the raypath for each receiver function. The object is now ready for the method
prestack
, with the corresponding flag updated. Parameters
f1 (float) – Lowfrequency corner of the bandpass filter used for all phases (Hz)
f2ps (float) – Highfrequency corner of the bandpass filter used for the Ps phase (Hz)
f2pps (float) – Highfrequency corner of the bandpass filter used for the Pps phase (Hz)
f2pss (float) – Highfrequency corner of the bandpass filter used for the Pss phase (Hz)
nbaz (int) – Number of increments in the backazimuth bins
nslow (int) – Number of increments in the slowness bins
following attributes are added to the object (The) –
 Other Parameters
amp_ps_depth (
numpy.ndarray
) – 2D array of amplitudes as a function of depth for the Ps phaseamp_pps_depth (
numpy.ndarray
) – 2D array of amplitudes as a function of depth for the Pps phaseamp_pss_depth (
numpy.ndarray
) – 2D array of amplitudes as a function of depth for the Pss phaselon_depth (
numpy.ndarray
) – 2D array of longitude as a function of depth (i.e., piercing points)lat_depth (
numpy.ndarray
) – 2D array of latitude as a function of depth (i.e., piercing points)is_ready_for_presstack (boolean) – Flag specifying that the object is ready for the presstack() method
n_traces (float) – Total number of traces used in creating the CCP image.

prestack
()¶ Method to project the raypaths onto the 2D profile for each of the three phases. The final grid is defined here, using the parameter
dx
in km. The horizontal extent is predetermined from the start and end points of the profile. At the end of this step, the object contains the set of amplitudes at each of the 2D grid points, for each of the three phases. The object is now ready for the methodsccp
and/orgccp
, with the corresponding flag updated.The following attributes are added to the object:
 Other Parameters
xs_amps_ps (
numpy.ndarray
) – 3D array of amplitudes (1D array of amplitudes at each grid cell) for the Ps phasexs_amps_pps (
numpy.ndarray
) – 3D array of amplitudes (1D array of amplitudes at each grid cell) for the Pps phasexs_amps_pss (
numpy.ndarray
) – 3D array of amplitudes (1D array of amplitudes at each grid cell) for the Pss phaseis_ready_for_ccp (boolean) – Flag specifying that the object is ready for the ccp() method
is_ready_for_gccp (boolean) – Flag specifying that the object is ready for the gccp() method

ccp
()¶ Method to average the amplitudes at each grid point to produce 2D images for each of the three phases. At the end of this step, the object contains the three 2D arrays that can be further averaged into a single final image.
The following attributes are added to the object:
 Other Parameters
xs_ps_avg (
numpy.ndarray
) – 2D array of stacked amplitudes for the Ps phasexs_pps_avg (
numpy.ndarray
) – 2D array of stacked amplitudes for the Pps phasexs_pss_avg (
numpy.ndarray
) – 2D array of stacked amplitudes for the Pss phase

gccp
(wlen=15.0)¶ Method to average the amplitudes at each grid point to produce 2D images for each of the three phases. In this method, the grid points are further smoothed in the horizontal direction using a Gaussian function to simulate Pwave sensitivity kernels. At the end of this step, the object contains the three 2D smoothed arrays that can be further averaged into a single final image.
 Parameters
wlen (float) – Wavelength of the Pwave for smoothing (km).
following attributes are added to the object (The) –
 Other Parameters
xs_gauss_ps (
numpy.ndarray
) – 2D array of stacked and Gaussianfiltered amplitudes for the Ps phasexs_gauss_pps (
numpy.ndarray
) – 2D array of stacked and Gaussianfiltered amplitudes for the Pps phasexs_gauss_pss (
numpy.ndarray
) – 2D array of stacked and Gaussianfiltered amplitudes for the Pss phase

linear_stack
(typ='ccp')¶ Method to average the three 2D images into a final, weighted CCP image using the weights defined in the attribute.
 Parameters
typ (str) – Type of phase stacks to use (either ccp or gccp)
following attributes are added to the object (The) –
 Other Parameters
tot_trace (
numpy.ndarray
) – 2D array of amplitudes for the linearly combined Ps, Pps and Pss phases

phase_weighted_stack
(typ='gccp')¶ Method to average the three 2D smoothed images into a final, phaseweighted CCP image.
 Parameters
typ (str) – Type of phase stacks to use (either ccp or gccp)
following attributes are added to the object (The) –
 Other Parameters
tot_trace (
numpy.ndarray
) – 2D array of amplitudes for the phaseweighted, combined Ps, Pps and Pss phases

save
(title)¶ Method to save the ccpimage object to file.
 Parameters
title (str) – File name for the saved object

plot_ccp
(vmin= 0.05, vmax=0.05, save=False, title='', fmt='png')¶ Method to plot the final CCP stacks along the line.
 Parameters
vmin (float) – Maximum negative value for the color scale
vmax (float) – Maximum positive value for the color scale
save (boolean) – Whether or not to save the figure.
fmt (str) – Format of saved figure
xlen (float) – Total length of profile

plot_gccp
(vmin= 0.015, vmax=0.015, save=False, title='', fmt='png')¶ Method to plot the final GCCP stacks along the line.
 Parameters
vmin (float) – Maximum negative value for the color scale
vmax (float) – Maximum positive value for the color scale
save (boolean) – Whether or not to save the figure.
fmt (str) – Format of saved figure
xlen (float) – Total length of profile
Modules¶
binning¶
Functions to bin receiver functions along backazimuth or slowness bins, or both, or for all data, regardless of the x axis (time or depth).

rfpy.binning.
bin
(stream1, stream2=None, typ='baz', nbin=37, pws=False)¶ Function to stack receiver functions into (baz or slow) bins This can be done using a linear stack (i.e., simple mean), or using phaseweighted stacking.
 Parameters
stream1 (
Stream
) – Stream of equallength seismograms to be stacked into a single trace.stream2 (
Stream
) – Optionally stack a second stream in the same operation.dbaz (int) – Number of bazkazimuth samples in bins
dslow (int) – Number of slowness samples in bins
pws (bool) – Whether or not to perform phaseweighted stacking
 Returns
stack – Stream containing one or two stacked traces, depending on the number of input streams
 Return type
Stream

rfpy.binning.
bin_baz_slow
(stream1, stream2=None, nbaz=37, nslow=21, pws=False)¶ Function to stack receiver functions into backazimuth and slowness bins. This can be done using a linear stack (i.e., simple mean), or using phaseweighted stacking.
 Parameters
stream1 (
Stream
) – Stream of equallength seismograms to be stacked into a single trace.stream2 (
Stream
) – Optionally stack a second stream in the same operation.dbaz (int) – Number of bazkazimuth samples in bins
dslow (int) – Number of slowness samples in bins
pws (bool) – Whether or not to perform phaseweighted stacking
 Returns
stack – Stream containing one or two stacked traces, depending on the number of input streams
 Return type
Stream

rfpy.binning.
bin_all
(stream1, stream2=None, pws=False)¶ Function to bin all streams into a single trace. This can be done using a linear stack (i.e., simple mean), or using phaseweighted stacking.
 Parameters
stream1 (
Stream
) – Stream of equallength seismograms to be stacked into a single trace.stream2 (
Stream
) – Optionally stack a second stream in the same operation.pws (bool) – Whether or not to perform phaseweighted stacking
 Returns
stack – Stream containing one or two stacked traces, depending on the number of input streams
 Return type
Stream
plotting¶
Functions to plot single station Preceiver functions as wiggle plots.
Options to plot by receiver functions # vs time/depth, by backazimuth vs time/depth or slowness vs time.

rfpy.plotting.
wiggle
(stream1, stream2=None, sort=None, tmin=0.0, tmax=30, normalize=True, save=False, title=None, form='png')¶ Function to plot receiver function traces by index in stream. By default, only one stream is required, which produces a Figure with a single panel. Optionally, if a second stream is present, the Figure will contain two panels. The stream(s) can be sorted by stats attribute
sort
, normalized, and the Figure can be saved as .eps. Parameters
stream1 (
Stream
) – Stream of receiver function tracesstream2 (
Stream
) – Stream of receiver function traces, for a twopanel Figuresort (str) – Name of attribute in the
stats
attribute of indivudial traces, used to sort the traces in the Stream(s).xmax (float) – Maximum xaxis value displayed in the Figure.
normalize (bool) – Whether or not to normalize the traces according to the max amplitude in
stream1
save (bool) – Whether or not to save the Figure
title (str) – Title of plot

rfpy.plotting.
wiggle_bins
(stream1, stream2=None, tr1=None, tr2=None, btyp='baz', tmin=0.0, tmax=30.0, xtyp='time', scale=None, norm=None, save=False, title=None, form='png')¶ Function to plot receiver function according to either baz or slowness bins. By default, only one stream is required, which produces a Figure with a single panel. Optionally, if a second stream is present, the Figure will contain two panels. If the single trace arguments are present, they will be plotted at the top.
 Parameters
stream1 (
Stream
) – Stream of receiver function tracesstream2 (
Stream
) – Stream of receiver function traces, for a twopanel Figuretr1 (
Trace
) – Trace to plot at the top ofstream1
tr2 (
Trace
) – Trace to plot at the top ofstream2
btyp (str) – Type of plot to produce (either ‘baz’, ‘slow’, or ‘dist’)
tmax (float) – Maximum xaxis value displayed in the Figure.
xtyp (str) – Type of xaxis label (either ‘time’ or ‘depth’)
scale (float) – Scale factor applied to trace amplitudes for plotting
save (bool) – Whether or not to save the Figure
title (str) – Title of plot