waveform_collection.server module
- waveform_collection.server.gather_waveforms(source, network, station, location, channel, starttime, endtime, time_buffer=0, merge_fill_value=0, trim_fill_value=0, remove_response=False, return_failed_stations=False, watc_url=None, watc_username=None, watc_password=None, verbose=True, n_jobs=1)[source]
Gather seismic/infrasound waveforms from any ObsPy-supported FDSN (see https://docs.obspy.org/packages/obspy.clients.fdsn.html), WATC FDSN, or AVO Winston, and output a
Streamwith station/element coordinates attached. Optionally remove the response.NOTE
Usual RTM usage is to specify a starttime/endtime that brackets the estimated source origin time. Then time_buffer is used to download enough extra data to account for the time required for an infrasound signal to propagate to the farthest station.
- Parameters:
source (str) –
Which source to gather waveforms from. Options are:
Any ObsPy-supported FDSN (e.g., ‘IRIS’, ‘NCEDC’). For full list, see https://docs.obspy.org/packages/obspy.clients.fdsn.html
’WATC’ – WATC FDSN (requires watc_url, watc_username, and watc_password)
’AVO’ – AVO Winston
network (str) – SEED network code [wildcards (
*,?) accepted]station (str) – SEED station code [wildcards (
*,?) accepted]location (str) – SEED location code [wildcards (
*,?) accepted]channel (str) – SEED channel code [wildcards (
*,?) accepted]starttime (
UTCDateTime) – Start time for data requestendtime (
UTCDateTime) – End time for data requesttime_buffer (int or float) – Extra amount of data to download after endtime [s]
merge_fill_value (bool, int, float, str, or None) – Controls merging of
Traceobjects with identical IDs. If False, no merging is performed. Otherwise, a merge is performed with thefill_valueprovided to this parameter. For details, see the docstring ofobspy.core.stream.Stream.trim()trim_fill_value (bool, int, float, or None) – Controls trimming of the output
Stream, useful if precisely uniform start and end times are desired. If False, no trimming is performed. Otherwise, a trim is performed with thefill_valueprovided to this parameter. For details, see the docstring ofobspy.core.stream.Stream.merge()remove_response (bool or str) – Response removal via full frequency deconvolution (‘full’) or single frequency sensitivity (‘sens’) / a simple scalar multiplication. Default is False to return stream in counts.
return_failed_stations (bool) – If True, returns a list of station codes that were requested but not downloaded. This disables the standard failed station warning message
watc_url (str) – URL for WATC FDSN server (
http://10.30.6.3:8080, orhttp://10.30.5.10:8080if using VPN)watc_username (str) – Username for WATC FDSN server
watc_password (str) – Password for WATC FDSN server
verbose (bool) – If False, all print statements will be blocked. Default is True.
n_jobs (int) – Number of CPUs to use for parallel processing. If n_jobs = -1, all CPUs are used. If n_jobs < -1, (n_cpus + 1 + n_jobs) are used. Default is 1 (a single processor).
- Returns:
Streamcontaining gathered waveforms. If return_failed_stations is True, additionally returns a list containing station codes that were requested but not downloaded
- waveform_collection.server.gather_waveforms_bulk(lon_0, lat_0, max_radius, starttime, endtime, channel, network='*', station='*', location='*', time_buffer=0, merge_fill_value=0, trim_fill_value=0, remove_response=False, watc_url=None, watc_username=None, watc_password=None, iris_only=True, verbose=True, n_jobs=1)[source]
Bulk gather infrasound waveforms within a specified maximum radius of a specified location. Waveforms are gathered from IRIS (and optionally WATC) FDSN, and AVO Winston. Outputs a
Streamwith station/element coordinates attached. Optionally removes the sensitivity. (OutputStreamhas the same properties as outputStreamfromgather_waveforms().)NOTE 1
WATC database will NOT be used for station search NOR data download unless BOTH watc_username and watc_password are set.
NOTE 2
Usual RTM usage is to specify a starttime/endtime that brackets the estimated source origin time. Then time_buffer is used to download enough extra data to account for the time required for an infrasound signal to propagate to the farthest station.
- Parameters:
max_radius (int or float) – Maximum radius to search for stations within [km]
starttime (
UTCDateTime) – Start time for data requestendtime (
UTCDateTime) – End time for data requestchannel (str) – SEED channel code [wildcards (
*,?) accepted] (REQUIRED PARAMETER!)network (str) – SEED network code [wildcards (
*,?) accepted]station (str) – SEED station code [wildcards (
*,?) accepted]location (str) – SEED location code [wildcards (
*,?) accepted]time_buffer (int or float) – Extra amount of data to download after endtime [s]
merge_fill_value (bool, int, float, str, or None) – Controls merging of
Traceobjects with identical IDs. If False, no merging is performed. Otherwise, a merge is performed with thefill_valueprovided to this parameter. For details, see the docstring ofobspy.core.stream.Stream.trim()trim_fill_value (bool, int, float, or None) – Controls trimming of the output
Stream, useful if precisely uniform start and end times are desired. If False, no trimming is performed. Otherwise, a trim is performed with thefill_valueprovided to this parameter. For details, see the docstring ofobspy.core.stream.Stream.merge()remove_response (bool) – Toggle response removal via
remove_sensitivity()or a simple scalar multiplicationwatc_url (str) – URL for WATC FDSN server
watc_username (str) – Username for WATC FDSN server
watc_password (str) – Password for WATC FDSN server
iris_only (bool) – If True, only the IRIS FDSN source is used
verbose (bool) – If False, all print statements will be blocked. Default is True.
n_jobs (int) – Number of CPUs to use for parallel processing. If n_jobs = -1, all CPUs are used. If n_jobs < -1, (n_cpus + 1 + n_jobs) are used.
- Returns:
Streamcontaining bulk gathered waveforms
- waveform_collection.server.get_increment_waveforms(args)[source]
Function required for parallel processing
- Parameters:
args (tuple) – A tuple containing the following elements: source (str): The data source to use for waveform retrieval. network (str): SEED network code [wildcards (
*,?) accepted]. station (str): SEED station code [wildcards (*,?) accepted]. location (str): SEED location code [wildcards (*,?) accepted]. channel (str): SEED channel code [wildcards (*,?) accepted]. starttime (obspy.core.utcdatetime.UTCDateTime): Start time for data request. endtime (obspy.core.utcdatetime.UTCDateTime): End time for data request. watc_url (str, optional): URL for WATC FDSN server. watc_username (str, optional): Username for WATC FDSN server. watc_password (str, optional): Password for WATC FDSN server.- Returns:
Stream of gathered waveforms for the specified time increment.
- Return type:
- waveform_collection.server.parallel_gather(source, network, station, location, channel, starttime, endtime, n_jobs, watc_url=None, watc_username=None, watc_password=None, increment_s=86400)[source]
Gather waveforms incrementally and parallelize by time, station, or location using multiple cores.
- Parameters:
source (str) – The data source to use for waveform retrieval.
network (str) – SEED network code [wildcards (
*,?) accepted].station (str) – SEED station code [wildcards (
*,?) accepted].location (str) – SEED location code [wildcards (
*,?) accepted].channel (str) – SEED channel code [wildcards (
*,?) accepted].starttime (obspy.core.utcdatetime.UTCDateTime) – Start time for data request.
endtime (obspy.core.utcdatetime.UTCDateTime) – End time for data request.
n_jobs (int) – Number of CPUs to use for parallel processing. If n_jobs = -1, all CPUs are used. If n_jobs < -1, (n_cpus + 1 + n_jobs) are used.
watc_url (str, optional) – URL for WATC FDSN server.
watc_username (str, optional) – Username for WATC FDSN server.
watc_password (str, optional) – Password for WATC FDSN server.
increment_s (int, optional) – Time increment in seconds for each parallel task. Default is 24 hours (86400 seconds).
- Returns:
Combined stream of gathered waveforms.
- Return type: