test_utils ========== .. py:module:: test_utils .. autoapi-nested-parse:: Test the general utility functions of Pysep which includes quality checking waveforms and formatting data with metadata TODO add function testing clipped station, need to find example data Functions --------- .. autoapisummary:: test_utils.test_event test_utils.test_inv test_utils.test_st test_utils.test_append_sac_headers test_utils.test_append_sac_headers_cartesian test_utils.test_event_tag_and_event_tag_legacy test_utils.test_format_sac_headers_w_taup_traveltimes test_utils.test_sac_header_correct_origin_time test_utils.test_write_cap_weights_files test_utils.test_rename_channels test_utils.test_remove_stations_for_insufficient_length test_utils.test_remove_stations_for_missing_channels test_utils.test_traces_for_bad_data_types test_utils.test_plot_map test_utils.test_read_sem test_utils.test_read_sem_cartesian test_utils.test_estimate_prefilter_corners test_utils.test_remove_for_clipped_amplitudes test_utils.test_subset_streams test_utils.test_get_usgs_moment_tensor test_utils.test_get_gcmt_moment_tensor Module Contents --------------- .. py:function:: test_event() Pre-saved event object .. py:function:: test_inv() Pre-saved event object .. py:function:: test_st() Pre-saved event object .. py:function:: test_append_sac_headers(test_st, test_inv, test_event) Make sure we can write SAC headers correctly .. py:function:: test_append_sac_headers_cartesian(test_st, test_inv, test_event) Make sure we can write SAC headers correctly .. py:function:: test_event_tag_and_event_tag_legacy(test_event) Check that event tagging works as expected .. py:function:: test_format_sac_headers_w_taup_traveltimes(test_st, test_inv, test_event) Make sure we can write SAC headers correctly .. py:function:: test_sac_header_correct_origin_time(tmpdir, test_st, test_inv, test_event) Make sure SAC headers are being written with 0 as the event origin time and not the trace start time .. py:function:: test_write_cap_weights_files(tmpdir, test_st, test_inv, test_event) Test writing out CAP weight files and make sure sorting works for distance and code works as advertised. No testing for az sorting .. py:function:: test_rename_channels(test_st) Edit some waveforms to be obviously bad and make sure we can catch it TODO add function testing clipped station .. py:function:: test_remove_stations_for_insufficient_length(test_st) Some of these data already have insufficient length .. py:function:: test_remove_stations_for_missing_channels(test_st) Edit some stations to be obviously bad and make sure we can catch it .. py:function:: test_traces_for_bad_data_types(test_st) Make sure data types that aren't float or integer arent' allowed through Sometimes LOG streams are stored as |S1 dtype which is string of len 1 .. py:function:: test_plot_map(test_event, test_inv) Make a simple source-receiver map TODO This should probably have an image comparison to a baseline but for now we just make sure plotting works .. py:function:: test_read_sem() Test reading SPECFEM-generated synthetics in as SAC formatted files .. py:function:: test_read_sem_cartesian() Test reading SPECFEM-generated synthetics in Cartesian coordinates .. py:function:: test_estimate_prefilter_corners(test_st) Test prefilter corner estimation based on trace starts time and samp rate .. py:function:: test_remove_for_clipped_amplitudes(test_st) TODO .. py:function:: test_subset_streams(test_st) Make sure subsetting streams works by removing additional trace TODO this test will FAIL if data has multiple traces for a single component present in one stream but not another. This is due to how subset streams matches data (only by station ID). Users will need to merge data or take care that they do not have data gaps/ multiple traces. .. py:function:: test_get_usgs_moment_tensor() Just ensure that getting via USGS works as intended using an example event .. py:function:: test_get_gcmt_moment_tensor() Just ensure that getting via GCMT works as intended using an example event