{"id":1130,"date":"2015-03-03T15:47:12","date_gmt":"2015-03-03T20:47:12","guid":{"rendered":"https:\/\/blogs.mathworks.com\/loren\/?p=1130"},"modified":"2015-03-03T15:47:12","modified_gmt":"2015-03-03T20:47:12","slug":"direct-access-to-seismological-data-using-matlab","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/loren\/2015\/03\/03\/direct-access-to-seismological-data-using-matlab\/","title":{"rendered":"Direct Access to Seismological Data using MATLAB"},"content":{"rendered":"\r\n<div class=\"content\"><!--introduction--><p>I've recently been engaged in several events of potential interest to the geophysics community.  In December 2014, a few of us from MathWorks attended the AGU meeting (<a href=\"http:\/\/www.agu.org\">American Geophysical Union<\/a>).<\/p><p>And last week, I was invited to give a webinar to the <a href=\"http:\/\/www.iris.edu\/\">IRIS<\/a> (Incorporated Research Institutions for Seismology) community.  The video for MATLAB for Analyzing &amp; Visualizing Geospatial Data is <a href=\"http:\/\/bit.ly\/1B58VT4\">here<\/a>.<\/p><p>Next, I would like to pass on some timely information from Chad Trabant and Robert Weekly, from IRIS, about accessing seismological data via IRIS sites and services.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#00534608-03bc-4ca5-a106-5de7916bd2e2\">Introduction<\/a><\/li><li><a href=\"#9377590e-79da-40cd-81ff-ac299def44e0\">Accessing data from the DMC in MATLAB<\/a><\/li><li><a href=\"#8d5aea75-371e-4728-9bb9-ab7fd61c89bf\">A standard web services foundation, accessing data at multiple centers<\/a><\/li><li><a href=\"#37433238-ca3a-4c47-947d-269364d118a8\">Examples<\/a><\/li><li><a href=\"#2f9b4507-55e9-4c58-bd12-2fe45f118fd3\">Trouble accessing your seismological data?<\/a><\/li><\/ul><\/div><h4>Introduction<a name=\"00534608-03bc-4ca5-a106-5de7916bd2e2\"><\/a><\/h4><p>Traditionally, seismologists spend considerable time and effort collecting and organizing the data they wish to use for a study.  In an effort to reduce this prep work, the <a href=\"http:\/\/ds.iris.edu\">IRIS Data Management Center (DMC)<\/a> are constantly trying to remove barriers associated with data collection and formatting to deliver data to users that is easy for them to use and will give researchers more time to actually perform their research.<\/p><p>The DMC operates one of the largest repositories of openly available seismological time series data.  Data managed by the DMC is retrieved from stations around the world, with international partners contributing data, in addition to data collected by U.S. institutions.  These data are primarily from passive source sensors and are what most folks are familiar with when they see earthquake signals.<\/p><p>One of the primary charges of the DMC is to collect, archive, and distribute data to not only university researchers and teachers, but to anyone with internet access.  A significant amount of work at the DMC is dedicated to building software packages that enable people to access the data stored in the DMC archives through a variety of web-enabled clients.<\/p><h4>Accessing data from the DMC in MATLAB<a name=\"9377590e-79da-40cd-81ff-ac299def44e0\"><\/a><\/h4><p>For MATLAB users, DMC has developed <a href=\"http:\/\/ds.iris.edu\/ds\/nodes\/dmc\/software\/downloads\/irisfetch.m\/\"><tt>irisFetch.m<\/tt><\/a> which provides seamless access to data stored at the DMC, as well as other data centers that implement standard web services.<\/p><p>This bit of MATLAB code operates as an abstraction layer to the DMC <a href=\"http:\/\/ds.iris.edu\/ds\/nodes\/dmc\/software\/downloads\/IRIS-WS\/\">IRIS-WS Java library<\/a>, which in turn fetches data and information from a data center via web services. <i>Importantly, a user does not need to know anything about Java or networking: syntax for the functions provided by <tt>irisFetch.m<\/tt> should be familiar to users of the MATLAB language, and all data is returned as MATLAB structures.<\/i><\/p><p>The <tt>irisFetch<\/tt> module provides access to the following:<\/p><div><ul><li>Time series data, mostly seismological (ground motion)<\/li><li>Seismological station metadata, including instrument response<\/li><li>Event (earthquake) parameters, e.g., location, time, magnitude<\/li><\/ul><\/div><p>Help getting started using <tt>irisFetch.m<\/tt> is available in the <a href=\"http:\/\/ds.iris.edu\/ds\/nodes\/dmc\/software\/downloads\/irisFetch.m\/2-0-6\/manual\/\">online manual for <tt>irisFetch<\/tt><\/a>.  Examples are also included below.<\/p><h4>A standard web services foundation, accessing data at multiple centers<a name=\"8d5aea75-371e-4728-9bb9-ab7fd61c89bf\"><\/a><\/h4><p>The core web services for delivering time series, related metadata and event (earthquake) information used by <tt>irisFetch<\/tt> have been standardized by the FDSN2.  DMC has purposely designed <tt>irisFetch<\/tt>, and the Java library it uses, to work with any services compliant with the specification.  This means that <tt>irisFetch<\/tt> may be used to retrieve data from any data center supporting these services, however, not all data centers have implemented every FDSN-standardized service, so functionality with <tt>irisFetch<\/tt> is limited to what any given center supports.  A list of FDSN data centers and the services they support is <a href=\"http:\/\/www.fdsn.org\/webservices\/datacenters\/\">here<\/a>.<\/p><p><b>A short aside on seismic data nomenclature and norms<\/b><\/p><p>In the world of passive source seismology (SEED format specifically) time series are identified with four identifiers: network, station, location and channel.  Most of the data available from the DMC is recorded continuously, sometimes for decades, so a time range must also be specified to form a minimal request.  In the <tt>irisFetch<\/tt> functions, time series are selected using these identifiers.  In most cases, seismological data is returned in units of \"digital counts\", which is often proportional to velocity or acceleration within a certain frequency range.<\/p><h4>Examples<a name=\"37433238-ca3a-4c47-947d-269364d118a8\"><\/a><\/h4><p>The <tt>irisFetch<\/tt> module comprises three separate methods that can used to retrieve station metadata, time series, and event information.  They are <tt>irisFetch.Stations<\/tt>, <tt>irisFetch.Traces<\/tt> and <tt>irisFetch.Events<\/tt>, respectively. Below are some examples of how each of these components of <tt>irisFetch<\/tt> could be used for common data retrieval tasks.<\/p><p>Example 1<\/p><p>Plot time series for the 2011 Tohoku-Oki earthquake.  The example below uses <tt>irisFetch.Traces<\/tt> to retrieve time series data for global GSN stations to plot 1 hour of data (bandpass filtered from 1 - 5 Hz) following the Tohoku-Oni earthquake of March 2011.<\/p><pre>  sta = {'MAJO','WMQ','KAPI','CMB'};\r\n  for i=1:length(sta)\r\n      tohoku_tr(i) = irisFetch.Traces('_GSN',sta{i},'00','BHZ','2011-03-11 15:10:00',...\r\n          '2011-03-11 16:10:00','verbose');\r\n  end<\/pre><p>set filter parameters<\/p><pre>  bandfilt_freq1 = 1;\r\n  bandfilt_freq2 = 5;\r\n  bandfilt_order = 4;<\/pre><pre>  colors = brighten(lines(numel(tohoku_tr)),-0.33);\r\n  figure(1)\r\n  for i=1:numel(tohoku_tr)\r\n      subplot(4,1,i)\r\n      tr = tohoku_tr(i);\r\n      data = (tr.data - mean(tr.data)) .\/ tr.sensitivity;\r\n      wn1 = bandfilt_freq1\/tr.sampleRate;\r\n      wn2 = bandfilt_freq2\/tr.sampleRate;\r\n      [f1,f2] = butter(bandfilt_order,[wn1 wn2],'stop');\r\n      data = filter(f1,f2,data);\r\n      sampletimes = linspace(tr.startTime,tr.endTime,tr.sampleCount);\r\n      plot(sampletimes, data, 'color', colors(2,:),'LineWidth',1);\r\n      datetick;\r\n      if i==1\r\n          title('Tohoku-Oni Earthquake, 11-March-2011','FontSize',14)\r\n      end\r\n      if i~=numel(tohoku_tr)\r\n          set(gca,'xticklabel','');\r\n      else\r\n          xt = get(gca,'XTick'); xtl = get(gca,'XTickLabel');\r\n          xt = xt(1:2:end); xtl = xtl(1:2:end,:);\r\n          set(gca,'XTick',xt,'XTickLabel',xtl);\r\n      end\r\n      set(gca,'YTick',[],'YTickLabel','','TickDir','out',...\r\n          'TickLength',[.005 .015],'FontSize',12);\r\n      ylabel([tohoku_tr(i).network '.' tohoku_tr(i).station])\r\n      hold on;\r\n  end<\/pre><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/2015\/iris01sm.png\" alt=\"\"> <\/p><p>Example 2<\/p><p>Plot a map of Transportable Array (TA) network stations and recent earthquakes in Oklahoma.  This example uses <tt>irisFetch.Events<\/tt> and <tt>irisFetch.Stations<\/tt> to retrieve hypocenter data and station metadata, respectively, to make a simple plot in MATLAB.<\/p><pre>  minlat = 35; maxlat = 37.5;\r\n  minlon = -100; maxlon = -95;\r\n  starttime = '2012-01-01 00:00:00';\r\n  endtime = '2015-02-01 00:00:00';\r\n  maxmag = 4.0; minmag = 0.0;<\/pre><pre>  ok_ev =\r\n  irisFetch.Events('boxcoordinates',[minlat,maxlat,minlon,maxlon],...\r\n      'maximumMagnitude',maxmag,'minimumMagnitude',minmag,...\r\n      'startTime',starttime,'endTime',endtime,...\r\n      'baseurl','http:\/\/service.iris.edu\/fdsnws\/event\/1\/');<\/pre><pre>  ok_sta = irisFetch.Stations('station','TA','*','*','BH?',...\r\n      'boxcoordinates',[minlat,maxlat,minlon,maxlon]);<\/pre><pre>  figure(2)\r\n  plot([ok_ev.PreferredLongitude],[ok_ev.PreferredLatitude],'r.',...\r\n      'MarkerSize',10)\r\n  hold on\r\n  plot([ok_sta.Longitude],[ok_sta.Latitude],'b^','MarkerFaceColor','b')\r\n  deg2in=6.0\/diff(xlim);\r\n  set(gca,'units','inches','pos',...\r\n      [1.5 1 diff(xlim)*cosd(35)*deg2in diff(ylim)*deg2in],...\r\n      'FontSize',12,'TickDir','out')\r\n  l = legend('Earthquake','TA station','Location','NorthEast');\r\n  set(l,'FontSize',12)\r\n  xlabel('Longitude')\r\n  ylabel('Latitude')\r\n  title(['M&lt;' num2str(maxmag) ' -- ' datestr(starttime(1:10),1) ' to ' ...\r\n      datestr(endtime(1:10),1) ' -- ' ...\r\n      num2str(numel(ok_ev)) ' total events'],'FontSize',14)<\/pre><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/2015\/iris02sm.png\" alt=\"\"> <\/p><p>Example 3<\/p><p>Retrieving data from other datacenters.  The versatility of the <tt>irisFetch<\/tt> methods allow users to access data from web services hosted by other datacenters, as long as they conform to the specification set by the FDSN (as discussed above).  This example uses data obtained from the <a href=\"http:\/\/earthquake.usgs.gov\/fdsnws\/event\/1\/\">USGS fdsn-event service<\/a> and some simple commands from the MATLAB Mapping Toolbox.<\/p><pre>  minmag_glob = 6;\r\n  tstart = '2000-01-01 00:00:00';\r\n  glob_ev = irisFetch.Events('startTime',tstart,'minimumMagnitude',minmag_glob,...\r\n      'baseurl','http:\/\/earthquake.usgs.gov\/fdsnws\/event\/1\/');<\/pre><pre>  figure(3)\r\n  % Here we use the MATLAB Mapping Toolbox\r\n  h = worldmap('world');\r\n  geoshow(h,'landareas.shp','FaceColor',[.3 .3 .3])\r\n  l = geoshow(h,[glob_ev.PreferredLatitude],[glob_ev.PreferredLongitude],'DisplayType','point');\r\n  set(l,'Marker','.')\r\n  mlabel('GLineWidth',.2,'FontSize',12,...\r\n      'MLabelLocation',90,'MLabelParallel','south');\r\n  title(['Global M&gt;' num2str(minmag_glob) ' events since ' datestr(tstart(1:10),1)],...\r\n      'FontSize',14)<\/pre><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/2015\/iris03sm.png\" alt=\"\"> <\/p><h4>Trouble accessing your seismological data?<a name=\"2f9b4507-55e9-4c58-bd12-2fe45f118fd3\"><\/a><\/h4><p>How do you get access to the seismological data you analyze &#8211; <tt>irisFetch<\/tt> &#8211; or something else?  What are the stumbling blocks you encounter when accessing or working with seismological data?  Let us know <a href=\"https:\/\/blogs.mathworks.com\/loren\/?p=1130#respond\">here<\/a>.<\/p><p><b>Footnotes<\/b><\/p><div><ol><li>The <a href=\"http:\/\/www.iris.edu\">\"Incorporated Research Institutions for Seismology (IRIS)\"<\/a> is a consortium of universities that, among other activities, operate shared facilities to support research and education about seismology.  IRIS is supported by the <a href=\"http:\/\/www.nsf.gov\">\"National Science Foundation\"<\/a> most recently under award <a href=\"http:\/\/www.nsf.gov\/awardsearch\/showAward?AWD_ID=1261681\">\"EAR-1261681\"<\/a>.<\/li><li>Among other functions, the <a href=\"http:\/\/www.fdsn.org\">\"International Federation of Digital Seismograph Networks (FDSN)\"<\/a> maintains specifications for services and formats for seismological data.<\/li><\/ol><\/div><script language=\"JavaScript\"> <!-- \r\n    function grabCode_85048f046c69438a8b956014afd5dc16() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='85048f046c69438a8b956014afd5dc16 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 85048f046c69438a8b956014afd5dc16';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2015 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_85048f046c69438a8b956014afd5dc16()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2014b<br><\/p><\/div><!--\r\n85048f046c69438a8b956014afd5dc16 ##### SOURCE BEGIN #####\r\n%% Direct Access to Seismological Data using MATLAB\r\n% I've recently been engaged in several events of potential interest to the\r\n% geophysics community.  In December 2014, a few of us from MathWorks\r\n% attended the AGU meeting (<http:\/\/www.agu.org American Geophysical Union>).\r\n% \r\n% And last week, I was invited to give a webinar to the\r\n% <http:\/\/www.iris.edu\/ IRIS> (Incorporated Research Institutions for\r\n% Seismology) community.  The video for MATLAB for Analyzing & Visualizing\r\n% Geospatial Data is <http:\/\/bit.ly\/1B58VT4 here>.  \r\n%\r\n% Next, I would like to pass on some timely information from Chad Trabant\r\n% and Robert Weekly, from IRIS, about accessing seismological data via IRIS\r\n% sites and services.\r\n%% Introduction\r\n% Traditionally, seismologists spend considerable time and effort\r\n% collecting and organizing the data they wish to use for a study.  In an\r\n% effort to reduce this prep work, the <http:\/\/ds.iris.edu IRIS Data\r\n% Management Center (DMC)> are constantly trying to remove barriers\r\n% associated with data collection and formatting to deliver data to users\r\n% that is easy for them to use and will give researchers more time to\r\n% actually perform their research.\r\n%\r\n% The DMC operates one of the largest repositories of openly available\r\n% seismological time series data.  Data managed by the DMC is retrieved\r\n% from stations around the world, with international partners contributing\r\n% data, in addition to data collected by U.S. institutions.  These data are\r\n% primarily from passive source sensors and are what most folks are\r\n% familiar with when they see earthquake signals.\r\n% \r\n% One of the primary charges of the DMC is to collect, archive, and\r\n% distribute data to not only university researchers and teachers, but to\r\n% anyone with internet access.  A significant amount of work at the DMC is\r\n% dedicated to building software packages that enable people to access the\r\n% data stored in the DMC archives through a variety of web-enabled clients.\r\n% \r\n%% Accessing data from the DMC in MATLAB\r\n% For MATLAB users, DMC has developed\r\n% <http:\/\/ds.iris.edu\/ds\/nodes\/dmc\/software\/downloads\/irisfetch.m\/\r\n% |irisFetch.m|> which provides seamless access to data stored at the DMC,\r\n% as well as other data centers that implement standard web services.\r\n% \r\n% This bit of MATLAB code operates as an abstraction layer to the DMC\r\n% <http:\/\/ds.iris.edu\/ds\/nodes\/dmc\/software\/downloads\/IRIS-WS\/ IRIS-WS Java\r\n% library>, which in turn fetches data and information from a data center\r\n% via web services. _Importantly, a user does not need to know anything\r\n% about Java or networking: syntax for the functions provided by\r\n% |irisFetch.m| should be familiar to users of the MATLAB language, and all\r\n% data is returned as MATLAB structures._\r\n% \r\n% The |irisFetch| module provides access to the following:\r\n% \r\n% * Time series data, mostly seismological (ground motion)\r\n% * Seismological station metadata, including instrument response\r\n% * Event (earthquake) parameters, e.g., location, time, magnitude\r\n% \r\n% Help getting started using |irisFetch.m| is available in the\r\n% <http:\/\/ds.iris.edu\/ds\/nodes\/dmc\/software\/downloads\/irisFetch.m\/2-0-6\/manual\/\r\n% online manual for |irisFetch|>.  Examples are also included below.\r\n%\r\n%% A standard web services foundation, accessing data at multiple centers\r\n% The core web services for delivering time series, related metadata and\r\n% event (earthquake) information used by |irisFetch| have been standardized\r\n% by the FDSN2.  DMC has purposely designed |irisFetch|, and the Java\r\n% library it uses, to work with any services compliant with the\r\n% specification.  This means that |irisFetch| may be used to retrieve data\r\n% from any data center supporting these services, however, not all data\r\n% centers have implemented every FDSN-standardized service, so\r\n% functionality with |irisFetch| is limited to what any given center\r\n% supports.  A list of FDSN data centers and the services they support is\r\n% <http:\/\/www.fdsn.org\/webservices\/datacenters\/ here>.\r\n%\r\n% *A short aside on seismic data nomenclature and norms*\r\n%\r\n% In the world of passive source seismology (SEED format specifically) time\r\n% series are identified with four identifiers: network, station, location\r\n% and channel.  Most of the data available from the DMC is recorded\r\n% continuously, sometimes for decades, so a time range must also be\r\n% specified to form a minimal request.  In the |irisFetch| functions, time\r\n% series are selected using these identifiers.  In most cases,\r\n% seismological data is returned in units of \"digital counts\", which is\r\n% often proportional to velocity or acceleration within a certain frequency\r\n% range.\r\n%\r\n%% Examples\r\n% The |irisFetch| module comprises three separate methods that can used to\r\n% retrieve station metadata, time series, and event information.  They are\r\n% |irisFetch.Stations|, |irisFetch.Traces| and |irisFetch.Events|,\r\n% respectively. Below are some examples of how each of these components of\r\n% |irisFetch| could be used for common data retrieval tasks.\r\n%\r\n% Example 1\r\n%\r\n% Plot time series for the 2011 Tohoku-Oki earthquake.  The example below\r\n% uses |irisFetch.Traces| to retrieve time series data for global GSN\r\n% stations to plot 1 hour of data (bandpass filtered from 1 - 5 Hz)\r\n% following the Tohoku-Oni earthquake of March 2011.\r\n%\r\n%    sta = {'MAJO','WMQ','KAPI','CMB'};\r\n%    for i=1:length(sta) \r\n%        tohoku_tr(i) = irisFetch.Traces('_GSN',sta{i},'00','BHZ','2011-03-11 15:10:00',...\r\n%            '2011-03-11 16:10:00','verbose');\r\n%    end\r\n%\r\n% set filter parameters\r\n%\r\n%    bandfilt_freq1 = 1;\r\n%    bandfilt_freq2 = 5;\r\n%    bandfilt_order = 4;\r\n%\r\n%    colors = brighten(lines(numel(tohoku_tr)),-0.33);\r\n%    figure(1)\r\n%    for i=1:numel(tohoku_tr)\r\n%        subplot(4,1,i)\r\n%        tr = tohoku_tr(i);\r\n%        data = (tr.data - mean(tr.data)) .\/ tr.sensitivity;\r\n%        wn1 = bandfilt_freq1\/tr.sampleRate;\r\n%        wn2 = bandfilt_freq2\/tr.sampleRate;\r\n%        [f1,f2] = butter(bandfilt_order,[wn1 wn2],'stop');\r\n%        data = filter(f1,f2,data);\r\n%        sampletimes = linspace(tr.startTime,tr.endTime,tr.sampleCount);\r\n%        plot(sampletimes, data, 'color', colors(2,:),'LineWidth',1);\r\n%        datetick;\r\n%        if i==1\r\n%            title('Tohoku-Oni Earthquake, 11-March-2011','FontSize',14)\r\n%        end\r\n%        if i~=numel(tohoku_tr)\r\n%            set(gca,'xticklabel','');\r\n%        else\r\n%            xt = get(gca,'XTick'); xtl = get(gca,'XTickLabel');\r\n%            xt = xt(1:2:end); xtl = xtl(1:2:end,:);\r\n%            set(gca,'XTick',xt,'XTickLabel',xtl);\r\n%        end\r\n%        set(gca,'YTick',[],'YTickLabel','','TickDir','out',...\r\n%            'TickLength',[.005 .015],'FontSize',12);\r\n%        ylabel([tohoku_tr(i).network '.' tohoku_tr(i).station])\r\n%        hold on;\r\n%    end\r\n%\r\n% <<iris01sm.png>>\r\n%\r\n% Example 2\r\n%\r\n% Plot a map of Transportable Array (TA) network stations and recent\r\n% earthquakes in Oklahoma.  This example uses |irisFetch.Events| and\r\n% |irisFetch.Stations| to retrieve hypocenter data and station metadata,\r\n% respectively, to make a simple plot in MATLAB.\r\n%\r\n%\r\n%    minlat = 35; maxlat = 37.5;\r\n%    minlon = -100; maxlon = -95;\r\n%    starttime = '2012-01-01 00:00:00';\r\n%    endtime = '2015-02-01 00:00:00';\r\n%    maxmag = 4.0; minmag = 0.0;\r\n%  \r\n%    ok_ev =\r\n%    irisFetch.Events('boxcoordinates',[minlat,maxlat,minlon,maxlon],...\r\n%        'maximumMagnitude',maxmag,'minimumMagnitude',minmag,...\r\n%        'startTime',starttime,'endTime',endtime,...\r\n%        'baseurl','http:\/\/service.iris.edu\/fdsnws\/event\/1\/');\r\n%  \r\n%    ok_sta = irisFetch.Stations('station','TA','*','*','BH?',...\r\n%        'boxcoordinates',[minlat,maxlat,minlon,maxlon]);\r\n%  \r\n%    figure(2)\r\n%    plot([ok_ev.PreferredLongitude],[ok_ev.PreferredLatitude],'r.',...\r\n%        'MarkerSize',10)\r\n%    hold on\r\n%    plot([ok_sta.Longitude],[ok_sta.Latitude],'b^','MarkerFaceColor','b')\r\n%    deg2in=6.0\/diff(xlim);\r\n%    set(gca,'units','inches','pos',...\r\n%        [1.5 1 diff(xlim)*cosd(35)*deg2in diff(ylim)*deg2in],...\r\n%        'FontSize',12,'TickDir','out')\r\n%    l = legend('Earthquake','TA station','Location','NorthEast');\r\n%    set(l,'FontSize',12)\r\n%    xlabel('Longitude')\r\n%    ylabel('Latitude')\r\n%    title(['M<' num2str(maxmag) ' REPLACE_WITH_DASH_DASH ' datestr(starttime(1:10),1) ' to ' ...\r\n%        datestr(endtime(1:10),1) ' REPLACE_WITH_DASH_DASH ' ...\r\n%        num2str(numel(ok_ev)) ' total events'],'FontSize',14)\r\n%\r\n% <<iris02sm.png>>\r\n%\r\n% Example 3\r\n%\r\n% Retrieving data from other datacenters.  The versatility of the\r\n% |irisFetch| methods allow users to access data from web services hosted\r\n% by other datacenters, as long as they conform to the specification set by\r\n% the FDSN (as discussed above).  This example uses data obtained from the\r\n% <http:\/\/earthquake.usgs.gov\/fdsnws\/event\/1\/ USGS fdsn-event service> and\r\n% some simple commands from the MATLAB Mapping Toolbox.\r\n%\r\n%\r\n%    minmag_glob = 6;\r\n%    tstart = '2000-01-01 00:00:00';\r\n%    glob_ev = irisFetch.Events('startTime',tstart,'minimumMagnitude',minmag_glob,...\r\n%        'baseurl','http:\/\/earthquake.usgs.gov\/fdsnws\/event\/1\/');\r\n%  \r\n%    figure(3)\r\n%    % Here we use the MATLAB Mapping Toolbox\r\n%    h = worldmap('world');\r\n%    geoshow(h,'landareas.shp','FaceColor',[.3 .3 .3])\r\n%    l = geoshow(h,[glob_ev.PreferredLatitude],[glob_ev.PreferredLongitude],'DisplayType','point');\r\n%    set(l,'Marker','.')\r\n%    mlabel('GLineWidth',.2,'FontSize',12,...\r\n%        'MLabelLocation',90,'MLabelParallel','south');\r\n%    title(['Global M>' num2str(minmag_glob) ' events since ' datestr(tstart(1:10),1)],...\r\n%        'FontSize',14)\r\n%\r\n% <<iris03sm.png>>\r\n%\r\n%% Trouble accessing your seismological data?\r\n% How do you get access to the seismological data you analyze \u00e2\u20ac\u201c |irisFetch|\r\n% \u00e2\u20ac\u201c or something else?  What are the stumbling blocks you encounter when\r\n% accessing or working with seismological data?  Let us know\r\n% <https:\/\/blogs.mathworks.com\/loren\/?p=1130#respond here>.\r\n%\r\n% *Footnotes*\r\n%\r\n% # The <http:\/\/www.iris.edu \"Incorporated Research Institutions for\r\n% Seismology (IRIS)\"> is a consortium of universities that, among other\r\n% activities, operate shared facilities to support research and education\r\n% about seismology.  IRIS is supported by the <http:\/\/www.nsf.gov \"National\r\n% Science Foundation\"> most recently under award\r\n% <http:\/\/www.nsf.gov\/awardsearch\/showAward?AWD_ID=1261681 \"EAR-1261681\">.\r\n% # Among other functions, the <http:\/\/www.fdsn.org \"International\r\n% Federation of Digital Seismograph Networks (FDSN)\"> maintains\r\n% specifications for services and formats for seismological data.\r\n\r\n\r\n\r\n\r\n\r\n##### SOURCE END ##### 85048f046c69438a8b956014afd5dc16\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/loren\/2015\/iris03sm.png\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction--><p>I've recently been engaged in several events of potential interest to the geophysics community.  In December 2014, a few of us from MathWorks attended the AGU meeting (<a href=\"http:\/\/www.agu.org\">American Geophysical Union<\/a>).... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/loren\/2015\/03\/03\/direct-access-to-seismological-data-using-matlab\/\">read more >><\/a><\/p>","protected":false},"author":39,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[65,41,13,1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/1130"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/comments?post=1130"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/1130\/revisions"}],"predecessor-version":[{"id":1132,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/posts\/1130\/revisions\/1132"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/media?parent=1130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/categories?post=1130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/loren\/wp-json\/wp\/v2\/tags?post=1130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}