Reading events from IRIS DMC - geoscience-community-codes/GISMO GitHub Wiki

To load events into a Catalog object we use the readEvents function. The first argument is the data source/format - when this is given as 'iris', readEvents uses the irisFetch.m program to retrieve event data via the IRIS webservices. To narrow down our data search we can give readEvents any name-value parameter pairs supported by irisFetch.

In this example we will use readEvents to retrieve all events at IRIS DMC with a magnitude of at least 7.9 between year 2000 and 2014 (inclusive):

>> catalogObject = readEvents('iris', 'minimumMagnitude', 7.9, ...
                 'starttime', '2000-01-01', 'endtime', '2015-01-01')

This should yield:

catalogObject = 

  Catalog with properties:

      time: [1x26 double]
       lon: [1x26 double]
       lat: [1x26 double]
     depth: [1x26 double]
       mag: [1x26 double]
   magtype: {1x26 cell}
     etype: {1x26 cell}
   request: [1x1 struct]
  arrivals: {}

The size of the time, lon, lat, depth, mag, magtype and etype matrices are 1 x 26. This means we have retrieved 26 events. The time matrix is in MATLAB's datenum format (decimal days since year 0).

catalogObject is of type "Catalog". etype is a cell array containing the event type for each of the 26 events. In this case each is just 'earthquake', but when dealing with more diverse dataset, many other etype's are possible. magtype is whatever magnitude type was assigned by the agency that provided the magnitude data.

The arrivals property is blank. This is a cell array that can optionally contain phase arrival data. See the Arrival class for more on this.

Now we'll do another example - we will get events within 200 km of the great M9.0 Tohoku earthquake that occurred on 2011/03/11. According to [USGS](http://earthquake.usgs.gov/earthquakes/eq inthenews/2011/usc0001xgp/#details) the mainshock parameters are:

Date/Time:  "2011/03/11 05:46:24"
Longitude:  142.372
Latitude:   38.297
Depth:      30 km

We will limit our search to 1 day before and after the earthquake:

>> mainshocktime = datenum('2011/03/11 05:46:24')
>> catalogObject = readEvents('iris', ...
       'radialcoordinates', [38.297 142.372 km2deg(200)], ...
       'starttime', mainshocktime - 1, ...
       'endtime', mainshocktime + 1)

This should yield:

catalogObject = 

  Catalog with properties:

        time: [1x1136 double]
         lon: [1x1136 double]
         lat: [1x1136 double]
       depth: [1x1136 double]
         mag: [1x1136 double]
     magtype: {1x1136 cell}
       etype: {1x1136 cell}
     request: [1x1 struct]
    arrivals: {}

1136 earthquakes. Now let's save the events we have read from IRIS, so we can use it again later:

>> catalogObject.save('tohoku_events_1day.mat')

| ▼ Download source code |