salvus.project.tools.processing.seismology.processing_templates
Contains a few function generates to create function that are suitable for processing seismological data.
Functions
get_bandpass_filter_processing_function()
get_bandpass_filter_processing_function()def get_bandpass_filter_processing_function(
min_frequency_in_hertz: float,
max_frequency_in_hertz: float,
highpass_corners: int = 3,
lowpass_corners: int = 3,
zerophase: bool = False,
) -> Callable[
[
obspy.core.stream.Stream,
obspy.core.inventory.inventory.Inventory,
salvus.flow.simple_config.receiver._BaseReceiver,
List[salvus.flow.simple_config.source._BaseSource],
],
obspy.core.stream.Stream,
]:
...Generate a processing function for use in SalvusProject.
The generated function here applies a simple Butterworth highpass filter
followed by a lowpass filter. When processing observed data with a
function generated by this module’s
get_remove_response_and_bandpass_filter_processing_function() function
this function here is suitable to filter synthetic data with.
The generated function performs these steps in order:
- Applies a Butterworth highpass filter.
- Applies a Butterworth lowpass filter.
min_frequency_in_hertzfloat — Minimum frequency in Hertz.max_frequency_in_hertzfloat — Maximum frequency in Hertz.highpass_cornersint — Corners for the highpass filter.lowpass_cornersint — Corners for the lowpass filter.zerophasebool — Zerophase filters on/off.
get_remove_response_and_bandpass_filter_processing_function()
get_remove_response_and_bandpass_filter_processing_function()def get_remove_response_and_bandpass_filter_processing_function(
min_frequency_in_hertz: float,
max_frequency_in_hertz: float,
highpass_corners: int = 3,
lowpass_corners: int = 3,
zerophase: bool = False,
taper_fraction: float = 0.05,
remove_response_water_level: float = 10000.0,
) -> Callable[
[
obspy.core.stream.Stream,
obspy.core.inventory.inventory.Inventory,
salvus.flow.simple_config.receiver._BaseReceiver,
List[salvus.flow.simple_config.source._BaseSource],
],
obspy.core.stream.Stream,
]:
...Generate a processing function for use in SalvusProject.
The generated function here is intended to process observed seismological data to be able to compare it to synthetic data. This function is made with that in mind and it can be achieved in two different ways:
- Simulate synthetic waveforms with a
salvus.flow.simple_config.stf.FilteredHeavisidesource time function. The parameters to the STF must be identical to the parameters passed to this function. Then observed data and synthetics can be directly compared. - Simulate synthetic waveforms with a
salvus.flow.simple_config.stf.Heavisidesource time function and then filter the synthetic data with a function generated with this module’sget_bandpass_filter_processing_function()function with identical parameters. Then observed data and synthetics can be directly compared.
The generated function performs a number of steps:
- Downsamples the data with an appropriate anti-aliasing filter if possible to speed up subsequent operations.
- Removes a linear trend.
- De-convolves the instrument response.
- If necessary, it rotates arbitrarily oriented 3 component recordings to ZNE.
- Applies a Butterworth highpass filter.
- Applies a Butterworth lowpass filter.
min_frequency_in_hertzfloat — Minimum frequency in Hertz.max_frequency_in_hertzfloat — Maximum frequency in Hertz.highpass_cornersint — Corners for the highpass filter.lowpass_cornersint — Corners for the lowpass filter.zerophasebool — Zerophase filters on/off.taper_fractionfloat — Max taper width as a fraction of the full data length.remove_response_water_levelfloat — The water level during the remove response call. The function will internally apply a fairly sharp frequency domain filter before deconvolving the instrument response so this be rarely necessary. But it is here in case it becomes necessary.