Instaseis Tutorial
Part 4: Finite Sources



Advanced Exercise 2: Finite Source Effects

For earthquakes with Magnitude up to about 5 recorded at teleseismic distances, approximating the fault by a point source is a reasonable approach. However, for larger earthquakes with longer rupture duration this approximation is not valid anymore. In this exercise, you will compare the point source approximation with finite source solutions to understand its limitations.

For three of the earthquakes we use in this tutorial, USGS provides finite fault solutions: the recent event in Nepal, the largest aftershock and the one in Chile. This is the fault solution and slip as a function of time for the Nepal M7.9 event:

Fault representation (image: USGS)

Source Time Function (image: USGS)

Basic lines to set up the notebook and some paths.

In [ ]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import os
import obspy'ggplot')
plt.rcParams['figure.figsize'] = (10, 8)

Import Instaseis and open the database:

In [ ]:
import instaseis
db = instaseis.open_db("data/database")

In Instaseis, a finite fault is represented as set of point sources, where each point source represents one of the fault patches with individual source time function. This functionality is provided by the instaseis.FiniteSource object (see Documentation). It can be initialized in two ways: from a list of point sources, or more conveniently by reading *.param files provided by USGS or standard rupture format (*.srf) files (these can also be used in the GUI).

In [ ]:
finite_source = instaseis.FiniteSource.from_usgs_param_file(

A point source can be computed as a sum of all point sources weighted by their moment:

In [ ]:

The hypo- and epicenter can be found as the fault patch that ruptures first:

In [ ]:
print('hypocenter latitude:', finite_source.hypocenter_latitude,
      'longitude:', finite_source.hypocenter_longitude,
      'depth:', finite_source.hypocenter_depth_in_m / 1e3)

Task: Compare the seismograms for three different representations of the source:

  • A point source with simple gaussian source time function (using CMTSOLUTION or quakeml files),
  • the CMT solution using the more complex source time function provided by finite_source.CMT
  • the full finite source solution using the FiniteSource object and db.get_seismograms_finite_source()

Note: First, you have to adapt the sampling of the source time functions in the finite source to the database, which works like this:

In [ ]:
# reloading finite source here to be sure to have a clean source time function
finite_source = instaseis.FiniteSource.from_usgs_param_file(

# prepare the source time functions to be at the same sampling as the database
# first use enough samples such that the lowpassed stf will still be correctly represented
nsamp = int( / finite_source[0].dt) * 50
finite_source.resample_sliprate(dt=finite_source[0].dt, nsamp=nsamp)
# lowpass to avoid aliasing
# finally resample to the sampling as the database

In [ ]:
# load receivers from stations xml file
receivers = instaseis.Receiver.parse('data/stations/all_stations.xml')

simple_source = instaseis.Source.parse(

# compute seismogram with CMT solution and no simple source time function (gaussian):
tr_simple = 

# compute seismogram with CMT solution and source time function computed as the 
# sum of all source time functions in the finite source (reconvolve_stf=True):
tr_cmt = 

# compute seismogram for finite source
tr_finite = 

plt.plot(tr_simple.times(),, label='simple')
plt.xlim(0, tr_simple.times()[-1])
In [ ]: