test_recsec =========== .. py:module:: test_recsec .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: test_recsec.SHOW Functions --------- .. autoapisummary:: test_recsec.recsec test_recsec.recsec_w_synthetics test_recsec.test_plot_recsec test_recsec.test_plot_recsec_w_synthetics test_recsec.test_plot_recsec_sort_by test_recsec.test_plot_recsec_scale_by test_recsec.test_plot_recsec_time_shift test_recsec.test_plot_recsec_time_shift_array test_recsec.test_plot_recsec_time_shift_syn_same_as_obs test_recsec.test_plot_recsec_time_shift_syn_array test_recsec.test_plot_recsec_time_shift_syn test_recsec.test_plot_recsec_time_shift_syn_zero test_recsec.test_plot_recsec_time_shift_zero_w_syn test_recsec.test_plot_recsec_preprocess test_recsec.test_plot_recsec_y_label_loc test_recsec.test_plot_recsec_distance_units test_recsec.test_plot_recsec_plot_options test_recsec.test_recsec_calc_time_offset_no_trim test_recsec.test_recsec_calc_time_offset_w_trim test_recsec.test_recsec_zero_amplitude test_recsec.test_recsec_mismatched_locations_fails test_recsec.test_recsec_mismatched_locations test_recsec.test_plot_recsec_zero_pad Module Contents --------------- .. py:data:: SHOW :value: False .. py:function:: recsec(tmpdir) Initiate a RecordSection instance .. py:function:: recsec_w_synthetics(tmpdir) Initiate a RecordSection instance .. py:function:: test_plot_recsec(recsec) Simply test out the functinoality of plotw_rs .. py:function:: test_plot_recsec_w_synthetics(recsec_w_synthetics) Simply test out the functinoality of plotw_rs .. py:function:: test_plot_recsec_sort_by(recsec) Simply test out the functinoality of plotw_rs .. py:function:: test_plot_recsec_scale_by(recsec) scale by option testing .. py:function:: test_plot_recsec_time_shift(recsec) apply a whole bunch of time shift elements .. py:function:: test_plot_recsec_time_shift_array(recsec) apply an array of time shifts to shift each trace differently .. py:function:: test_plot_recsec_time_shift_syn_same_as_obs(tmpdir) apply the same time shift to data and synthetics .. py:function:: test_plot_recsec_time_shift_syn_array(recsec_w_synthetics) apply an array of time shifts to shift each trace differently .. py:function:: test_plot_recsec_time_shift_syn(recsec_w_synthetics) apply different time shift to data and synthetics .. py:function:: test_plot_recsec_time_shift_syn_zero(recsec_w_synthetics) make sure zero synthetic time shift works .. py:function:: test_plot_recsec_time_shift_zero_w_syn(recsec_w_synthetics) make sure zero time shift and nonzero synthetic time shift works .. py:function:: test_plot_recsec_preprocess(recsec) preprocess and filter the record section .. py:function:: test_plot_recsec_y_label_loc(recsec) test all available y_label locations options .. py:function:: test_plot_recsec_distance_units(recsec) test all available distance units .. py:function:: test_plot_recsec_plot_options(recsec) test plotting options .. py:function:: test_recsec_calc_time_offset_no_trim(recsec_w_synthetics) testing that synthetics and data which do not share origin time plot together correctly by checking that the time offsets are calced .. py:function:: test_recsec_calc_time_offset_w_trim(recsec_w_synthetics) testing that synthetics and data which do not share origin time plot together correctly by checking that trim is applied .. py:function:: test_recsec_zero_amplitude(recsec) 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 .. py:function:: test_recsec_mismatched_locations_fails(recsec_w_synthetics) Test that when RecSec encounters stations with different location codes, it fails the parameter check .. py:function:: test_recsec_mismatched_locations(recsec_w_synthetics) 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. .. py:function:: test_plot_recsec_zero_pad(recsec) 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.