test_utils
#
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
Module Contents#
Functions#
Pre-saved event object |
|
|
Pre-saved event object |
|
Pre-saved event object |
|
Make sure we can write SAC headers correctly |
|
Check that event tagging works as expected |
|
Make sure we can write SAC headers correctly |
|
Make sure SAC headers are being written with 0 as the event origin time and |
|
Edit some waveforms to be obviously bad and make sure we can catch it |
Some of these data already have insufficient length |
|
Edit some stations to be obviously bad and make sure we can catch it |
|
|
Make sure data types that aren't float or integer arent' allowed through |
|
Make a simple source-receiver map |
Test reading SPECFEM-generated synthetics in as SAC formatted files |
|
|
Test prefilter corner estimation based on trace starts time and samp rate |
|
TODO |
|
Make sure subsetting streams works by removing additional trace |
Just ensure that getting via USGS works as intended using an example event |
|
Just ensure that getting via GCMT works as intended using an example event |
- test_utils.test_append_sac_headers(test_st, test_inv, test_event)[source]#
Make sure we can write SAC headers correctly
- test_utils.test_event_tag_and_event_tag_legacy(test_event)[source]#
Check that event tagging works as expected
- test_utils.test_format_sac_headers_w_taup_traveltimes(test_st, test_inv, test_event)[source]#
Make sure we can write SAC headers correctly
- test_utils.test_sac_header_correct_origin_time(tmpdir, test_st, test_inv, test_event)[source]#
Make sure SAC headers are being written with 0 as the event origin time and not the trace start time
- test_utils.test_rename_channels(test_st)[source]#
Edit some waveforms to be obviously bad and make sure we can catch it
TODO add function testing clipped station
- test_utils.test_remove_stations_for_insufficient_length(test_st)[source]#
Some of these data already have insufficient length
- test_utils.test_remove_stations_for_missing_channels(test_st)[source]#
Edit some stations to be obviously bad and make sure we can catch it
- test_utils.test_traces_for_bad_data_types(test_st)[source]#
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
- test_utils.test_plot_map(test_event, test_inv)[source]#
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
- test_utils.test_read_sem()[source]#
Test reading SPECFEM-generated synthetics in as SAC formatted files
- test_utils.test_estimate_prefilter_corners(test_st)[source]#
Test prefilter corner estimation based on trace starts time and samp rate
- test_utils.test_subset_streams(test_st)[source]#
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.