Coverage for /opt/obspy/update-docs/src/obspy/obspy/signal/tests/test_stream : 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
# -*- coding: utf-8 -*-
""" Test suite for obspy.core.stream.Stream. """ """ Tests the filter method of the Stream object.
Basically three scenarios are tested (with differing filter options): - filtering with in_place=False: - is original stream unchanged? - is data of filtered stream's traces the same as if done by hand - is processing information present in filtered stream's traces - filtering with in_place=True: - is data of filtered stream's traces the same as if done by hand - is processing information present in filtered stream's traces - filtering with bad arguments passed to stream.filter(): - is a TypeError properly raised? - after all bad filter calls, is the stream still unchanged? """ # set specific seed value such that random numbers are reproducible 'starttime': UTCDateTime(2007, 12, 31, 23, 59, 59, 915000), 'npts': 412, 'sampling_rate': 200.0, 'channel': 'EHE'} header=deepcopy(header)) header=deepcopy(header)) header=deepcopy(header)) header=deepcopy(header)) 'starttime': UTCDateTime(2004, 6, 9, 20, 5, 59, 849998), 'sampling_rate': 200.0, 'npts': 12000, 'channel': ' Z'} # streams to run tests on: # drop the longest trace of the first stream to save a second # different sets of filters to run test on: ['bandstop', {'freqmin': 5, 'freqmax': 15., 'corners': 6}], ['lowpass', {'freq': 30.5, 'zerophase': True}], ['highpass', {'freq': 2, 'corners': 2}]] 'lowpass': lowpass, 'highpass': highpass}
# tests for in_place=True # test if all traces were filtered as expected df=st_bkp[i].stats.sampling_rate, **filt_ops) (filt_type, filt_ops)) (filt_type, filt_ops))
# some tests that should raise an Exception ['bandstop', [1, 2, 3, 4, 5]], ['bandstop', None], ['bandstop', 3], ['bandstop', 'XXX']] ['bandstop', {'freqmin': 5, 'freqmax': "XXX", 'corners': 6}], ['bandstop', {}], ['bandpass', {'freqmin': 5, 'corners': 6}], ['bandpass', {'freqmin': 5, 'freqmax': 20., 'df': 100.}]] # test if stream is unchanged after all these bad tests
""" Tests if calling simulate of stream gives the same result as calling simulate on every trace manually. """ - 251.33 + 0j, -131.04 - 467.29j, - 131.04 + 467.29j], 'zeros': [0j, 0j], 'gain': 60077000.0, 'sensitivity': 2516778400.0} - 1.083 + 0.0j], 'zeros': [0.0 + 0.0j, 0.0 + 0.0j, 0.0 + 0.0j], 'gain': 0.4, 'sensitivity': 1.0}
""" Tests if all traces in the stream object are handled as expected by the decimate method on the trace object. """ # create test Stream # test if all traces are decimated as expected
if __name__ == '__main__': unittest.main(defaultTest='suite') |