Receiver Function Inversion (Kennett)#

This inference problem set uses the forward code by Brian Kennet and adapted by Lupei Zhu and Sheng Wang.

The original code is written in C, and it’s wrapped by Cython so that we can call the forward function from Python.

Example models#

  1. A simple 3-layer example with a synthetic dataset

  2. A 9-layer example with a synthetic dataset

  3. A field data example from the Computer Programs in Seismology

Using the forward module#

The above examples are set up to have a good reference model, observed data and other reference information (such as model size, data size and starting model) in place. If you have your own model, or if you have some data and you’d like to invert from it, you might want to use the forward function directly.

To access the forward module, instantiate an object of ReceiverFunctionInversionKnt and use the field .rf.

For example:

import espresso
rf_example = espresso.ReceiverFunctionInversionKnt()
rf = rf_example.rf

my_model_thicknesses = [10, 20, 0]
my_model_vs = [3.3, 3.4, 4.5]
my_model_vp_vs_ratio = [1.732, 1.732, 1.732]
my_ray_param_s_km = 0.07
my_time_shift = 5
my_time_duration = 50
my_time_sampling_interval = 0.1
my_guass = 1.0

data_rf = rf.rf_calc(
    ps=0, 
    thik=my_model_thicknesses, 
    beta=my_model_vs, 
    kapa=my_model_vp_vs_ratio, 
    p=my_ray_param_s_km, 
    duration=my_time_duration, 
    dt=my_time_sampling_interval, 
    shft=my_time_shift, 
    gauss=my_gauss
)
data_times = np.arange(data_rf.size) * my_time_sampling_interval - my_time_shift

# if you'd like to visualise it
import matplotlib.pyplot as plt

plt.scatter(data_times, data_rf)

Contribution Metadata for Receiver function (C)

Receiver function inference problem based on a forward code by Brian Kennet and adapted by Lupei Zhu and Sheng Wang

Author:

Sheng Wang, Jiawen He

Contact:

Jiawen He (hanghur@gmail.com)

Citation:

Kennett, B. (2009). Seismic wave propagation in stratified media (p. 288). ANU Press., 10.26530/OAPEN_459524

Extra website:

Code source

Example usage for ReceiverFunctionInversionKnt#

Code block below is generated automatically based on our tests and inspection of the example objects. We’d like to also refer you to the API Reference for more about the Espresso API.

 1import espresso
 2
 3# Create a ReceiverFunctionInversionKnt object
 4my_receiver_function_inversion_knt = espresso.ReceiverFunctionInversionKnt(example_number=1)
 5
 6# Guaranteed API
 7model_size     = my_receiver_function_inversion_knt.model_size
 8data_size      = my_receiver_function_inversion_knt.data_size
 9null_model     = my_receiver_function_inversion_knt.starting_model
10good_model     = my_receiver_function_inversion_knt.good_model
11given_data     = my_receiver_function_inversion_knt.data
12synthetic_data = my_receiver_function_inversion_knt.forward(good_model)
13
14# Optional API
15example_desc       = my_receiver_function_inversion_knt.description
16model_fig          = my_receiver_function_inversion_knt.plot_model(good_model)
17data_fig           = my_receiver_function_inversion_knt.plot_data(given_data)

Additional attributes to explore: [list_capabilities, rf].

LICENCE#

Copyright 2021-2022 The Contributors All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.