Learn R Programming

IRISSeismic (version 1.0.5)

getEvent: Retrieve seismic event information from IRIS DMC

Description

The getEvent method obtains seismic event data from the IRIS DMC event webservice.

Usage

getEvent(obj, starttime, endtime, minmag, maxmag, magtype,
         mindepth, maxdepth)

Arguments

obj
an IrisClient object
starttime
POSIXct class limiting results to events occurring after starttime (GMT)
endtime
POSIXct class limiting results to events occurring before endtime (GMT)
minmag
optional minimum magnitude
maxmag
optional maximum magnitude
magtype
optional magnitude type
mindepth
optional minimum depth (km)
maxdepth
optional maximum depth (km)

Value

  • A dataframe with the following columns:

    eventId ,time, latitude, longitude, depth, author, cCatalog, contributor, contributorId, magType, magnitude, magAuthor, eventLocationName

    Rows are ordered by time.

    NOTE: column names are identical to the names returned from the event web service with the exception of "latitude" for "lat" and "longitude" for "lon". The longer names are used for internal consistency -- all other web services return columns named "latitude" and "longitude".

Details

The getEvent method uses the event web service to obtain data for all events that meet the criteria defined by the arguments and returns that data in a dataframe. Each row of the dataframe represents a unique event.

References

The IRIS DMC event webservice:

http://service.iris.edu/fdsnws/event/1/

See Also

IrisClient-class,

Examples

Run this code
# NOTE:  'maps' and 'mapdata' packages must be installed
require(maps)
require(mapdata)

# Open a connection to IRIS DMC webservices
iris <- new("IrisClient")

# Get events > mag 5.0 over a week in June of 2012
starttime <- as.POSIXct("2012-06-21", tz="GMT")
endtime <- starttime + 3600 * 24 * 7
events <- getEvent(iris, starttime, endtime, minmag=5.0)

# Look at all events
print(paste(nrow(events),"earthquakes found with magnitude > 5.0"))
  
# Plot events on a map
map('world')
points(events$longitude, events$latitude, pch=16, cex=1.5, col='red')
labels <- paste(" ", as.character(round(events$magnitude,1)), sep="")
text(events$longitude, events$latitude, labels=labels, pos=4, cex=1.2, col='red3')

Run the code above in your browser using DataLab