Class Stream
Contains the definition of SAUL’s Stream class.
- class saul.waveform.stream.Stream[source]
A subclass of ObsPy’s
Streamclass with extra functionality.See the docstring for that class for documentation on the attributes and methods inherited by this class.
- classmethod from_earthscope(network, station, channel, starttime, endtime, location='*', cache=False)[source]
Create a SAUL
Streamobject containing waveforms obtained from EarthScope servers.This class method wraps
waveform_collection.server.gather_waveforms()with thesourceargument set to'IRIS'. Wildcards (*,?) are accepted for thenetwork,station,channel, andlocationparameters. The user can optionally choose to cache waveform data to avoid redundant data download for repeated identical requests (seecacheargument).Warning
Caching (see
cacheargument), while convenient, is sketchy since data are not guaranteed to be the same between calls!- Parameters:
network (str) – SEED network code
station (str) – SEED station code
channel (str) – SEED channel code
starttime (tuple or
UTCDateTime) – Start time for data request; for tuple input the format is integers:(year, month, day[, hour[, minute[, second[, microsecond]]])endtime (tuple or
UTCDateTime) – End time for data request (same format asstarttime)location (str) – SEED location code
cache (bool) – Toggle whether to cache the
gather_waveforms()function call to avoid downloading data again in subsequent calls
- Returns:
Newly-created object with the server-obtained waveforms in units of integer counts
- Return type:
SAUL
Stream
- classmethod from_local(data_dir, coord_file, network, station, channel, starttime, endtime, location='*')[source]
Create a SAUL
Streamobject containing waveforms obtained from local files.This class method wraps
waveform_collection.local.local.read_local(). Wildcards (*,?) are accepted for thenetwork,station,channel, andlocationparameters.- Parameters:
data_dir (str) – Directory containing miniSEED files
coord_file (str) – JSON file containing coordinates for local stations (full path required)
network (str) – SEED network code
station (str) – SEED station code
channel (str) – SEED channel code
starttime (tuple or
UTCDateTime) – Start time for data request; for tuple input the format is integers:(year, month, day[, hour[, minute[, second[, microsecond]]])endtime (tuple or
UTCDateTime) – End time for data request (same format asstarttime)location (str) – SEED location code
- Returns:
Newly-created object with the locally obtained waveforms
- Return type:
SAUL
Stream
- to_kml(filename='saul.Stream.kml', ge=False)[source]
Write the SAUL
Streamstation locations to a KML file and optionally open it.Adopted from the ObsPy code here.
- plot(*args, **kwargs)[source]
Modify this method to always plot into a new figure, and make record section plotting easier.
If the user specifies
src_latandsrc_lon,type='section'is assumed and distances are automatically calculated. This saves the user from having to calculate these in a prior step. If this plotting mode is used, the user can also specify awavespeedto plot a moveout line on the record section.- Parameters:
Note
Can obtain standard
obspy.core.stream.Stream.plot()behavior by settingfig=None.