Coverage for /opt/obspy/update-docs/src/obspy/obspy/signal/tests/test_filter : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
#!/usr/bin/env python # -*- coding: utf-8 -*- The Filter test suite. """
""" Test cases for Filter. """ # directory where the test files are located
""" Test Butterworth bandpass filter against Butterworth bandpass filter of PITSA. Note that the corners value is twice the value of the filter sections in PITSA. The rms of the difference between ObsPy and PITSA tends to get bigger with higher order filtering. """ # load test file # parameters for the test # filter trace # load pitsa file # calculate normalized rms np.sum(data_pitsa ** 2))
""" Test Butterworth zero-phase bandpass filter against Butterworth zero-phase bandpass filter of PITSA. Note that the corners value is twice the value of the filter sections in PITSA. The rms of the difference between ObsPy and PITSA tends to get bigger with higher order filtering. Note: The Zero-Phase filters deviate from PITSA's zero-phase filters at the end of the trace! The rms for the test is calculated omitting the last 200 samples, as this part of the trace is assumed to generally be of low interest/importance. """ # load test file # parameters for the test # filter trace corners=corners, zerophase=True) # load pitsa file # calculate normalized rms np.sum(data_pitsa[:-200] ** 2))
""" Test Butterworth lowpass filter against Butterworth lowpass filter of PITSA. Note that the corners value is twice the value of the filter sections in PITSA. The rms of the difference between ObsPy and PITSA tends to get bigger with higher order filtering. """ # load test file # parameters for the test # filter trace # load pitsa file # calculate normalized rms np.sum(data_pitsa ** 2))
""" Test Butterworth zero-phase lowpass filter against Butterworth zero-phase lowpass filter of PITSA. Note that the corners value is twice the value of the filter sections in PITSA. The rms of the difference between ObsPy and PITSA tends to get bigger with higher order filtering. Note: The Zero-Phase filters deviate from PITSA's zero-phase filters at the end of the trace! The rms for the test is calculated omitting the last 200 samples, as this part of the trace is assumed to generally be of low interest/importance. """ # load test file # parameters for the test # filter trace zerophase=True) # load pitsa file # calculate normalized rms np.sum(data_pitsa[:-200] ** 2))
""" Test Butterworth highpass filter against Butterworth highpass filter of PITSA. Note that the corners value is twice the value of the filter sections in PITSA. The rms of the difference between ObsPy and PITSA tends to get bigger with higher order filtering. """ # load test file # parameters for the test # filter trace # load pitsa file # calculate normalized rms np.sum(data_pitsa ** 2))
""" Test Butterworth zero-phase highpass filter against Butterworth zero-phase highpass filter of PITSA. Note that the corners value is twice the value of the filter sections in PITSA. The rms of the difference between ObsPy and PITSA tends to get bigger with higher order filtering. Note: The Zero-Phase filters deviate from PITSA's zero-phase filters at the end of the trace! The rms for the test is calculated omitting the last 200 samples, as this part of the trace is assumed to generally be of low interest/importance. """ # load test file # parameters for the test # filter trace zerophase=True) # load pitsa file # calculate normalized rms np.sum(data_pitsa[:-200] ** 2))
""" Test Envelope filter against PITSA. The rms is not so good, but the fit is still good in most parts. """ # load test file # filter trace # load pitsa file # calculate normalized rms np.sum(data_pitsa ** 2))
""" Check magnitudes of basic lowpass cheby2 """ df=df, maxorder=12, ba=True) # calculate frequency response # be smaller than -96dB above lowpass frequency # be 0 (1dB ripple) before filter ramp
if __name__ == '__main__': unittest.main(defaultTest='suite') |