getDataselect: Retrieve seismic data from IRIS DMC

getDataselectR Documentation

Retrieve seismic data from IRIS DMC


The getDataselect method makes a request of the IRIS DMC dataselect webservice and returns a Stream object in which individual Traces have been sorted by start time.


getDataselect(obj, network, station, location, channel, 
              starttime, endtime, ...)



IrisClient object


character string with the two letter seismic network code


character string with the station code


character string with the location code


character string with the three letter channel code


POSIXct class specifying the starttime (GMT)


POSIXct class specifying the endtime (GMT)


optional arguments quality optional character string identifying the quality. IRIS webservices defaults to quality="M". repository optional character string identifying whether to exclusively search primary archive or realtime collection buffers. Acceptable values are "primary" or "realtime". If not specified, IRIS webservices defaults to both repositories. inclusiveEnd optional logical determining whether the endtime is inclusive (default = TRUE) ignoreEpoch optional logical defining behavior when multiple epochs are encountered (default = FALSE)


This is the primary method for retrieving seismic data. Data requests are made through the dataselect webservice and returned data are parsed using the internal miniseed2Stream() function.

If the location argument contains an empty string to specify a 'blank' location code, a location code of "--" will be used in the dataselect request URL. (See dataselect documentation.)

If inclusiveEnd=FALSE, then getDataselect will subtract 0.000001 seconds from the endtime before passing the value to the dataselect webservice. An endtime of, e.g., as.POSIXct("2016-01-03", tz="GMT") will be passed into dataselect as end=2016-01-02T23:59:59.999999. A data sample at time 2016-01-03T00:00:00 will not be returned unless inclusiveEnd=TRUE.

Error returns from the webservice will stop evaluation and generate an error message.

Sometimes the station webservice will return multiple records for the same SNCL, each with a different scale or starttime. These represent different epochs with potentially different metadata parameters for the SNCL and, by default, will cause a 'Multiple epochs' error message to be generated.

Handling all possible metadata differences so that the data may be merged is beyond the scope of this package. Instead, to avoid errors, users may specify ignoreEpoch=TRUE in which case the very first SNCL-epoch encountered will be used and all others will be discarded.

For access to restricted data, getDataselect will look for system environmental variable "IrisClient_netrc" which should point to a .netrc authentication file.


A new Stream object is returned.


Jonathan Callahan


The IRIS DMC dataselect webservice:

This implementation is similar in functionality to the obspy dataselect function:

See Also

getSNCL, IrisClient-class


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

# Use getDataselect to request data for II.JTS.00.BHZ
starttime <- as.POSIXct("2001-02-28",tz="GMT")
endtime <- as.POSIXct("2001-03-01",tz="GMT")

st <- getDataselect(iris, "II","JTS","00","BHZ",starttime, endtime, 

# Display structure of trace(s)


# Plot trace

## End(Not run)

IRISSeismic documentation built on Oct. 16, 2022, 1:09 a.m.