obspy.signal.invsim.simulate_seismometer
- simulate_seismometer(data, samp_rate, paz_remove=None, paz_simulate=None, remove_sensitivity=True, simulate_sensitivity=True, water_level=600.0, zero_mean=True, taper=True, taper_fraction=0.05, pre_filt=None, seedresp=None, nfft_pow2=False, pitsasim=True, sacsim=False, shsim=False)[source]
Simulate/Correct seismometer.
- Parameters:
data (NumPy
ndarray
) – Seismogram, detrend before hand (e.g. zero mean)samp_rate (float) – Sample Rate of Seismogram
paz_remove (dict, None) – Dictionary containing keys ‘poles’, ‘zeros’, ‘gain’ (A0 normalization factor). poles and zeros must be a list of complex floating point numbers, gain must be of type float. Poles and Zeros are assumed to correct to m/s, SEED convention. Use None for no inverse filtering.
paz_simulate (dict, None) – Dictionary containing keys ‘poles’, ‘zeros’, ‘gain’. Poles and zeros must be a list of complex floating point numbers, gain must be of type float. Or None for no simulation.
remove_sensitivity (bool) – Determines if data is divided by paz_remove[‘sensitivity’] to correct for overall sensitivity of recording instrument (seismometer/digitizer) during instrument correction.
simulate_sensitivity (bool) – Determines if data is multiplied with paz_simulate[‘sensitivity’] to simulate overall sensitivity of new instrument (seismometer/digitizer) during instrument simulation.
water_level (float) – Water_Level for spectrum to simulate
zero_mean (bool) – If true the mean of the data is subtracted
taper (bool) – If true a cosine taper is applied.
taper_fraction (float) – Taper fraction of cosine taper to use
pre_filt (list(float, float, float, float) or tuple(float, float, float, float)) – Apply a bandpass filter to the data trace before deconvolution. The list or tuple defines the four corner frequencies (f1,f2,f3,f4) of a cosine taper which is one between f2 and f3 and tapers to zero for f1 < f < f2 and f3 < f < f4.
seedresp (dict, None) – Dictionary contains keys ‘filename’, ‘date’, ‘units’. ‘filename’ is the path to a RESP-file generated from a dataless SEED volume (or a file like object with RESP information); ‘date’ is a
UTCDateTime
object for the date that the response function should be extracted for (can be omitted when calling simulate() on Trace/Stream. the Trace’s starttime will then be used); ‘units’ defines the units of the response function. Can be either ‘DIS’, ‘VEL’ or ‘ACC’.nfft_pow2 (bool) – Number of frequency points to use for FFT. If True, the exact power of two is taken (default in PITSA). If False the data are not zero-padded to the next power of two which makes a slower FFT but is then much faster for e.g. evalresp which scales with the FFT points.
pitsasim (bool) – Choose parameters to match instrument correction as done by PITSA.
sacsim (bool) – Choose parameters to match instrument correction as done by SAC.
shsim (bool) – Choose parameters to match instrument correction as done by Seismic Handler.
- Returns:
The corrected data are returned as
numpy.ndarray
float64 array. float64 is chosen to avoid numerical instabilities.
This function works in the frequency domain, where nfft is the next power of len(data) to avoid wrap around effects during convolution. The inverse of the frequency response of the seismometer (
paz_remove
) is convolved with the spectrum of the data and with the frequency response of the seismometer to simulate (paz_simulate
). A 5% cosine taper is taken before simulation. The data must be detrended (e.g.) zero mean beforehand. If paz_simulate=None only the instrument correction is done. In the latter case, a broadband filter can be applied to the data trace using pre_filt. This restricts the signal to the valid frequency band and thereby avoids artifacts due to amplification of frequencies outside of the instrument’s passband (for a detailed discussion see Of Poles and Zeros, F. Scherbaum, Kluwer Academic Publishers).Changed in version 0.5.1: The default for remove_sensitivity and simulate_sensitivity has been changed to
True
. Old deprecated keyword arguments paz, inst_sim, no_inverse_filtering have been removed.