obspy.core.trace.Trace.remove_response

Trace.remove_response(output='VEL', water_level=60, pre_filt=None, zero_mean=True, taper=True, taper_fraction=0.05, **kwargs)[source]

Deconvolve instrument response.

Uses the obspy.station.response.Response object attached as Trace.stats.response to deconvolve the instrument response from the trace’s timeseries data. Raises an exception if the response is not present. Use e.g. Trace.attach_response() to attach response to trace providing obspy.station.inventory.Inventory data. Note that there are two ways to prevent overamplification while convolving the inverted instrument spectrum: One possibility is to specify a water level which represents a clipping of the inverse spectrum and limits amplification to a certain maximum cut-off value (water_level in dB). The other possibility is to taper the waveform data in the frequency domain prior to multiplying with the inverse spectrum, i.e. perform a pre-filtering in the frequency domain (specifying the four corner frequencies of the frequency taper as a tuple in pre_filt).

Note

Any additional kwargs will be passed on to obspy.station.response.Response.get_evalresp_response(), see documentation of that method for further customization (e.g. start/stop stage).

Note

Using remove_response() is equivalent to using simulate() with the identical response provided as a (dataless) SEED or RESP file and when using the same water_level and pre_filt (and options sacsim=True and pitsasim=False which influence very minor details in detrending and tapering).

Example

>>> from obspy import read
>>> st = read()
>>> tr = st[0].copy()
>>> tr.plot()  
>>> # Response object is already attached to example data:
>>> print tr.stats.response  
Channel Response
    From M/S (Velocity in Meters Per Second) to COUNTS (Digital Counts)
    Overall Sensitivity: 2.5168e+09 defined at 0.020 Hz
    4 stages:
        Stage 1: PolesZerosResponseStage from M/S to V, gain: 1500.00
        Stage 2: CoefficientsTypeResponseStage from V to COUNTS, ...
        Stage 3: FIRResponseStage from COUNTS to COUNTS, gain: 1.00
        Stage 4: FIRResponseStage from COUNTS to COUNTS, gain: 1.00
>>> tr.remove_response()  
<...Trace object at 0x...>
>>> tr.plot()  

[hires.png, pdf]

../../_images/bb083d0c75.png
Parameters:
  • output (str) Output units. One of “DISP” (displacement, output unit is meters), “VEL” (velocity, output unit is meters/second) or “ACC” (acceleration, output unit is meters/second**2).
  • water_level (float) Water level for deconvolution.
  • pre_filt (List or tuple of four float) Apply a bandpass filter in frequency domain to the data 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.
  • zero_mean (bool) If True, the mean of the waveform data is subtracted in time domain prior to deconvolution.
  • taper (bool) If True, a cosine taper is applied to the waveform data in time domain prior to deconvolution.
  • taper_fraction (float) Taper fraction of cosine taper to use.

This Page