{"action":"opened","issue":{"url":"https://api.github.com/repos/eqcorrscan/EQcorrscan/issues/214","repository_url":"https://api.github.com/repos/eqcorrscan/EQcorrscan","labels_url":"https://api.github.com/repos/eqcorrscan/EQcorrscan/issues/214/labels{/name}","comments_url":"https://api.github.com/repos/eqcorrscan/EQcorrscan/issues/214/comments","events_url":"https://api.github.com/repos/eqcorrscan/EQcorrscan/issues/214/events","html_url":"https://github.com/eqcorrscan/EQcorrscan/issues/214","id":316115192,"number":214,"title":"Match_filter tutorial fails when plot=True","user":{"login":"cjhopp","id":15131494,"avatar_url":"https://avatars3.githubusercontent.com/u/15131494?v=4","gravatar_id":"","url":"https://api.github.com/users/cjhopp","html_url":"https://github.com/cjhopp","followers_url":"https://api.github.com/users/cjhopp/followers","following_url":"https://api.github.com/users/cjhopp/following{/other_user}","gists_url":"https://api.github.com/users/cjhopp/gists{/gist_id}","starred_url":"https://api.github.com/users/cjhopp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjhopp/subscriptions","organizations_url":"https://api.github.com/users/cjhopp/orgs","repos_url":"https://api.github.com/users/cjhopp/repos","events_url":"https://api.github.com/users/cjhopp/events{/privacy}","received_events_url":"https://api.github.com/users/cjhopp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-20T03:30:27Z","updated_at":"2018-04-20T03:30:27Z","closed_at":null,"author_association":"OWNER","body":"The match_filter tutorial is only tested for plot=False.\r\n\r\nWhen running the tutorial with plot=True, the following error occurs, as reported by @wardhani:\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nIndexError                                Traceback (most recent call last)\r\n<ipython-input-3-3e6220f0928d> in <module>()\r\n----> 1 match_filter.run_tutorial(plot=True)\r\n\r\n~/anaconda3/envs/py35/lib/python3.5/site-packages/eqcorrscan/tutorials/match_filter.py in run_tutorial(plot)\r\n    143                         endtime=detection.detect_time + maxlag + 10)\r\n    144             plotting.detection_multiplot(stplot, template,\r\n--> 145                                          [detection.detect_time.datetime])\r\n    146     return unique_detections\r\n    147 \r\n\r\n~/anaconda3/envs/py35/lib/python3.5/site-packages/eqcorrscan/utils/plotting.py in detection_multiplot(stream, template, times, streamcolour, templatecolour, save, savefile, size, title)\r\n    927                      tr.stats.channel) in template_stachans])\r\n    928     ntraces = len(temp)\r\n--> 929     fig, axes = plt.subplots(ntraces, 1, sharex=True, figsize=size)\r\n    930     if len(temp) > 1:\r\n    931         axes = axes.ravel()\r\n\r\n~/anaconda3/envs/py35/lib/python3.5/site-packages/matplotlib/pyplot.py in subplots(nrows, ncols, sharex, sharey, squeeze, subplot_kw, gridspec_kw, **fig_kw)\r\n   1210 \r\n   1211     # Create first subplot separately, so we can share it if requested\r\n-> 1212     ax0 = fig.add_subplot(gs[0, 0], **subplot_kw)\r\n   1213     axarr[0] = ax0\r\n   1214 \r\n\r\n~/anaconda3/envs/py35/lib/python3.5/site-packages/matplotlib/gridspec.py in __getitem__(self, key)\r\n    156                     k1 += nrows\r\n    157                 if k1 >= nrows or k1 < 0 :\r\n--> 158                     raise IndexError(\"index out of range\")\r\n    159                 row1, row2 = k1, k1+1\r\n    160 \r\n\r\nIndexError: index out of range\r\n```\r\n\r\nThis is a result of chunking the day-long data into hours. When trying to access `st` [here](https://github.com/eqcorrscan/EQcorrscan/blob/a5d5d3e6afc87416ed7a22e52624f314eabcacf0/eqcorrscan/tutorials/match_filter.py#L138), only data from the last hour of the day are available for plotting."}}
{"actor":{"display_login":"cjhopp"}}