salvus.modules.near_surface.processing.geophone_response
salvus.modules.near_surface.processing.geophone_response salvus modules near_surface processing geophone_response Functions for computing, removing, and plotting geophone responses.
Functions
compute_geophone_response()
compute_geophone_response()def compute_geophone_response(
frequencies: np.ndarray,
geophone_frequency: float,
damping_ratio: float,
calibration_factor: float,
) -> np.ndarray: ...Compute the frequency response of a geophone relative to ground velocity.
Assumes a simplified second-order damped spring-mass system that nonetheless should be fairly accurate for many uses.
Parameters
frequenciesnp.ndarray — Frequencies for which to compute the response in Hz.geophone_frequencyfloat — The natural frequency of the geophone in Hz.damping_ratiofloat — The damping ratio. Between 0 and 1.calibration_factorfloat — The calibration factor. Usually given as V/m or V/inch. Make sure the units are correct for your application. Salvus computes everything in SI units.
Returns np.ndarray
plot_response()
plot_response()def plot_response(
frequencies: np.ndarray,
response: np.ndarray,
geophone_frequency: float | None = None,
fig: matplotlib.figure.Figure | None = None,
label: str | None = None,
log_base: int = 2,
) -> matplotlib.figure.Figure: ...Create a Bode plot of an existing frequency response.
Parameters
frequenciesnp.ndarray — Array of frequencies in Hz.responsenp.ndarray — Array of the complex response. One item for each frequency.geophone_frequencyfloat | None — Geophone frequency in Hz. If given, a vertical line will be drawn at that frequency.figmatplotlib.figure.Figure | None — If given, the figure will be used. Useful to plot multiple responses.labelstr | None — Label for the response.log_baseint — Base for the logarithmic axes.
Returns matplotlib.figure.Figure
remove_geophone_response()
remove_geophone_response()def remove_geophone_response(
tr: obspy.Trace,
geophone_frequency: float,
calibration_factor: float,
damping_ratio: float,
frequency_taper: tuple[float, float] | None = None,
) -> obspy.Trace: ...Remove the geophone response from a given trace and return a new trace object.
Uses the compute_geophone_response() function to compute the actual
response.
Parameters
trobspy.Trace — Trace with the to be corrected data.geophone_frequencyfloat — The natural frequency of the geophone in Hz.calibration_factorfloat — The calibration factor. Usually given as V/m or V/inch. Make sure the units are correct for your application. Salvus computes everything in SI units.damping_ratiofloat — The damping ratio. Between 0 and 1.frequency_tapertuple[float, float] | None — Frequency domain taper (bandpass filter) to stabilize the spectral division. Must be given as a tuple of two values: The min and max frequency of the passband. There will be a transition zone between (min/2 - min) and (max - max * 2.0) to go from stop to passband.
Returns obspy.Trace — A new
obspy.Trace object with the geophone response being removed.