test_recsec¶
Test the general functionality of the RECord SECtion plotter.
Note
This test suite simply creates some plots to make sure the general machinery is working as expected, but otherwise has no real solid checks on the outputs. If this code grows more cumbersome, we will want to do figure matching checks or something more sophisticated.
Attributes¶
Functions¶
|
Initiate a RecordSection instance |
|
Initiate a RecordSection instance |
|
Simply test out the functinoality of plotw_rs |
|
Simply test out the functinoality of plotw_rs |
|
Simply test out the functinoality of plotw_rs |
|
scale by option testing |
|
apply a whole bunch of time shift elements |
apply an array of time shifts to shift each trace differently |
|
apply the same time shift to data and synthetics |
|
|
apply an array of time shifts to shift each trace differently |
|
apply different time shift to data and synthetics |
|
make sure zero synthetic time shift works |
|
make sure zero time shift and nonzero synthetic time shift works |
|
preprocess and filter the record section |
|
test all available y_label locations options |
|
test all available distance units |
|
test plotting options |
|
testing that synthetics and data which do not share origin time |
|
testing that synthetics and data which do not share origin time |
|
waveforms that have zero amplitude and are normalized should be able |
|
Test that when RecSec encounters stations with different location codes, |
|
Test when RecSec encounters stations that match all their station code |
|
Ensure that zero pad only adds zeros to the start and end of the waveform |
Module Contents¶
- test_recsec.test_plot_recsec_w_synthetics(recsec_w_synthetics)[source]¶
Simply test out the functinoality of plotw_rs
- test_recsec.test_plot_recsec_time_shift_array(recsec)[source]¶
apply an array of time shifts to shift each trace differently
- test_recsec.test_plot_recsec_time_shift_syn_same_as_obs(tmpdir)[source]¶
apply the same time shift to data and synthetics
- test_recsec.test_plot_recsec_time_shift_syn_array(recsec_w_synthetics)[source]¶
apply an array of time shifts to shift each trace differently
- test_recsec.test_plot_recsec_time_shift_syn(recsec_w_synthetics)[source]¶
apply different time shift to data and synthetics
- test_recsec.test_plot_recsec_time_shift_syn_zero(recsec_w_synthetics)[source]¶
make sure zero synthetic time shift works
- test_recsec.test_plot_recsec_time_shift_zero_w_syn(recsec_w_synthetics)[source]¶
make sure zero time shift and nonzero synthetic time shift works
- test_recsec.test_plot_recsec_y_label_loc(recsec)[source]¶
test all available y_label locations options
- test_recsec.test_recsec_calc_time_offset_no_trim(recsec_w_synthetics)[source]¶
testing that synthetics and data which do not share origin time plot together correctly by checking that the time offsets are calced
- test_recsec.test_recsec_calc_time_offset_w_trim(recsec_w_synthetics)[source]¶
testing that synthetics and data which do not share origin time plot together correctly by checking that trim is applied
- test_recsec.test_recsec_zero_amplitude(recsec)[source]¶
waveforms that have zero amplitude and are normalized should be able to bypass normalizations which lead to weird plotting (see #131).
Note
This does not really test that the method is working correctly because dividing a NumPy array by zero leads to NaNs in the array which just won’t plot. This is more of a visual test to make sure that the zero amplitude is plotting correctly, look for green lines
- test_recsec.test_recsec_mismatched_locations_fails(recsec_w_synthetics)[source]¶
Test that when RecSec encounters stations with different location codes, it fails the parameter check
- test_recsec.test_recsec_mismatched_locations(recsec_w_synthetics)[source]¶
Test when RecSec encounters stations that match all their station code except for location code, which is sometimes used as a free-floating parameter to indicate e.g., synthetics or something and doesn’t always determine that waveforms do not match.
- test_recsec.test_plot_recsec_zero_pad(recsec)[source]¶
Ensure that zero pad only adds zeros to the start and end of the waveform but does NOT time shift it.
Note
This is a visual check for now so unskip this test and set constant SHOW==True to have a look at the waveforms that get plotted. In the future we could do a check on the time of the max amplitude but I did not think it was worth the investment to write that test.