Mondaic
This API reference is not for the latest stable Salvus version.

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()

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:

  1. Applies a Butterworth highpass filter.
  2. Applies a Butterworth lowpass filter.
Parameters
  • min_frequency_in_hertz float — Minimum frequency in Hertz.
  • max_frequency_in_hertz float — Maximum frequency in Hertz.
  • highpass_corners int — Corners for the highpass filter.
  • lowpass_corners int — Corners for the lowpass filter.
  • zerophase bool — Zerophase filters on/off.
Returns 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]

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:

  1. Simulate synthetic waveforms with a salvus.flow.simple_config.stf.FilteredHeaviside source 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.
  2. Simulate synthetic waveforms with a salvus.flow.simple_config.stf.Heaviside source time function and then filter the synthetic data with a function generated with this module’s get_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:

  1. Downsamples the data with an appropriate anti-aliasing filter if possible to speed up subsequent operations.
  2. Removes a linear trend.
  3. De-convolves the instrument response.
  4. If necessary, it rotates arbitrarily oriented 3 component recordings to ZNE.
  5. Applies a Butterworth highpass filter.
  6. Applies a Butterworth lowpass filter.
Parameters
  • min_frequency_in_hertz float — Minimum frequency in Hertz.
  • max_frequency_in_hertz float — Maximum frequency in Hertz.
  • highpass_corners int — Corners for the highpass filter.
  • lowpass_corners int — Corners for the lowpass filter.
  • zerophase bool — Zerophase filters on/off.
  • taper_fraction float — Max taper width as a fraction of the full data length.
  • remove_response_water_level float — 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.
Returns 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]