\n", "

"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Seismo-Live: http://seismo-live.org\n", "\n", "##### Authors:\n", "* Martin van Driel ([@martinvandriel](https://github.com/martinvandriel))\n", "* Lion Krischer ([@krischer](https://github.com/krischer))\n", "---"]}, {"cell_type": "markdown", "metadata": {}, "source": [""]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Advanced Exercise 2: Finite Source Effects\n", "\n", "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.\n", "\n", "For three of the earthquakes we use in this tutorial, USGS provides finite fault solutions: \n", "the recent event in [Nepal](http://earthquake.usgs.gov/earthquakes/eventpage/us20002926#scientific_finitefault),\n", "the largest [aftershock](http://earthquake.usgs.gov/earthquakes/eventpage/us20002ejl#scientific_finitefault)\n", "and the one in [Chile](http://earthquake.usgs.gov/earthquakes/eventpage/usc000nzvd#scientific_finitefault). This is the fault solution and slip as a function of time for the Nepal M7.9 event:"]}, {"cell_type": "markdown", "metadata": {}, "source": ["\n", "

\n", "\n", "

\n", " Instaseis Tutorial

\n", " Part 4: Finite Sources

\n", " Fault representation (image: USGS)

Source Time Function (image: USGS)

"]}, {"cell_type": "markdown", "metadata": {}, "source": ["-----\n", "\n", "Basic lines to set up the notebook and some paths."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import os\n", "import obspy\n", "plt.style.use('ggplot')\n", "plt.rcParams['figure.figsize'] = (10, 8)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Import Instaseis and open the database:"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["import instaseis\n", "db = instaseis.open_db(\"data/database\")"]}, {"cell_type": "markdown", "metadata": {}, "source": ["-----"]}, {"cell_type": "markdown", "metadata": {}, "source": ["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)](http://instaseis.net/source.html#instaseis.source.FiniteSource). 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)."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["finite_source = instaseis.FiniteSource.from_usgs_param_file(\n", " 'data/events/finite_source/FINITE_SOURCE_2015_05_12__Mw_7_2_Nepal.param')\n", "print(finite_source)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["A point source can be computed as a sum of all point sources weighted by their moment:"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["finite_source.compute_centroid()\n", "print(finite_source.CMT)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["The hypo- and epicenter can be found as the fault patch that ruptures first:"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["finite_source.find_hypocenter()\n", "print('hypocenter latitude:', finite_source.hypocenter_latitude,\n", " 'longitude:', finite_source.hypocenter_longitude,\n", " 'depth:', finite_source.hypocenter_depth_in_m / 1e3)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["**Task:** Compare the seismograms for three different representations of the source: \n", "\n", "* A point source with simple gaussian source time function (using CMTSOLUTION or quakeml files),\n", "* the CMT solution using the more complex source time function provided by `finite_source.CMT`\n", "* the full finite source solution using the `FiniteSource` object and `db.get_seismograms_finite_source()`\n", "\n", "**Note:** First, you have to adapt the sampling of the source time functions in the finite source to the database, which works like this:"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["# reloading finite source here to be sure to have a clean source time function\n", "finite_source = instaseis.FiniteSource.from_usgs_param_file(\n", " 'data/events/finite_source/FINITE_SOURCE_2015_05_12__Mw_7_2_Nepal.param')\n", "\n", "# prepare the source time functions to be at the same sampling as the database\n", "# first use enough samples such that the lowpassed stf will still be correctly represented\n", "nsamp = int(db.info.period / finite_source[0].dt) * 50\n", "finite_source.resample_sliprate(dt=finite_source[0].dt, nsamp=nsamp)\n", "# lowpass to avoid aliasing\n", "finite_source.lp_sliprate(freq=1.0/db.info.period)\n", "# finally resample to the sampling as the database\n", "finite_source.resample_sliprate(dt=db.info.dt, nsamp=db.info.npts)\n", "\n", "finite_source.compute_centroid()"]}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["exercise"]}, "outputs": [], "source": ["# load receivers from stations xml file\n", "receivers = instaseis.Receiver.parse('data/stations/all_stations.xml')\n", "\n", "simple_source = instaseis.Source.parse(\n", " 'data/events/quakeml/GCMT_2015_04_25__Mw_7_9.xml')\n", "\n", "# compute seismogram with CMT solution and no simple source time function (gaussian):\n", "tr_simple = \n", "\n", "# compute seismogram with CMT solution and source time function computed as the \n", "# sum of all source time functions in the finite source (reconvolve_stf=True):\n", "tr_cmt = \n", "\n", "# compute seismogram for finite source\n", "tr_finite = \n", "\n", "plt.plot(tr_simple.times(), tr_simple.data, label='simple')\n", "plt.plot(...)\n", "plt.plot(...)\n", " \n", "plt.legend()\n", "plt.xlim(0, tr_simple.times()[-1])\n", "\n", "plt.show()"]}, {"cell_type": "markdown", "metadata": {"tags": ["solution"]}, "source": []}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["solution"]}, "outputs": [], "source": []}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}}, "nbformat": 4, "nbformat_minor": 2}