From 7b7f84fd913cfdef8a81ca71d7bc4a296028072e Mon Sep 17 00:00:00 2001 From: Stephen Hicks Date: Fri, 15 May 2020 20:42:59 +0100 Subject: [PATCH 1/4] savediskspace --- SeismoSocialDistancing.ipynb | 89 +++++++++++++++--- .../seismosocialdistancing.cpython-37.pyc | Bin 0 -> 27041 bytes 2 files changed, 78 insertions(+), 11 deletions(-) create mode 100644 __pycache__/seismosocialdistancing.cpython-37.pyc diff --git a/SeismoSocialDistancing.ipynb b/SeismoSocialDistancing.ipynb index 95cc3ec..6965156 100644 --- a/SeismoSocialDistancing.ipynb +++ b/SeismoSocialDistancing.ipynb @@ -31,14 +31,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": { "ExecuteTime": { "end_time": "2020-05-08T06:46:13.572490Z", "start_time": "2020-05-08T06:45:59.783138Z" } }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The autoreload extension is already loaded. To reload it, use:\n", + " %reload_ext autoreload\n" + ] + } + ], "source": [ "import datetime\n", "import os\n", @@ -75,7 +84,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": { "ExecuteTime": { "end_time": "2020-05-08T06:46:14.089189Z", @@ -89,15 +98,15 @@ "# Leaving UTCDateTime() empty means \"now\":\n", "end = UTCDateTime(\"2020-05-01\")\n", "\n", - "network = \"BE\"\n", - "station = \"UCC\"\n", + "network = \"GB\"\n", + "station = \"EDI\"\n", "location = \"\"\n", - "channel = \"HHZ\"\n", + "channel = \"BHZ\"\n", "dataset = \"example\"\n", "time_zone = \"Europe/Brussels\"\n", "sitedesc = \"in Uccle (Brussels, BE)\"\n", "\n", - "data_provider = \"ODC\"\n", + "data_provider = \"IRIS\"\n", "logo = None # 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Logo_SED_2014.png/220px-Logo_SED_2014.png'\n", "bans = {\"2020-03-15 00:00\":'Restaurants/Bars/Schools closed', \n", " \"2020-03-18 12:00\":'Non-essential shops closed'}\n", @@ -118,7 +127,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": { "ExecuteTime": { "end_time": "2020-05-08T06:46:17.701310Z", @@ -126,7 +135,61 @@ }, "scrolled": false }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Fetching example_2020-02-03_GB.EDI..BHZ.mseed: 0%| | 0/30 [00:00\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 19\u001b[0m st = c.get_waveforms(network, station, location, channel,\n\u001b[1;32m 20\u001b[0m \u001b[0mUTCDateTime\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mday\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1801\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mUTCDateTime\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mday\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m86400\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m1801\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 21\u001b[0;31m attach_response=True)\n\u001b[0m\u001b[1;32m 22\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mFDSNNoDataException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 23\u001b[0m \u001b[0mpbar\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset_description\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"No data on FDSN server for %s\"\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/site-packages/obspy/clients/fdsn/client.py\u001b[0m in \u001b[0;36mget_waveforms\u001b[0;34m(self, network, station, location, channel, starttime, endtime, quality, minimumlength, longestonly, filename, attach_response, **kwargs)\u001b[0m\n\u001b[1;32m 842\u001b[0m \u001b[0;31m# Gzip not worth it for MiniSEED and most likely disabled for this\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 843\u001b[0m \u001b[0;31m# route in any case.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 844\u001b[0;31m \u001b[0mdata_stream\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_download\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0muse_gzip\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 845\u001b[0m \u001b[0mdata_stream\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mseek\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 846\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mfilename\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/site-packages/obspy/clients/fdsn/client.py\u001b[0m in \u001b[0;36m_download\u001b[0;34m(self, url, return_string, data, use_gzip)\u001b[0m\n\u001b[1;32m 1394\u001b[0m \u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mopener\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_url_opener\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mheaders\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest_headers\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1395\u001b[0m \u001b[0mdebug\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdebug\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreturn_string\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mreturn_string\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1396\u001b[0;31m timeout=self.timeout, use_gzip=use_gzip)\n\u001b[0m\u001b[1;32m 1397\u001b[0m \u001b[0mraise_on_error\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcode\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1398\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/site-packages/obspy/clients/fdsn/client.py\u001b[0m in \u001b[0;36mdownload_url\u001b[0;34m(url, opener, timeout, headers, debug, return_string, data, use_gzip)\u001b[0m\n\u001b[1;32m 1815\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1816\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mreturn_string\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1817\u001b[0;31m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mBytesIO\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1818\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1819\u001b[0m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/http/client.py\u001b[0m in \u001b[0;36mread\u001b[0;34m(self, amt)\u001b[0m\n\u001b[1;32m 452\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 453\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchunked\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 454\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_readall_chunked\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 455\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 456\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlength\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/http/client.py\u001b[0m in \u001b[0;36m_readall_chunked\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 562\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mchunk_left\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 563\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 564\u001b[0;31m \u001b[0mvalue\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_safe_read\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchunk_left\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 565\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchunk_left\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 566\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0;34mb''\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvalue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/http/client.py\u001b[0m in \u001b[0;36m_safe_read\u001b[0;34m(self, amt)\u001b[0m\n\u001b[1;32m 608\u001b[0m \u001b[0ms\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 609\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0mamt\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 610\u001b[0;31m \u001b[0mchunk\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mamt\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mMAXAMOUNT\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 611\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 612\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mIncompleteRead\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mb''\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mamt\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/socket.py\u001b[0m in \u001b[0;36mreadinto\u001b[0;34m(self, b)\u001b[0m\n\u001b[1;32m 587\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 588\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 589\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_sock\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv_into\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 590\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 591\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_timeout_occurred\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + } + ], "source": [ "c = Client(data_provider)\n", "\n", @@ -137,11 +200,15 @@ "for day in pbar:\n", " datestr = day.strftime(\"%Y-%m-%d\")\n", " fn = \"{}_{}_{}.mseed\".format(dataset, datestr, nslc)\n", - " if day != UTCDateTime().datetime and os.path.isfile(fn):\n", + " mseedid = \"{:}.{:}.{:}.{:}\".format(network, station, location, channel)\n", + " fn_npz = \"{}_{}_{}.npz\".format(dataset, datestr, mseedid)\n", + " if day != UTCDateTime().datetime and (os.path.isfile(fn) or os.path.isfile(fn_npz)):\n", + " pbar.set_description(\"Either mSEED or .npz already exists ... skipping date %s\" % fn)\n", " continue\n", " else:\n", " pbar.set_description(\"Fetching %s\" % fn)\n", " try: \n", + " print(datestr)\n", " st = c.get_waveforms(network, station, location, channel,\n", " UTCDateTime(day)-1801, UTCDateTime(day)+86400+1801,\n", " attach_response=True)\n", @@ -480,7 +547,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.7.3" } }, "nbformat": 4, diff --git a/__pycache__/seismosocialdistancing.cpython-37.pyc b/__pycache__/seismosocialdistancing.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b1e10566ca249eba4fa1d30f33cb3dfc801f9504 GIT binary patch literal 27041 zcmeHwdvqMvdEd1l~9i5By{PtaqPrS7K!5~ZI7Gwv^h;rhzrSG-;2UOw-hDb5bL993^!V zSIwip-@UUBfRGi}r~NAn&Ye5=`Q6udzt_Dy+tHCQ@cV_Yeer|$e%vtrD?jSL9(YdU zalR2Y3}FbfXe^m&)1==jT4_tYL+OwR*;XMe!Y6c0Bpp#P(R56`P&YAaa~K@>7KyfyVRHN3;g{{JJJJze=t3$@(-nl)O$ERY!4T9 zikOItwtH53_n=RsEJ)-H+*}=y4WL9@a+?O#Xj-S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Jzzq#7*-o z9mS}(X7O6%HG3uB0GR$jYd#>Xz)0S2Cw2%vv>lORMNhJ>IIY2zId}VY_-<$mZ^bp? z?%i1){Lv?x?<2Lo$Y+qgIXb^ihpeW)3G1u;q$P=FjmQdUUNy@I5?g*8HZ%ej<-+gMn)>C;f=p+0=aU+i^9no57xrD=LByeOIpE9mLE@+=t8CbDOgj z*RW!Bq@((B41ImU2idrzbRMU(-7J2$xvOXHmPv~Rg6p5yc3goGY&IR9~LZ zcbL(t&v4#CjwINcMDRZkBtzXe^soN#{}S-8Gur)OBNGoL_SA15BU{6Z0xUE63Q5yM zD$&8)Z&k=k4d3NnD;`dC$0Lcb&RMs9Zzx~<+=JVtAK9jDnh*3P=NxC&AW zdA5W;HDp+ZWFOczhSgXIJBsokKr*k_1m3X+RVXTi7q NAA7qV!?Lyi{{XkIeGmWu literal 0 HcmV?d00001 From 8e8b498a15335435ec457f787e34430a61c4e48a Mon Sep 17 00:00:00 2001 From: Stephen Hicks Date: Fri, 15 May 2020 20:58:42 +0100 Subject: [PATCH 2/4] savediskspace_multicpu --- SeismoSocialDistancing.ipynb | 289 ++++++++++++++++++++++++++--------- 1 file changed, 214 insertions(+), 75 deletions(-) diff --git a/SeismoSocialDistancing.ipynb b/SeismoSocialDistancing.ipynb index 6965156..9928edc 100644 --- a/SeismoSocialDistancing.ipynb +++ b/SeismoSocialDistancing.ipynb @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 16, "metadata": { "ExecuteTime": { "end_time": "2020-05-08T06:46:13.572490Z", @@ -62,6 +62,7 @@ "import pandas as pd\n", "import tqdm\n", "import warnings\n", + "import multiprocessing\n", "\n", "from obspy import UTCDateTime, read\n", "from obspy.clients.fdsn import Client\n", @@ -84,7 +85,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 25, "metadata": { "ExecuteTime": { "end_time": "2020-05-08T06:46:14.089189Z", @@ -98,15 +99,15 @@ "# Leaving UTCDateTime() empty means \"now\":\n", "end = UTCDateTime(\"2020-05-01\")\n", "\n", - "network = \"GB\"\n", - "station = \"EDI\"\n", + "network = \"BE\"\n", + "station = \"UCC\"\n", "location = \"\"\n", - "channel = \"BHZ\"\n", + "channel = \"HHZ\"\n", "dataset = \"example\"\n", "time_zone = \"Europe/Brussels\"\n", "sitedesc = \"in Uccle (Brussels, BE)\"\n", "\n", - "data_provider = \"IRIS\"\n", + "data_provider = \"ODC\"\n", "logo = None # 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Logo_SED_2014.png/220px-Logo_SED_2014.png'\n", "bans = {\"2020-03-15 00:00\":'Restaurants/Bars/Schools closed', \n", " \"2020-03-18 12:00\":'Non-essential shops closed'}\n", @@ -127,7 +128,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 26, "metadata": { "ExecuteTime": { "end_time": "2020-05-08T06:46:17.701310Z", @@ -140,53 +141,24 @@ "name": "stderr", "output_type": "stream", "text": [ - "Fetching example_2020-02-03_GB.EDI..BHZ.mseed: 0%| | 0/30 [00:00\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 19\u001b[0m st = c.get_waveforms(network, station, location, channel,\n\u001b[1;32m 20\u001b[0m \u001b[0mUTCDateTime\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mday\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1801\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mUTCDateTime\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mday\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m86400\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m1801\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 21\u001b[0;31m attach_response=True)\n\u001b[0m\u001b[1;32m 22\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mFDSNNoDataException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 23\u001b[0m \u001b[0mpbar\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset_description\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"No data on FDSN server for %s\"\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/site-packages/obspy/clients/fdsn/client.py\u001b[0m in \u001b[0;36mget_waveforms\u001b[0;34m(self, network, station, location, channel, starttime, endtime, quality, minimumlength, longestonly, filename, attach_response, **kwargs)\u001b[0m\n\u001b[1;32m 842\u001b[0m \u001b[0;31m# Gzip not worth it for MiniSEED and most likely disabled for this\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 843\u001b[0m \u001b[0;31m# route in any case.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 844\u001b[0;31m \u001b[0mdata_stream\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_download\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0muse_gzip\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 845\u001b[0m \u001b[0mdata_stream\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mseek\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 846\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mfilename\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/site-packages/obspy/clients/fdsn/client.py\u001b[0m in \u001b[0;36m_download\u001b[0;34m(self, url, return_string, data, use_gzip)\u001b[0m\n\u001b[1;32m 1394\u001b[0m \u001b[0murl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mopener\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_url_opener\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mheaders\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest_headers\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1395\u001b[0m \u001b[0mdebug\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdebug\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreturn_string\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mreturn_string\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1396\u001b[0;31m timeout=self.timeout, use_gzip=use_gzip)\n\u001b[0m\u001b[1;32m 1397\u001b[0m \u001b[0mraise_on_error\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcode\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1398\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/site-packages/obspy/clients/fdsn/client.py\u001b[0m in \u001b[0;36mdownload_url\u001b[0;34m(url, opener, timeout, headers, debug, return_string, data, use_gzip)\u001b[0m\n\u001b[1;32m 1815\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1816\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mreturn_string\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1817\u001b[0;31m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mio\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mBytesIO\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1818\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1819\u001b[0m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/http/client.py\u001b[0m in \u001b[0;36mread\u001b[0;34m(self, amt)\u001b[0m\n\u001b[1;32m 452\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 453\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchunked\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 454\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_readall_chunked\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 455\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 456\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlength\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/http/client.py\u001b[0m in \u001b[0;36m_readall_chunked\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 562\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mchunk_left\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 563\u001b[0m \u001b[0;32mbreak\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 564\u001b[0;31m \u001b[0mvalue\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_safe_read\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mchunk_left\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 565\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mchunk_left\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 566\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0;34mb''\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvalue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/http/client.py\u001b[0m in \u001b[0;36m_safe_read\u001b[0;34m(self, amt)\u001b[0m\n\u001b[1;32m 608\u001b[0m \u001b[0ms\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 609\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0mamt\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 610\u001b[0;31m \u001b[0mchunk\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mamt\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mMAXAMOUNT\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 611\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mchunk\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 612\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mIncompleteRead\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mb''\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mamt\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/opt/anaconda3/envs/obspy/lib/python3.7/socket.py\u001b[0m in \u001b[0;36mreadinto\u001b[0;34m(self, b)\u001b[0m\n\u001b[1;32m 587\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 588\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 589\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_sock\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv_into\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 590\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 591\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_timeout_occurred\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + "Inventory created at 2020-05-15T19:56:33.000000Z\n", + "\tCreated by: IRIS WEB SERVICE: fdsnws-station | version: 1.1.45\n", + "\t\t http://service.iris.edu/fdsnws/station/1/query?starttime=2020-02-10...\n", + "\tSending institution: IRIS-DMC (IRIS-DMC)\n", + "\tContains:\n", + "\t\tNetworks (1):\n", + "\t\t\tGB\n", + "\t\tStations (1):\n", + "\t\t\tGB.EDI (EDINBURGH, SCOTLAND)\n", + "\t\tChannels (1):\n", + "\t\t\tGB.EDI..BHZ\n" ] } ], @@ -233,42 +205,209 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "metadata": { "ExecuteTime": { "end_time": "2020-05-08T06:47:10.106003Z", "start_time": "2020-05-08T06:46:17.724247Z" } }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\r", + " 0%| | 0/2 [00:00 Date: Fri, 15 May 2020 21:00:41 +0100 Subject: [PATCH 3/4] savediskspace_multicpu --- SeismoSocialDistancing.ipynb | 208 ++--------------------------------- 1 file changed, 7 insertions(+), 201 deletions(-) diff --git a/SeismoSocialDistancing.ipynb b/SeismoSocialDistancing.ipynb index 9928edc..a4b861c 100644 --- a/SeismoSocialDistancing.ipynb +++ b/SeismoSocialDistancing.ipynb @@ -31,23 +31,14 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2020-05-08T06:46:13.572490Z", "start_time": "2020-05-08T06:45:59.783138Z" } }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The autoreload extension is already loaded. To reload it, use:\n", - " %reload_ext autoreload\n" - ] - } - ], + "outputs": [], "source": [ "import datetime\n", "import os\n", @@ -85,7 +76,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2020-05-08T06:46:14.089189Z", @@ -128,7 +119,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2020-05-08T06:46:17.701310Z", @@ -136,32 +127,7 @@ }, "scrolled": false }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Either mSEED or .npz already exists ... skipping date example_2020-02-10_GB.EDI..BHZ.mseed: 100%|██████████| 10/10 [00:00<00:00, 1106.09it/s]\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Inventory created at 2020-05-15T19:56:33.000000Z\n", - "\tCreated by: IRIS WEB SERVICE: fdsnws-station | version: 1.1.45\n", - "\t\t http://service.iris.edu/fdsnws/station/1/query?starttime=2020-02-10...\n", - "\tSending institution: IRIS-DMC (IRIS-DMC)\n", - "\tContains:\n", - "\t\tNetworks (1):\n", - "\t\t\tGB\n", - "\t\tStations (1):\n", - "\t\t\tGB.EDI (EDINBURGH, SCOTLAND)\n", - "\t\tChannels (1):\n", - "\t\t\tGB.EDI..BHZ\n" - ] - } - ], + "outputs": [], "source": [ "c = Client(data_provider)\n", "\n", @@ -205,174 +171,14 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2020-05-08T06:47:10.106003Z", "start_time": "2020-05-08T06:46:17.724247Z" } }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "\r", - " 0%| | 0/2 [00:00 Date: Mon, 18 May 2020 07:49:13 +0100 Subject: [PATCH 4/4] Added full station metadata for time period --- SeismoSocialDistancing.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SeismoSocialDistancing.ipynb b/SeismoSocialDistancing.ipynb index a4b861c..cd14d5d 100644 --- a/SeismoSocialDistancing.ipynb +++ b/SeismoSocialDistancing.ipynb @@ -155,7 +155,7 @@ " continue\n", " st.write(fn)\n", " \n", - "resp = c.get_stations(UTCDateTime(day), network=network, station=station, location=location,\n", + "resp = c.get_stations(start=UTCDateTime(daylist[0]), end=UTCDateTime(daylist[-1]), network=network, station=station, location=location,\n", " channel=channel, level=\"response\")\n", "print(resp)\n" ]