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: numpy.ndarray,
geophone_frequency: float,
damping_ratio: float,
calibration_factor: float,
) -> numpy.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
frequenciesnumpy.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 numpy.ndarray
plot_response()
plot_response()def plot_response(
frequencies: numpy.ndarray,
response: numpy.ndarray,
geophone_frequency: Optional[float] = None,
fig: Optional[matplotlib.figure.Figure] = None,
label: Optional[str] = None,
log_base: int = 2,
) -> matplotlib.figure.Figure: ...Create a Bode plot of an existing frequency response.
Parameters
frequenciesnumpy.ndarray — Array of frequencies in Hz.responsenumpy.ndarray — Array of the complex response. One item for each frequency.geophone_frequencyOptional[float] — Geophone frequency in Hz. If given, a vertical line will be drawn at that frequency.figOptional[matplotlib.figure.Figure] — If given, the figure will be used. Useful to plot multiple responses.labelOptional[str] — 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.core.trace.Trace,
geophone_frequency: float,
calibration_factor: float,
damping_ratio: float,
frequency_taper: Optional[Tuple[float, float]] = None,
) -> obspy.core.trace.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.core.trace.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_taperOptional[Tuple[float, float]] — 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.core.trace.Trace — A new
obspy.Trace object with the geophone response being removed.