updated paths to header image file

This commit is contained in:
kasper committed 2024-06-10 12:15:28 +02:00
1 parent 228434397d
commit 3be655017f
9 files changed
+10 -10

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<div style='background-image: url(\"../share/images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n",
"<div style='background-image: url(\"../images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n",
" <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n",
" <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n",
" <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n",
@@ -61,7 +61,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.10.14"
}
},
"nbformat": 4,
+1 -1
View File
@@ -1 +1 @@
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["<div style='background-image: url(\"../share/images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n", " <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n", " <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n", " <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n", " <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Introduction to File Formats and read/write in ObsPy</div>\n", " </div>\n", " </div>\n", "</div>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Seismo-Live: http://seismo-live.org\n", "\n", "##### Authors:\n", "* Lion Krischer ([@krischer](https://github.com/krischer))\n", "* Tobias Megies ([@megies](https://github.com/megies))\n", "---"]}, {"cell_type": "markdown", "metadata": {}, "source": ["![](images/obspy_logo_full_524x179px.png)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["This is oftentimes not taught, but fairly important to understand, at least at a basic level. This also teaches you how to work with these in ObsPy."]}, {"cell_type": "markdown", "metadata": {}, "source": ["**This notebook aims to give a quick introductions to ObsPy's core functions and classes. Everything here will be repeated in more detail in later notebooks.**"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "plt.style.use('ggplot')\n", "plt.rcParams['figure.figsize'] = 12, 8"]}, {"cell_type": "markdown", "metadata": {}, "source": ["## SEED Identifiers\n", "\n", "According to the [SEED standard](www.fdsn.org/seed_manual/SEEDManual_V2.4.pdf), which is fairly well adopted, the following nomenclature is used to identify seismic receivers:\n", "\n", "* **Network code**: Identifies the network/owner of the data. Assigned by the FDSN and thus unique.\n", "* **Station code**: The station within a network. *NOT UNIQUE IN PRACTICE!* Always use together with a network code!\n", "* **Location ID**: Identifies different data streams within one station. Commonly used to logically separate multiple instruments at a single station.\n", "* **Channel codes**: Three character code: 1) Band and approximate sampling rate, 2) The type of instrument, 3) The orientation\n", "\n", "This results in full ids of the form **NET.STA.LOC.CHAN**, e.g. **IV.PRMA..HHE**.\n", "\n", "\n", "---\n", "\n", "\n", "In seismology we generally distinguish between three separate types of data:\n", "\n", "1. **Waveform Data** - The actual waveforms as time series.\n", "2. **Station Data** - Information about the stations' operators, geographical locations, and the instrument's responses.\n", "3. **Event Data** - Information about earthquakes.\n", "\n", "Some formats have elements of two or more of these."]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Waveform Data\n", "\n", "![stream](images/Stream_Trace.svg)\n", "\n", "There are a myriad of waveform data formats but in Europe and the USA two formats dominate: **MiniSEED** and **SAC**\n", "\n", "\n", "### MiniSEED\n", "\n", "* This is what you get from datacenters and also what they store, thus the original data\n", "* Can store integers and single/double precision floats\n", "* Integer data (e.g. counts from a digitizer) are heavily compressed: a factor of 3-5 depending on the data\n", "* Can deal with gaps and overlaps\n", "* Multiple components per file\n", "* Contains only the really necessary parameters and some information for the data providers"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["import obspy\n", "\n", "# ObsPy automatically detects the file format.\n", "st = obspy.read(\"data/example.mseed\")\n", "print(st)\n", "\n", "# Fileformat specific information is stored here.\n", "print(st[0].stats.mseed)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["st.plot()"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["# This is a quick interlude to teach you basics about how to work\n", "# with Stream/Trace objects.\n", "\n", "# Most operations work in-place, e.g. they modify the existing\n", "# objects. We'll create a copy here.\n", "st2 = st.copy()\n", "\n", "# To use only part of a Stream, use the select() function.\n", "print(st2.select(component=\"Z\"))\n", "\n", "# Stream objects behave like a list of Trace objects.\n", "tr = st2[0]\n", "\n", "tr.plot()\n", "\n", "# Some basic processing. Please note that these modify the\n", "# existing object.\n", "tr.detrend(\"linear\")\n", "tr.taper(type=\"hann\", max_percentage=0.05)\n", "tr.filter(\"lowpass\", freq=0.5Line truncated
{"cells":[{"cell_type":"markdown","metadata":{},"source":["<div style='background-image: url(\"../images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n"," <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n"," <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n"," <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n"," <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Introduction to File Formats and read/write in ObsPy</div>\n"," </div>\n"," </div>\n","</div>"]},{"cell_type":"markdown","metadata":{},"source":["Seismo-Live: http://seismo-live.org\n","\n","##### Authors:\n","* Lion Krischer ([@krischer](https://github.com/krischer))\n","* Tobias Megies ([@megies](https://github.com/megies))\n","---"]},{"cell_type":"markdown","metadata":{},"source":["![](images/obspy_logo_full_524x179px.png)"]},{"cell_type":"markdown","metadata":{},"source":["This is oftentimes not taught, but fairly important to understand, at least at a basic level. This also teaches you how to work with these in ObsPy."]},{"cell_type":"markdown","metadata":{},"source":["**This notebook aims to give a quick introductions to ObsPy's core functions and classes. Everything here will be repeated in more detail in later notebooks.**"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["%matplotlib inline\n","import matplotlib.pyplot as plt\n","plt.style.use('ggplot')\n","plt.rcParams['figure.figsize'] = 12, 8"]},{"cell_type":"markdown","metadata":{},"source":["## SEED Identifiers\n","\n","According to the [SEED standard](www.fdsn.org/seed_manual/SEEDManual_V2.4.pdf), which is fairly well adopted, the following nomenclature is used to identify seismic receivers:\n","\n","* **Network code**: Identifies the network/owner of the data. Assigned by the FDSN and thus unique.\n","* **Station code**: The station within a network. *NOT UNIQUE IN PRACTICE!* Always use together with a network code!\n","* **Location ID**: Identifies different data streams within one station. Commonly used to logically separate multiple instruments at a single station.\n","* **Channel codes**: Three character code: 1) Band and approximate sampling rate, 2) The type of instrument, 3) The orientation\n","\n","This results in full ids of the form **NET.STA.LOC.CHAN**, e.g. **IV.PRMA..HHE**.\n","\n","\n","---\n","\n","\n","In seismology we generally distinguish between three separate types of data:\n","\n","1. **Waveform Data** - The actual waveforms as time series.\n","2. **Station Data** - Information about the stations' operators, geographical locations, and the instrument's responses.\n","3. **Event Data** - Information about earthquakes.\n","\n","Some formats have elements of two or more of these."]},{"cell_type":"markdown","metadata":{},"source":["## Waveform Data\n","\n","![stream](images/Stream_Trace.svg)\n","\n","There are a myriad of waveform data formats but in Europe and the USA two formats dominate: **MiniSEED** and **SAC**\n","\n","\n","### MiniSEED\n","\n","* This is what you get from datacenters and also what they store, thus the original data\n","* Can store integers and single/double precision floats\n","* Integer data (e.g. counts from a digitizer) are heavily compressed: a factor of 3-5 depending on the data\n","* Can deal with gaps and overlaps\n","* Multiple components per file\n","* Contains only the really necessary parameters and some information for the data providers"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["import obspy\n","\n","# ObsPy automatically detects the file format.\n","st = obspy.read(\"data/example.mseed\")\n","print(st)\n","\n","# Fileformat specific information is stored here.\n","print(st[0].stats.mseed)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["st.plot()"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# This is a quick interlude to teach you basics about how to work\n","# with Stream/Trace objects.\n","\n","# Most operations work in-place, e.g. they modify the existing\n","# objects. We'll create a copy here.\n","st2 = st.copy()\n","\n","# To use only part of a Stream, use the select() function.\n","print(st2.select(component=\"Z\"))\n","\n","# Stream objects behave like a list of Trace objects.\n","tr = st2[0]\n","\n","tr.plot()\n","\n","# Some basic processing. Please note that these modify the\n","# existing object.\n","tr.detrend(\"linear\")\n","tr.taper(type=\"hann\", max_percentage=0.05)\n","tr.filter(\"lowpass\", freq=0.5)\n","\n","tr.plot()"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# You can write it again by simply specifing the format.\n"Line truncated
+1 -1
View File
@@ -1 +1 @@
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["<div style='background-image: url(\"../share/images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n", " <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n", " <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n", " <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n", " <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Handling Time</div>\n", " </div>\n", " </div>\n", "</div>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Seismo-Live: http://seismo-live.org\n", "\n", "##### Authors:\n", "* Lion Krischer ([@krischer](https://github.com/krischer))\n", "* Tobias Megies ([@megies](https://github.com/megies))\n", "\n", "---"]}, {"cell_type": "markdown", "metadata": {}, "source": ["![](images/obspy_logo_full_524x179px.png)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["This is a bit dry but not very difficult and important to know. It is used everywhere in ObsPy!\n", "\n", "\n", "* All absolute time values are consistently handled with this class\n", "* Based on a double precision POSIX timestamp for accuracy\n", "* Timezone can be specified at initialization (if necessary)\n", "* In Coordinated Universal Time (UTC) so no need to deal with timezones, daylight savings, ...\n", "\n", "---"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "plt.style.use('ggplot')\n", "plt.rcParams['figure.figsize'] = 12, 8"]}, {"cell_type": "markdown", "metadata": {}, "source": ["---\n", "\n", "## Features of **`UTCDateTime`**\n", "\n", "#### Initialization"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from obspy import UTCDateTime\n", "\n", "print(UTCDateTime(\"2011-03-11T05:46:23.2\")) # mostly time strings defined by ISO standard\n", "print(UTCDateTime(\"2011-03-11T14:46:23.2+09:00\")) # non-UTC timezone input\n", "print(UTCDateTime(2011, 3, 11, 5, 46, 23, 2))\n", "print(UTCDateTime(1299822383.2))"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["# Current time can be initialized by leaving out any arguments\n", "print(UTCDateTime())"]}, {"cell_type": "markdown", "metadata": {}, "source": ["#### Attribute Access"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["time = UTCDateTime(\"2011-03-11T05:46:23.200000Z\")\n", "print(time.year)\n", "print(time.julday)\n", "print(time.timestamp)\n", "print(time.weekday)\n", "# try time.<Tab>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["#### Handling time differences\n", "\n", "* \"**`+`**/**`-`**\" defined to add seconds to an **`UTCDateTime`** object\n", "* \"**`-`**\" defined to get time difference of two **`UTCDateTime`** objects"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["time = UTCDateTime(\"2011-03-11T05:46:23.200000Z\")\n", "print(time)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["# one hour later\n", "print(time + 3600)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["time2 = UTCDateTime(2012, 1, 1)\n", "print(time2 - time)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Exercises\n", "\n", "Calculate the number of days passed since the Tohoku main shock (the timestamp used above)."]}, {"cell_type": "code", "execution_count": null, "metadata": {"lines_to_next_cell": 2, "tags": ["exercise"]}, "outputs": [], "source": []}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["solution"]}, "outputs": [], "source": []}, {"cell_type": "markdown", "metadata": {}, "source": ["Make a list of 10 UTCDateTime objects, starting today at 10:00 with a spacing of 90 minutes."]}, {"cell_type": "code", "execution_count": null, "metadata": {"lines_to_next_cell": 2, "tags": ["exercise"]}, "outputs": [], "source": []}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["solution"]}, "outputs": [], "source": []}, {"cell_type": "markdown", "metadata": {}, "source": ["Below is a list of strings with origin times of magnitude 8+ earthquakes since 2000 (fetched from IRIS). Assemble a list of interevent times in days. Use matplotlib to display a histogram."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["times = [\"2001-06-23T20:33:09\",\n", " \"2003-09-25T19:50:07\",\n", " \"2004-12-23T14:59:00\",\n", " \"2004-12-26T00:58:52\",\n", " \"2005-03-28T16:09:35\",\n", " \"2006-06-01T18:57:02\",\n", "Line truncated
{"cells":[{"cell_type":"markdown","metadata":{},"source":["<div style='background-image: url(\"../images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n"," <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n"," <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n"," <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n"," <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Handling Time</div>\n"," </div>\n"," </div>\n","</div>"]},{"cell_type":"markdown","metadata":{},"source":["Seismo-Live: http://seismo-live.org\n","\n","##### Authors:\n","* Lion Krischer ([@krischer](https://github.com/krischer))\n","* Tobias Megies ([@megies](https://github.com/megies))\n","\n","---"]},{"cell_type":"markdown","metadata":{},"source":["![](images/obspy_logo_full_524x179px.png)"]},{"cell_type":"markdown","metadata":{},"source":["This is a bit dry but not very difficult and important to know. It is used everywhere in ObsPy!\n","\n","\n","* All absolute time values are consistently handled with this class\n","* Based on a double precision POSIX timestamp for accuracy\n","* Timezone can be specified at initialization (if necessary)\n","* In Coordinated Universal Time (UTC) so no need to deal with timezones, daylight savings, ...\n","\n","---"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["%matplotlib inline\n","import matplotlib.pyplot as plt\n","plt.style.use('ggplot')\n","plt.rcParams['figure.figsize'] = 12, 8"]},{"cell_type":"markdown","metadata":{},"source":["---\n","\n","## Features of **`UTCDateTime`**\n","\n","#### Initialization"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["from obspy import UTCDateTime\n","\n","print(UTCDateTime(\"2011-03-11T05:46:23.2\")) # mostly time strings defined by ISO standard\n","print(UTCDateTime(\"2011-03-11T14:46:23.2+09:00\")) # non-UTC timezone input\n","print(UTCDateTime(2011, 3, 11, 5, 46, 23, 2))\n","print(UTCDateTime(1299822383.2))"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# Current time can be initialized by leaving out any arguments\n","print(UTCDateTime())"]},{"cell_type":"markdown","metadata":{},"source":["#### Attribute Access"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["time = UTCDateTime(\"2011-03-11T05:46:23.200000Z\")\n","print(time.year)\n","print(time.julday)\n","print(time.timestamp)\n","print(time.weekday)\n","# try time.<Tab>"]},{"cell_type":"markdown","metadata":{},"source":["#### Handling time differences\n","\n","* \"**`+`**/**`-`**\" defined to add seconds to an **`UTCDateTime`** object\n","* \"**`-`**\" defined to get time difference of two **`UTCDateTime`** objects"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["time = UTCDateTime(\"2011-03-11T05:46:23.200000Z\")\n","print(time)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# one hour later\n","print(time + 3600)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["time2 = UTCDateTime(2012, 1, 1)\n","print(time2 - time)"]},{"cell_type":"markdown","metadata":{},"source":["### Exercises\n","\n","Calculate the number of days passed since the Tohoku main shock (the timestamp used above)."]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":["exercise"]},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"tags":["solution"]},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["Make a list of 10 UTCDateTime objects, starting today at 10:00 with a spacing of 90 minutes."]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":["exercise"]},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"tags":["solution"]},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["Below is a list of strings with origin times of magnitude 8+ earthquakes since 2000 (fetched from IRIS). Assemble a list of interevent times in days. Use matplotlib to display a histogram."]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["times = [\"2001-06-23T20:33:09\",\n"," \"2003-09-25T19:50:07\",\n"," \"2004-12-23T14:59:00\",\n"," \"2004-12-26T00:58:52\",\n"," \"2005-03-28T16:09:35\",\n"," \"2006-06-01T18:57:02\",\n"," \"2006-06-05T00:50:31\",\n"," \"2006-11-15T11:14:14\",\n"," \"2007-01-13T04:23:23\",\n"," \"2007-04-01T20:39:56\",\n"," \"2007-08-15T23:40:58\",\n"," \"2007-09-12T11:10:26\",\n"," \"2009-09-Line truncated
+1 -1
View File
@@ -1 +1 @@
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["<div style='background-image: url(\"../share/images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n", " <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n", " <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n", " <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n", " <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Handling Waveform Data</div>\n", " </div>\n", " </div>\n", "</div>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Seismo-Live: http://seismo-live.org\n", "\n", "##### Authors:\n", "* Tobias Megies ([@megies](https://github.com/megies))\n", "* Lion Krischer ([@krischer](https://github.com/krischer))\n", "---"]}, {"cell_type": "markdown", "metadata": {}, "source": ["![](images/obspy_logo_full_524x179px.png)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "plt.style.use('ggplot')\n", "plt.rcParams['figure.figsize'] = 12, 8"]}, {"cell_type": "markdown", "metadata": {}, "source": ["<img src=\"images/Stream_Trace.svg\" width=90%>\n", "\n", "* read waveform data is returned as a **`Stream`** object."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from obspy import read\n", "st = read(\"./data/waveform_PFO.mseed\", format=\"mseed\")\n", "print(st)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- UNIX wildcards can be used to read multiple files simultaneously\n", "- automatic file format detection, no need to worry about file formats\n", "\n", " - currently supported: **mseed, sac, segy, seg2, gse1/2, seisan, sh, datamark, css, wav, y, Q (keeps growing...)**\n", " - more file formats are included whenever a basic reading routine is provided (or e.g. sufficient documentation on data compression etc.)\n", " - custom user-specific file formats can be added (through plugin) to filetype autodiscovery in local ObsPy installation by user"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from obspy import read\n", "st = read(\"./data/waveform_*\")\n", "print(st)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- for MiniSEED files, only reading short portions of files without all of the file getting read into memory is supported (saves time and memory when working on large collections of big files)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from obspy import UTCDateTime\n", "\n", "t = UTCDateTime(\"2011-03-11T05:46:23.015400Z\")\n", "st = read(\"./data/waveform_*\", starttime=t + 10 * 60, endtime=t + 12 * 60)\n", "print(st)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["#### The Stream Object\n", "\n", " - A Stream object is a collection of Trace objects"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from obspy import read\n", "st = read(\"./data/waveform_PFO.mseed\")\n", "print(type(st))"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["print(st)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["print(st.traces)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["print(st[0])"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- More traces can be assembled using **`+`** operator (or using the `.append()` and `.extend()` methods)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["st1 = read(\"./data/waveform_PFO.mseed\")\n", "st2 = read(\"./data/waveform_PFO_synthetics.mseed\")\n", "\n", "st = st1 + st2\n", "print(st)\n", "\n", "st3 = read(\"./data/waveform_BFO_BHE.sac\")\n", "\n", "st += st3\n", "print(st)"]}, {"cell_type": "markdown", "metadata": {}, "source": [" - convenient (and nicely readable) looping over traces"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["for tr in st:\n", " print(tr.id)"]}, {"cell_type": "markdown", "metadata": {}, "source": [" - Stream is useful for applying the same processing to a larger number of different waveforms or to group Traces for processing (e.g. three components of one station in one Stream)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["#### The Trace Object\n", "\n", "- a Trace object is a single, contiguous waveform data block (i.e. regularly spaced time series, no gaps)\n", "- a Trace object contains a limited amount of metadata in a dictionary-like object (as **`Trace.stats`**) that fully describes the time series by specifying.Line truncated
{"cells":[{"cell_type":"markdown","metadata":{},"source":["<div style='background-image: url(\"../images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n"," <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n"," <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n"," <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n"," <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Handling Waveform Data</div>\n"," </div>\n"," </div>\n","</div>"]},{"cell_type":"markdown","metadata":{},"source":["Seismo-Live: http://seismo-live.org\n","\n","##### Authors:\n","* Tobias Megies ([@megies](https://github.com/megies))\n","* Lion Krischer ([@krischer](https://github.com/krischer))\n","---"]},{"cell_type":"markdown","metadata":{},"source":["![](images/obspy_logo_full_524x179px.png)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["%matplotlib inline\n","import matplotlib.pyplot as plt\n","plt.style.use('ggplot')\n","plt.rcParams['figure.figsize'] = 12, 8"]},{"cell_type":"markdown","metadata":{},"source":["<img src=\"images/Stream_Trace.svg\" width=90%>\n","\n","* read waveform data is returned as a **`Stream`** object."]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["from obspy import read\n","st = read(\"./data/waveform_PFO.mseed\", format=\"mseed\")\n","print(st)"]},{"cell_type":"markdown","metadata":{},"source":["- UNIX wildcards can be used to read multiple files simultaneously\n","- automatic file format detection, no need to worry about file formats\n","\n"," - currently supported: **mseed, sac, segy, seg2, gse1/2, seisan, sh, datamark, css, wav, y, Q (keeps growing...)**\n"," - more file formats are included whenever a basic reading routine is provided (or e.g. sufficient documentation on data compression etc.)\n"," - custom user-specific file formats can be added (through plugin) to filetype autodiscovery in local ObsPy installation by user"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["from obspy import read\n","st = read(\"./data/waveform_*\")\n","print(st)"]},{"cell_type":"markdown","metadata":{},"source":["- for MiniSEED files, only reading short portions of files without all of the file getting read into memory is supported (saves time and memory when working on large collections of big files)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["from obspy import UTCDateTime\n","\n","t = UTCDateTime(\"2011-03-11T05:46:23.015400Z\")\n","st = read(\"./data/waveform_*\", starttime=t + 10 * 60, endtime=t + 12 * 60)\n","print(st)"]},{"cell_type":"markdown","metadata":{},"source":["#### The Stream Object\n","\n"," - A Stream object is a collection of Trace objects"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["from obspy import read\n","st = read(\"./data/waveform_PFO.mseed\")\n","print(type(st))"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["print(st)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["print(st.traces)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["print(st[0])"]},{"cell_type":"markdown","metadata":{},"source":["- More traces can be assembled using **`+`** operator (or using the `.append()` and `.extend()` methods)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["st1 = read(\"./data/waveform_PFO.mseed\")\n","st2 = read(\"./data/waveform_PFO_synthetics.mseed\")\n","\n","st = st1 + st2\n","print(st)\n","\n","st3 = read(\"./data/waveform_BFO_BHE.sac\")\n","\n","st += st3\n","print(st)"]},{"cell_type":"markdown","metadata":{},"source":[" - convenient (and nicely readable) looping over traces"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["for tr in st:\n"," print(tr.id)"]},{"cell_type":"markdown","metadata":{},"source":[" - Stream is useful for applying the same processing to a larger number of different waveforms or to group Traces for processing (e.g. three components of one station in one Stream)"]},{"cell_type":"markdown","metadata":{},"source":["#### The Trace Object\n","\n","- a Trace object is a single, contiguous waveform data block (i.e. regularly spaced time series, no gaps)\n","- a Trace object contains a limited amount of metadata in a dictionary-like object (as **`Trace.stats`**) that fully describes the time series by specifying..\n"," * recording location/instrument (network, station, location and channel code)\n"," * start time\n"," * sampling rate"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["st = reaLine truncated
+1 -1
View File
@@ -1 +1 @@
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["<div style='background-image: url(\"../share/images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n", " <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n", " <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n", " <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n", " <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Handling Station Metadata</div>\n", " </div>\n", " </div>\n", "</div>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Seismo-Live: http://seismo-live.org\n", "\n", "##### Authors:\n", "* Lion Krischer ([@krischer](https://github.com/krischer))\n", "* Tobias Megies ([@megies](https://github.com/megies))\n", "---"]}, {"cell_type": "markdown", "metadata": {}, "source": ["![](images/obspy_logo_full_524x179px.png)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "plt.style.use('ggplot')\n", "plt.rcParams['figure.figsize'] = 12, 8"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- for station metadata, the de-facto standard of the future (replacing SEED/RESP) is [FDSN StationXML](http://www.fdsn.org/xml/station/)\n", "- FDSN StationXML files can be read using **`read_inventory()`**"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from obspy import read_inventory\n", "# real-world StationXML files often deviate from the official schema definition\n", "# therefore file-format autodiscovery sometimes fails and we have to force the file format\n", "inventory = read_inventory(\"./data/station_PFO.xml\", format=\"STATIONXML\")\n", "print(type(inventory))"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- the nested ObsPy Inventory class structure (Inventory/Station/Channel/Response/...) is closely modelled after FDSN StationXML\n", "<img src=\"images/Inventory.svg\" width=90%>"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["!head data/station_BFO.xml"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["print(inventory)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["network = inventory[0]\n", "print(network)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["station = network[0]\n", "print(station)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["channel = station[0]\n", "print(channel)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["print(channel.response)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from obspy import read\n", "st = read(\"./data/waveform_PFO.mseed\")\n", "print(st)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["inv = read_inventory(\"./data/station_PFO.xml\", format=\"STATIONXML\")"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["print(st[0].stats)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- the instrument response can be deconvolved from the waveform data using the convenience method **`Stream.remove_response()`**\n", "- evalresp is used internally to calculate the instrument response"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["st.plot()\n", "st.remove_response(inventory=inv)\n", "st.plot()"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- several options can be used to specify details of the deconvolution (water level, frequency domain prefiltering), output units (velocity/displacement/acceleration), demeaning, tapering and to specify if any response stages should be omitted"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["st = read(\"./data/waveform_PFO.mseed\")\n", "st.remove_response(inventory=inv, water_level=60, pre_filt=(0.01, 0.02, 8, 10), output=\"DISP\")\n", "st.plot()"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- station metadata not present in StationXML yet but in Dataless SEED or RESP files can be used for instrument correction using the `.simulate()` method of Stream/Trace in a similar fashion"]}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}}, "nbformat": 4, "nbformat_minor": 2}
{"cells":[{"cell_type":"markdown","metadata":{},"source":["<div style='background-image: url(\"../images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n"," <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n"," <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n"," <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n"," <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Handling Station Metadata</div>\n"," </div>\n"," </div>\n","</div>"]},{"cell_type":"markdown","metadata":{},"source":["Seismo-Live: http://seismo-live.org\n","\n","##### Authors:\n","* Lion Krischer ([@krischer](https://github.com/krischer))\n","* Tobias Megies ([@megies](https://github.com/megies))\n","---"]},{"cell_type":"markdown","metadata":{},"source":["![](images/obspy_logo_full_524x179px.png)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["%matplotlib inline\n","import matplotlib.pyplot as plt\n","plt.style.use('ggplot')\n","plt.rcParams['figure.figsize'] = 12, 8"]},{"cell_type":"markdown","metadata":{},"source":["- for station metadata, the de-facto standard of the future (replacing SEED/RESP) is [FDSN StationXML](http://www.fdsn.org/xml/station/)\n","- FDSN StationXML files can be read using **`read_inventory()`**"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["from obspy import read_inventory\n","# real-world StationXML files often deviate from the official schema definition\n","# therefore file-format autodiscovery sometimes fails and we have to force the file format\n","inventory = read_inventory(\"./data/station_PFO.xml\", format=\"STATIONXML\")\n","print(type(inventory))"]},{"cell_type":"markdown","metadata":{},"source":["- the nested ObsPy Inventory class structure (Inventory/Station/Channel/Response/...) is closely modelled after FDSN StationXML\n","<img src=\"images/Inventory.svg\" width=90%>"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["!head data/station_BFO.xml"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["print(inventory)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["network = inventory[0]\n","print(network)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["station = network[0]\n","print(station)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["channel = station[0]\n","print(channel)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["print(channel.response)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["from obspy import read\n","st = read(\"./data/waveform_PFO.mseed\")\n","print(st)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["inv = read_inventory(\"./data/station_PFO.xml\", format=\"STATIONXML\")"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["print(st[0].stats)"]},{"cell_type":"markdown","metadata":{},"source":["- the instrument response can be deconvolved from the waveform data using the convenience method **`Stream.remove_response()`**\n","- evalresp is used internally to calculate the instrument response"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["st.plot()\n","st.remove_response(inventory=inv)\n","st.plot()"]},{"cell_type":"markdown","metadata":{},"source":["- several options can be used to specify details of the deconvolution (water level, frequency domain prefiltering), output units (velocity/displacement/acceleration), demeaning, tapering and to specify if any response stages should be omitted"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["st = read(\"./data/waveform_PFO.mseed\")\n","st.remove_response(inventory=inv, water_level=60, pre_filt=(0.01, 0.02, 8, 10), output=\"DISP\")\n","st.plot()"]},{"cell_type":"markdown","metadata":{},"source":["- station metadata not present in StationXML yet but in Dataless SEED or RESP files can be used for instrument correction using the `.simulate()` method of Stream/Trace in a similar fashion"]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"}},"nbformat":4,"nbformat_minor":2}
+1 -1
View File
@@ -1 +1 @@
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["<div style='background-image: url(\"../share/images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n", " <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n", " <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n", " <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n", " <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Handling Event Metadata</div>\n", " </div>\n", " </div>\n", "</div>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Seismo-Live: http://seismo-live.org\n", "\n", "##### Authors:\n", "* Lion Krischer ([@krischer](https://github.com/krischer))\n", "* Tobias Megies ([@megies](https://github.com/megies))\n", "---"]}, {"cell_type": "markdown", "metadata": {}, "source": ["![](images/obspy_logo_full_524x179px.png)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "plt.style.use('ggplot')\n", "plt.rcParams['figure.figsize'] = 12, 8"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- for event metadata, the de-facto standard is [QuakeML (an xml document structure)](https://quake.ethz.ch/quakeml/)\n", "- QuakeML files can be read using **`read_events()`**"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from obspy import read_events\n", "\n", "catalog = read_events(\"./data/event_tohoku_with_big_aftershocks.xml\")\n", "print(catalog)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- **`read_events()`** function returns a **`Catalog`** object, which is\n", "a collection of **`Event`** objects."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["print(type(catalog))\n", "print(type(catalog[0]))"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["event = catalog[0]\n", "print(event)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- Event objects are again collections of other resources.\n", "- the nested ObsPy Event class structure (Catalog/Event/Origin/Magnitude/FocalMechanism/...) is closely modelled after QuakeML\n", "<img src=\"images/Event.svg\" width=90%>"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["print(type(event.origins))\n", "print(type(event.origins[0]))\n", "print(event.origins[0])"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["print(type(event.magnitudes))\n", "print(type(event.magnitudes[0]))\n", "print(event.magnitudes[0])"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["# try event.<Tab> to get an idea what \"children\" elements event has"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- The Catalog object contains some convenience methods to make\n", "working with events easier.\n", "- for example, the included events can be filtered with various keys."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["largest_magnitude_events = catalog.filter(\"magnitude >= 7.8\")\n", "print(largest_magnitude_events)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- There is a basic preview plot using the matplotlib basemap module."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["catalog.plot(projection=\"local\");"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- a (modified) Catalog can be output to file (currently there is write support for QuakeML only)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["largest_magnitude_events.write(\"/tmp/large_events.xml\", format=\"QUAKEML\")\n", "!ls -l /tmp/large_events.xml"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- the event type classes can be used to build up Events/Catalogs/Picks/.. from scratch in custom processing work flows and to share them with other researchers in the de facto standard format QuakeML"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from obspy import UTCDateTime\n", "from obspy.core.event import Catalog, Event, Origin, Magnitude\n", "from obspy.geodetics import FlinnEngdahl\n", "\n", "cat = Catalog()\n", "cat.description = \"Just a fictitious toy example catalog built from scratch\"\n", "\n", "e = Event()\n", "e.event_type = \"not existing\"\n", "\n", "o = Origin()\n", "o.time = UTCDateTime(2014, 2, 23, 18, 0, 0)\n", "o.latitude = 47.6\n", "o.longitude = 12.0\n", "o.depth = 10000\n", "o.depth_type = \"operator assigned\"\n", "o.evaluation_mode = \Line truncated
{"cells":[{"cell_type":"markdown","metadata":{},"source":["<div style='background-image: url(\"../images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n"," <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n"," <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n"," <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n"," <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Handling Event Metadata</div>\n"," </div>\n"," </div>\n","</div>"]},{"cell_type":"markdown","metadata":{},"source":["Seismo-Live: http://seismo-live.org\n","\n","##### Authors:\n","* Lion Krischer ([@krischer](https://github.com/krischer))\n","* Tobias Megies ([@megies](https://github.com/megies))\n","---"]},{"cell_type":"markdown","metadata":{},"source":["![](images/obspy_logo_full_524x179px.png)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["%matplotlib inline\n","import matplotlib.pyplot as plt\n","plt.style.use('ggplot')\n","plt.rcParams['figure.figsize'] = 12, 8"]},{"cell_type":"markdown","metadata":{},"source":["- for event metadata, the de-facto standard is [QuakeML (an xml document structure)](https://quake.ethz.ch/quakeml/)\n","- QuakeML files can be read using **`read_events()`**"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["from obspy import read_events\n","\n","catalog = read_events(\"./data/event_tohoku_with_big_aftershocks.xml\")\n","print(catalog)"]},{"cell_type":"markdown","metadata":{},"source":["- **`read_events()`** function returns a **`Catalog`** object, which is\n","a collection of **`Event`** objects."]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["print(type(catalog))\n","print(type(catalog[0]))"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["event = catalog[0]\n","print(event)"]},{"cell_type":"markdown","metadata":{},"source":["- Event objects are again collections of other resources.\n","- the nested ObsPy Event class structure (Catalog/Event/Origin/Magnitude/FocalMechanism/...) is closely modelled after QuakeML\n","<img src=\"images/Event.svg\" width=90%>"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["print(type(event.origins))\n","print(type(event.origins[0]))\n","print(event.origins[0])"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["print(type(event.magnitudes))\n","print(type(event.magnitudes[0]))\n","print(event.magnitudes[0])"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# try event.<Tab> to get an idea what \"children\" elements event has"]},{"cell_type":"markdown","metadata":{},"source":["- The Catalog object contains some convenience methods to make\n","working with events easier.\n","- for example, the included events can be filtered with various keys."]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["largest_magnitude_events = catalog.filter(\"magnitude >= 7.8\")\n","print(largest_magnitude_events)"]},{"cell_type":"markdown","metadata":{},"source":["- There is a basic preview plot using the matplotlib basemap module."]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["catalog.plot(projection=\"local\");"]},{"cell_type":"markdown","metadata":{},"source":["- a (modified) Catalog can be output to file (currently there is write support for QuakeML only)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["largest_magnitude_events.write(\"/tmp/large_events.xml\", format=\"QUAKEML\")\n","!ls -l /tmp/large_events.xml"]},{"cell_type":"markdown","metadata":{},"source":["- the event type classes can be used to build up Events/Catalogs/Picks/.. from scratch in custom processing work flows and to share them with other researchers in the de facto standard format QuakeML"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["from obspy import UTCDateTime\n","from obspy.core.event import Catalog, Event, Origin, Magnitude\n","from obspy.geodetics import FlinnEngdahl\n","\n","cat = Catalog()\n","cat.description = \"Just a fictitious toy example catalog built from scratch\"\n","\n","e = Event()\n","e.event_type = \"not existing\"\n","\n","o = Origin()\n","o.time = UTCDateTime(2014, 2, 23, 18, 0, 0)\n","o.latitude = 47.6\n","o.longitude = 12.0\n","o.depth = 10000\n","o.depth_type = \"operator assigned\"\n","o.evaluation_mode = \"manual\"\n","o.evaluation_status = \"preliminary\"\n","o.region = FlinnEngdahl().get_region(o.longitude, o.latitude)\n","\n","m = Magnitude()\n","m.mag = 7.2\n","m.magnitude_type = \"Mw\"\n","\n","m2 = Magnitude()\n","m2.maLine truncated
+1 -1
View File
@@ -1 +1 @@
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["<div style='background-image: url(\"../share/images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n", " <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n", " <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n", " <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n", " <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Downloading Data</div>\n", " </div>\n", " </div>\n", "</div>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Seismo-Live: http://seismo-live.org\n", "\n", "##### Authors:\n", "* Lion Krischer ([@krischer](https://github.com/krischer))\n", "* Tobias Megies ([@megies](https://github.com/megies))\n", "---"]}, {"cell_type": "markdown", "metadata": {}, "source": ["![](images/obspy_logo_full_524x179px.png)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "plt.style.use('ggplot')\n", "plt.rcParams['figure.figsize'] = 12, 8"]}, {"cell_type": "markdown", "metadata": {}, "source": ["ObsPy has clients to directly fetch data via...\n", "\n", "- FDSN webservices (IRIS, Geofon/GFZ, USGS, NCEDC, SeisComp3 instances, ...)\n", "- ArcLink (EIDA, ...)\n", "- Earthworm\n", "- SeedLink (near-realtime servers)\n", "- NERIES/NERA/seismicportal.eu\n", "- NEIC\n", "- SeisHub (local seismological database)\n", "\n", "This introduction shows how to use the FDSN webservice client. The FDSN webservice definition is by now the default web service implemented by many data centers world wide. Clients for other protocols work similar to the FDSN client.\n", "\n", "#### Waveform Data"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from obspy import UTCDateTime\n", "from obspy.clients.fdsn import Client\n", "\n", "client = Client(\"IRIS\")\n", "t = UTCDateTime(\"2011-03-11T05:46:23\") # Tohoku\n", "st = client.get_waveforms(\"II\", \"PFO\", \"*\", \"LHZ\",\n", " t + 10 * 60, t + 30 * 60)\n", "print(st)\n", "st.plot()"]}, {"cell_type": "markdown", "metadata": {}, "source": ["- again, waveform data is returned as a Stream object\n", "- for all custom processing workflows it does not matter if the data originates from a local file or from a web service\n", "\n", "#### Event Metadata\n", "\n", "The FDSN client can also be used to request event metadata:"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["t = UTCDateTime(\"2011-03-11T05:46:23\") # Tohoku\n", "catalog = client.get_events(starttime=t - 100, endtime=t + 24 * 3600,\n", " minmagnitude=7)\n", "print(catalog)\n", "catalog.plot();"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Requests can have a wide range of constraints (see [ObsPy Documentation](http://docs.obspy.org/packages/autogen/obspy.fdsn.client.Client.get_events.html)):\n", "\n", "- time range\n", "- geographical (lonlat-box, circular by distance)\n", "- depth range\n", "- magnitude range, type\n", "- contributing agency"]}, {"cell_type": "markdown", "metadata": {}, "source": ["#### Station Metadata\n", "\n", "Finally, the FDSN client can be used to request station metadata. Stations can be looked up using a wide range of constraints (see [ObsPy documentation](http://docs.obspy.org/packages/autogen/obspy.fdsn.client.Client.get_stations.html)):\n", "\n", " * network/station code\n", " * time range of operation\n", " * geographical (lonlat-box, circular by distance)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["event = catalog[0]\n", "origin = event.origins[0]\n", "\n", "# M\u00fcnster\n", "lon = 7.63\n", "lat = 51.96\n", "\n", "inventory = client.get_stations(longitude=lon, latitude=lat,\n", " maxradius=2.5, level=\"station\")\n", "print(inventory)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["The **`level=...`** keyword is used to specify the level of detail in the requested inventory\n", "\n", "- `\"network\"`: only return information on networks matching the criteria\n", "- `\"station\"`: return information on all matching stations\n", "- `\"channel\"`: return information on available channels in all stations networks matching the criteria\n", "- `\"response\"`: include instrument response for all matching channels (large result data size!)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["inventory = client.get_stations(network=\"OE\", station=\"DAVA\",\n", " level=\"station\")\n", "print(inventory)"]}, {"cell_type": "cLine truncated
{"cells":[{"cell_type":"markdown","metadata":{},"source":["<div style='background-image: url(\"../images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n"," <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n"," <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n"," <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n"," <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Downloading Data</div>\n"," </div>\n"," </div>\n","</div>"]},{"cell_type":"markdown","metadata":{},"source":["Seismo-Live: http://seismo-live.org\n","\n","##### Authors:\n","* Lion Krischer ([@krischer](https://github.com/krischer))\n","* Tobias Megies ([@megies](https://github.com/megies))\n","---"]},{"cell_type":"markdown","metadata":{},"source":["![](images/obspy_logo_full_524x179px.png)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["%matplotlib inline\n","import matplotlib.pyplot as plt\n","plt.style.use('ggplot')\n","plt.rcParams['figure.figsize'] = 12, 8"]},{"cell_type":"markdown","metadata":{},"source":["ObsPy has clients to directly fetch data via...\n","\n","- FDSN webservices (IRIS, Geofon/GFZ, USGS, NCEDC, SeisComp3 instances, ...)\n","- ArcLink (EIDA, ...)\n","- Earthworm\n","- SeedLink (near-realtime servers)\n","- NERIES/NERA/seismicportal.eu\n","- NEIC\n","- SeisHub (local seismological database)\n","\n","This introduction shows how to use the FDSN webservice client. The FDSN webservice definition is by now the default web service implemented by many data centers world wide. Clients for other protocols work similar to the FDSN client.\n","\n","#### Waveform Data"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["from obspy import UTCDateTime\n","from obspy.clients.fdsn import Client\n","\n","client = Client(\"IRIS\")\n","t = UTCDateTime(\"2011-03-11T05:46:23\") # Tohoku\n","st = client.get_waveforms(\"II\", \"PFO\", \"*\", \"LHZ\",\n"," t + 10 * 60, t + 30 * 60)\n","print(st)\n","st.plot()"]},{"cell_type":"markdown","metadata":{},"source":["- again, waveform data is returned as a Stream object\n","- for all custom processing workflows it does not matter if the data originates from a local file or from a web service\n","\n","#### Event Metadata\n","\n","The FDSN client can also be used to request event metadata:"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["t = UTCDateTime(\"2011-03-11T05:46:23\") # Tohoku\n","catalog = client.get_events(starttime=t - 100, endtime=t + 24 * 3600,\n"," minmagnitude=7)\n","print(catalog)\n","catalog.plot();"]},{"cell_type":"markdown","metadata":{},"source":["Requests can have a wide range of constraints (see [ObsPy Documentation](http://docs.obspy.org/packages/autogen/obspy.fdsn.client.Client.get_events.html)):\n","\n","- time range\n","- geographical (lonlat-box, circular by distance)\n","- depth range\n","- magnitude range, type\n","- contributing agency"]},{"cell_type":"markdown","metadata":{},"source":["#### Station Metadata\n","\n","Finally, the FDSN client can be used to request station metadata. Stations can be looked up using a wide range of constraints (see [ObsPy documentation](http://docs.obspy.org/packages/autogen/obspy.fdsn.client.Client.get_stations.html)):\n","\n"," * network/station code\n"," * time range of operation\n"," * geographical (lonlat-box, circular by distance)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["event = catalog[0]\n","origin = event.origins[0]\n","\n","# Münster\n","lon = 7.63\n","lat = 51.96\n","\n","inventory = client.get_stations(longitude=lon, latitude=lat,\n"," maxradius=2.5, level=\"station\")\n","print(inventory)"]},{"cell_type":"markdown","metadata":{},"source":["The **`level=...`** keyword is used to specify the level of detail in the requested inventory\n","\n","- `\"network\"`: only return information on networks matching the criteria\n","- `\"station\"`: return information on all matching stations\n","- `\"channel\"`: return information on available channels in all stations networks matching the criteria\n","- `\"response\"`: include instrument response for all matching channels (large result data size!)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["inventory = client.get_stations(network=\"OE\", station=\"DAVA\",\n"," level=\"station\")\n","print(inventory)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["inventory = client.get_stations(network=\"OE\", station=\"DAVA\",\n"," level=\"channeLine truncated
+1 -1
View File
@@ -1 +1 @@
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["<div style='background-image: url(\"../share/images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n", " <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n", " <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n", " <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n", " <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Downloading/Processing Exercise</div>\n", " </div>\n", " </div>\n", "</div>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Seismo-Live: http://seismo-live.org\n", "\n", "##### Authors:\n", "* Lion Krischer ([@krischer](https://github.com/krischer))\n", "* Tobias Megies ([@megies](https://github.com/megies))\n", "---"]}, {"cell_type": "markdown", "metadata": {}, "source": ["![](images/obspy_logo_full_524x179px.png)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["For the this exercise we will download some data from the Tohoku-Oki earthquake, cut out a certain time window around the first arrival and remove the instrument response from the data."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "plt.style.use('ggplot')\n", "plt.rcParams['figure.figsize'] = 12, 8"]}, {"cell_type": "markdown", "metadata": {}, "source": ["The first step is to download all the necessary information using the ObsPy FDSN client. **Learn to read the documentation!**\n", "\n", "We need the following things:\n", "\n", "1. Event information about the Tohoku-Oki earthquake. Use the `get_events()` method of the client. A good provider of event data is the USGS.\n", "2. Waveform information for a certain station. Choose your favorite one! If you have no preference, use `II.BFO` which is available for example from IRIS. Use the `get_waveforms()` method.\n", "3. Download the associated station/instrument information with the `get_stations()` method."]}, {"cell_type": "code", "execution_count": null, "metadata": {"lines_to_next_cell": 2, "tags": ["exercise"]}, "outputs": [], "source": []}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["solution"]}, "outputs": [], "source": []}, {"cell_type": "markdown", "metadata": {}, "source": ["Have a look at the just downloaded data."]}, {"cell_type": "code", "execution_count": null, "metadata": {"lines_to_next_cell": 2, "tags": ["exercise"]}, "outputs": [], "source": []}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["solution"]}, "outputs": [], "source": []}, {"cell_type": "markdown", "metadata": {}, "source": ["## Exercise\n", "\n", "The goal of this exercise is to cut the data from 1 minute before the first arrival to 5 minutes after it, and then remove the instrument response.\n", "\n", "\n", "#### Step 1: Determine Coordinates of Station"]}, {"cell_type": "code", "execution_count": null, "metadata": {"lines_to_next_cell": 2, "tags": ["exercise"]}, "outputs": [], "source": []}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["solution"]}, "outputs": [], "source": []}, {"cell_type": "markdown", "metadata": {}, "source": ["#### Step 2: Determine Coordinates of Event"]}, {"cell_type": "code", "execution_count": null, "metadata": {"lines_to_next_cell": 2, "tags": ["exercise"]}, "outputs": [], "source": []}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["solution"]}, "outputs": [], "source": []}, {"cell_type": "markdown", "metadata": {}, "source": ["#### Step 3: Calculate distance of event and station.\n", "\n", "Use `obspy.geodetics.locations2degree`."]}, {"cell_type": "code", "execution_count": null, "metadata": {"lines_to_next_cell": 2, "tags": ["exercise"]}, "outputs": [], "source": []}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["solution"]}, "outputs": [], "source": []}, {"cell_type": "markdown", "metadata": {}, "source": ["#### Step 4: Calculate Theoretical Arrivals\n", "\n", "```python\n", "from obspy.taup import TauPyModel\n", "m = TauPyModel(model=\"ak135\")\n", "arrivals = m.get_ray_paths(...)\n", "arrivals.plot()\n", "```"]}, {"cell_type": "code", "execution_count": null, "metadata": {"lines_to_next_cell": 2, "tags": ["exercise"]}, "outputs": [], "source": []}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["solution"]}, "outputs": [], "source": []}, {"cell_type": "markdown", "metadata": {}, "source": ["#### Step 5: Calculate absolute time of the first arrivals at the station"]}, {"cell_type": "code", "execution_count": null, "metadata": {"lines_to_next_cell": 2, "tags": ["exercise"]}, "outputs": [], "source": []}, {"cell_type": "code", "execution_count":Line truncated
{"cells":[{"cell_type":"markdown","metadata":{},"source":["<div style='background-image: url(\"../images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n"," <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n"," <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n"," <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n"," <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Downloading/Processing Exercise</div>\n"," </div>\n"," </div>\n","</div>"]},{"cell_type":"markdown","metadata":{},"source":["Seismo-Live: http://seismo-live.org\n","\n","##### Authors:\n","* Lion Krischer ([@krischer](https://github.com/krischer))\n","* Tobias Megies ([@megies](https://github.com/megies))\n","---"]},{"cell_type":"markdown","metadata":{},"source":["![](images/obspy_logo_full_524x179px.png)"]},{"cell_type":"markdown","metadata":{},"source":["For the this exercise we will download some data from the Tohoku-Oki earthquake, cut out a certain time window around the first arrival and remove the instrument response from the data."]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["%matplotlib inline\n","import matplotlib.pyplot as plt\n","plt.style.use('ggplot')\n","plt.rcParams['figure.figsize'] = 12, 8"]},{"cell_type":"markdown","metadata":{},"source":["The first step is to download all the necessary information using the ObsPy FDSN client. **Learn to read the documentation!**\n","\n","We need the following things:\n","\n","1. Event information about the Tohoku-Oki earthquake. Use the `get_events()` method of the client. A good provider of event data is the USGS.\n","2. Waveform information for a certain station. Choose your favorite one! If you have no preference, use `II.BFO` which is available for example from IRIS. Use the `get_waveforms()` method.\n","3. Download the associated station/instrument information with the `get_stations()` method."]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":["exercise"]},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"tags":["solution"]},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["Have a look at the just downloaded data."]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":["exercise"]},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"tags":["solution"]},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["## Exercise\n","\n","The goal of this exercise is to cut the data from 1 minute before the first arrival to 5 minutes after it, and then remove the instrument response.\n","\n","\n","#### Step 1: Determine Coordinates of Station"]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":["exercise"]},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"tags":["solution"]},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["#### Step 2: Determine Coordinates of Event"]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":["exercise"]},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"tags":["solution"]},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["#### Step 3: Calculate distance of event and station.\n","\n","Use `obspy.geodetics.locations2degree`."]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":["exercise"]},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"tags":["solution"]},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["#### Step 4: Calculate Theoretical Arrivals\n","\n","```python\n","from obspy.taup import TauPyModel\n","m = TauPyModel(model=\"ak135\")\n","arrivals = m.get_ray_paths(...)\n","arrivals.plot()\n","```"]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":["exercise"]},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"tags":["solution"]},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["#### Step 5: Calculate absolute time of the first arrivals at the station"]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":["exercise"]},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"tags":["solution"]},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["#### Step 6: Cut to 1 minute before and 5 minutes after the first arrival"]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":[Line truncated
@@ -1 +1 @@
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["<div style='background-image: url(\"../share/images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n", " <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n", " <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n", " <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n", " <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Exercise: Event Detection and Magnitude Estimation in an Aftershock Series</div>\n", " </div>\n", " </div>\n", "</div>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Seismo-Live: http://seismo-live.org\n", "\n", "##### Authors:\n", "* Tobias Megies ([@megies](https://github.com/megies))\n", "* Lion Krischer ([@krischer](https://github.com/krischer))\n", "---"]}, {"cell_type": "markdown", "metadata": {}, "source": ["![](images/obspy_logo_full_524x179px.png)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["# Exercise -- The 2008 Mt. Carmel, Illinois, Earthquake and Aftershock Series\n", "\n", "Introduction from \n", "[\"The April 18, 2008 Illinois Earthquake: An ANSS Monitoring Success\" by Robert B. Herrmann, Mitch Withers, and Harley Benz, SRL 2008](http://srl.geoscienceworld.org/content/79/6/830.extract):\n", "\n", "*\"The largest-magnitude earthquake in the past 20 years struck near **Mt. Carmel in southeastern Illinois** on Friday morning, 18 April 2008 at 09:36:59 UTC (04:37 CDT). **The Mw 5.2 earthquake was felt over an area that spanned Chicago and Atlanta**, with about 40,000 reports submitted to the U.S. Geological Survey (USGS) \u201cDid You Feel It?\u201d system. There were at least six felt aftershocks greater than magnitude 3 and 20 aftershocks with magnitudes greater than 2 located by regional and national seismic networks. **Portable instrumentation was deployed** by researchers of the University of Memphis and Indiana University (the first portable station was installed at about 23:00 UTC on 18 April). The portable seismographs were deployed both to capture near-source, high-frequency ground motions for significant aftershocks and to better understand structure along the active fault. [...]\"*\n", "\n", "<img src=\"http://earthquake.usgs.gov/images/globes/40_-90.jpg\" alt=\"World map\" style=\"width: 250px;\"/>\n", "<img src=\"http://earthquake.usgs.gov/earthquakes/dyfi/events/us/2008qza6/us/us2008qza6_ciim_zoomout.jpg\" alt=\"Felt report map\" style=\"width: 700px;\"/>\n", "\n", "Web page hits at USGS/NEIC during 24 hours after the earthquake:\n", "\n", " - peak rate: **3,892 hits/second**\n", " - **68 million hits** in the 24 hours after the earthquake\n", "\n", "<img src=\"http://www.geophysik.uni-muenchen.de/~megies/.iris/.mtcarmel_figure1.jpg\" alt=\"USGS/NEIC web page hits\" style=\"width: 500px;\"/>\n", "\n", "Some links:\n", "\n", " - http://earthquake.usgs.gov/earthquakes/dyfi/events/us/2008qza6/us/index.html\n", " - http://earthquake.usgs.gov/earthquakes/eqinthenews/2008/us2008qza6/#summary\n", " - http://srl.geoscienceworld.org/content/79/6/830.extract\n", " - http://srl.geoscienceworld.org/content/82/5/735.short"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["%matplotlib inline"]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Use the search on the [ObsPy docs](http://docs.obspy.org/) for any functionality that you do not remember/know yet..!\n", "### E.g. [searching for \"filter\"](http://docs.obspy.org/search.html?q=filter)..."]}, {"cell_type": "markdown", "metadata": {}, "source": ["## 1. Download and visualize main shock\n", "\n", "Request information on stations recording close to the event from IRIS using the [`obspy.fdsn Client`](http://docs.obspy.org/packages/obspy.fdsn.html), print the requested station information."]}, {"cell_type": "code", "execution_count": null, "metadata": {"lines_to_next_cell": 2, "tags": ["exercise"]}, "outputs": [], "source": []}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["solution"]}, "outputs": [], "source": []}, {"cell_type": "markdown", "metadata": {}, "source": ["Download waveform data for the mainshock for one of the stations using the FDSN client (if you get an error, maybe try a different station and/or ask for help). Make the preview plot using obspy."]}, {"cell_type": "code", "execution_count": null, "metadata": {"lines_to_next_cell": 2, "tags": ["exercise"]}, "outputs": [], "source": []}, {"cell_type": "code", "execution_count": null, "metadata": {"tags": ["solution"]}, "outputs": [], "source": []}, {"cell_type": "markdown", "metadata": {}, "source": ["Visualize a Spectrogram (if you got time, you can play around with the different parameters for the speLine truncated
{"cells":[{"cell_type":"markdown","metadata":{},"source":["<div style='background-image: url(\"../images/header.svg\") ; padding: 0px ; background-size: cover ; border-radius: 5px ; height: 250px'>\n"," <div style=\"float: right ; margin: 50px ; padding: 20px ; background: rgba(255 , 255 , 255 , 0.7) ; width: 50% ; height: 150px\">\n"," <div style=\"position: relative ; top: 50% ; transform: translatey(-50%)\">\n"," <div style=\"font-size: xx-large ; font-weight: 900 ; color: rgba(0 , 0 , 0 , 0.8) ; line-height: 100%\">ObsPy Tutorial</div>\n"," <div style=\"font-size: large ; padding-top: 20px ; color: rgba(0 , 0 , 0 , 0.5)\">Exercise: Event Detection and Magnitude Estimation in an Aftershock Series</div>\n"," </div>\n"," </div>\n","</div>"]},{"cell_type":"markdown","metadata":{},"source":["Seismo-Live: http://seismo-live.org\n","\n","##### Authors:\n","* Tobias Megies ([@megies](https://github.com/megies))\n","* Lion Krischer ([@krischer](https://github.com/krischer))\n","---"]},{"cell_type":"markdown","metadata":{},"source":["![](images/obspy_logo_full_524x179px.png)"]},{"cell_type":"markdown","metadata":{},"source":["# Exercise -- The 2008 Mt. Carmel, Illinois, Earthquake and Aftershock Series\n","\n","Introduction from \n","[\"The April 18, 2008 Illinois Earthquake: An ANSS Monitoring Success\" by Robert B. Herrmann, Mitch Withers, and Harley Benz, SRL 2008](http://srl.geoscienceworld.org/content/79/6/830.extract):\n","\n","*\"The largest-magnitude earthquake in the past 20 years struck near **Mt. Carmel in southeastern Illinois** on Friday morning, 18 April 2008 at 09:36:59 UTC (04:37 CDT). **The Mw 5.2 earthquake was felt over an area that spanned Chicago and Atlanta**, with about 40,000 reports submitted to the U.S. Geological Survey (USGS) “Did You Feel It?” system. There were at least six felt aftershocks greater than magnitude 3 and 20 aftershocks with magnitudes greater than 2 located by regional and national seismic networks. **Portable instrumentation was deployed** by researchers of the University of Memphis and Indiana University (the first portable station was installed at about 23:00 UTC on 18 April). The portable seismographs were deployed both to capture near-source, high-frequency ground motions for significant aftershocks and to better understand structure along the active fault. [...]\"*\n","\n","<img src=\"http://earthquake.usgs.gov/images/globes/40_-90.jpg\" alt=\"World map\" style=\"width: 250px;\"/>\n","<img src=\"http://earthquake.usgs.gov/earthquakes/dyfi/events/us/2008qza6/us/us2008qza6_ciim_zoomout.jpg\" alt=\"Felt report map\" style=\"width: 700px;\"/>\n","\n","Web page hits at USGS/NEIC during 24 hours after the earthquake:\n","\n"," - peak rate: **3,892 hits/second**\n"," - **68 million hits** in the 24 hours after the earthquake\n","\n","<img src=\"http://www.geophysik.uni-muenchen.de/~megies/.iris/.mtcarmel_figure1.jpg\" alt=\"USGS/NEIC web page hits\" style=\"width: 500px;\"/>\n","\n","Some links:\n","\n"," - http://earthquake.usgs.gov/earthquakes/dyfi/events/us/2008qza6/us/index.html\n"," - http://earthquake.usgs.gov/earthquakes/eqinthenews/2008/us2008qza6/#summary\n"," - http://srl.geoscienceworld.org/content/79/6/830.extract\n"," - http://srl.geoscienceworld.org/content/82/5/735.short"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["%matplotlib inline"]},{"cell_type":"markdown","metadata":{},"source":["### Use the search on the [ObsPy docs](http://docs.obspy.org/) for any functionality that you do not remember/know yet..!\n","### E.g. [searching for \"filter\"](http://docs.obspy.org/search.html?q=filter)..."]},{"cell_type":"markdown","metadata":{},"source":["## 1. Download and visualize main shock\n","\n","Request information on stations recording close to the event from IRIS using the [`obspy.fdsn Client`](http://docs.obspy.org/packages/obspy.fdsn.html), print the requested station information."]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":["exercise"]},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"tags":["solution"]},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["Download waveform data for the mainshock for one of the stations using the FDSN client (if you get an error, maybe try a different station and/or ask for help). Make the preview plot using obspy."]},{"cell_type":"code","execution_count":null,"metadata":{"lines_to_next_cell":2,"tags":["exercise"]},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"tags":["solution"]},"outputs":[],"source":[]},{"cell_type":"markdown","metadata":{},"source":["Visualize a Spectrogram (if you got time, you can play around with the different parameters for the spectrogram). Working on a copy of the donwloaded data, apply a filter, then trim the requested data to some interesting parts of the earthquake and plot the Line truncated