{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "%matplotlib inline\n", "from obspy import *\n", "from obspy.clients.fdsn import Client\n", "from obspy.clients.fdsn import URL_MAPPINGS\n", "import numpy as np\n", "import matplotlib.pylab as plt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Task 1: Copy functions for the Hann window and the moving window analysis from previous assignments here" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Your function for a Hann window" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Your function for the moving window analysis" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Data from data archive using obspy webfdsn client\n", "FDSN stands for the International Federal of Digital Seismic Networks (www.fdsn.org). Citation from their web site: \"The International Federation of Digital Seismograph Networks (FDSN) is a global organization. Its membership is comprised of groups responsible for the installation and maintenance of seismographs either within their geographic borders or globally. Membership in the FDSN is open to all organizations that operate more than one broadband station. Members agree to coordinate station siting and provide free and open access to their data. This cooperation helps scientists all over the world to further the advancement of earth science and particularly the study of global seismic activity.\"\n", "BGR (Bundesanstalt für Geowissenschaften und Rohstoffe) operates broadband stations in Germany and operates a data archive. It is member of the FDSN. That is why we can freely download data from them.\n", "There are other data archives around the world which are also member of the FDSN and allow opn access to their data (see OBSPY documentation " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "for key in sorted(URL_MAPPINGS.keys()): # eine Liste der Archive\n", " print(\"{0:<7} {1}\".format(key, URL_MAPPINGS[key]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Get waveforms for the Tohoku earthquake for station TNS of the German Regional Seismic Network." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "client = Client(\"BGR\") # data archive from which data are fetched\n", "t1 = UTCDateTime(\"2018-01-14T09:19:00.000\") # desired start time of data\n", "stc = client.get_waveforms(\"GR\", \"TNS\",\"\",\"LHZ\",t1, # use fdsn web client to download data\n", " t1 + 7200.,attach_response = True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "stc.detrend('linear') # take out linear trend\n", "stc.plot()\n", "print(stc)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "st = stc.copy() # proceed with copy to avoid repeated downloading\n", "ta = UTCDateTime(\"2018-01-14T10:00:00.000000Z\") # cut to surface wave train\n", "te = UTCDateTime(\"2018-01-14T10:29:59.000000Z\")\n", "st.trim(ta,te)\n", "st.taper(0.05,\"hann\") # apply a taper to bring signal to zero at ends\n", "st.plot() # dispersion is now well visible\n", "print(st)\n", "tr = st[0]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Task 2: Apply the moving window analysis to the data. \n", "Think about window length and shift time. Try different window lengths." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Task 3: Plot the moving window matrix and the time series below. \n", "Use the same limits for the time axis. Choose a subrange for the frequencies. Does the time-frequency analysis reflect the properties of the time series?" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.4" } }, "nbformat": 4, "nbformat_minor": 4 }