本文整理汇总了Python中obspy.core.stream.Stream.plot方法的典型用法代码示例。如果您正苦于以下问题:Python Stream.plot方法的具体用法?Python Stream.plot怎么用?Python Stream.plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obspy.core.stream.Stream
的用法示例。
在下文中一共展示了Stream.plot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: merger
# 需要导入模块: from obspy.core.stream import Stream [as 别名]
# 或者: from obspy.core.stream.Stream import plot [as 别名]
def merger(noise_trace, st_events_poisson, samp_rate, delta):
""" Merges the noise with the events """
# Creates the stream with the noise and events
newnoise_t_formerging = noise_trace.slice(0, (st_events_poisson[-1].stats.endtime)+100)
seis = Stream()
seis += newnoise_t_formerging
seis += st_events_poisson
figs = plt.figure(figsize=(14,5))
seis.plot(fig = figs)
figs.suptitle("Noise and events", fontsize = 12)
ylab=figs.text(0.05, 0.5, 'Amplitude of signal', va='center',
rotation='vertical', fontsize=12)
figs.text(0.5, 0, 'Timestamp', ha='center', fontsize=12)
seis.merge()
seis += st_events_poisson
seis.merge(method = 1, interpolation_samples=-1)
figs = plt.figure(figsize=(14,5))
seis.plot(fig = figs)
plt.title("Synthetic seismogram", fontsize = 12)
ylab=figs.text(0.05, 0.5, 'Amplitude of signal', va='center',
rotation='vertical', fontsize=12)
figs.text(0.5, 0, 'Timestamp', ha='center', fontsize=12)
syn_seis = seis[0]
syn_seis.stats.sampling_rate = samp_rate
syn_seis.stats.delta = delta
return syn_seis
示例2: _plotResults
# 需要导入模块: from obspy.core.stream import Stream [as 别名]
# 或者: from obspy.core.stream.Stream import plot [as 别名]
def _plotResults(self):
"""
Plots original, filtered original and real time processed traces into
a single plot.
"""
# plot only if test is started manually
if __name__ != '__main__':
return
# create empty stream
st = Stream()
st.label = self._testMethodName
# original trace
self.orig_trace.label = "Original Trace"
st += self.orig_trace
# use header information of original trace with filtered trace data
tr = self.orig_trace.copy()
tr.data = self.filt_trace_data
tr.label = "Filtered original Trace"
st += tr
# real processed chunks
for i, tr in enumerate(self.rt_appended_traces):
tr.label = "RT Chunk %02d" % (i + 1)
st += tr
# real time processed trace
self.rt_trace.label = "RT Trace"
st += self.rt_trace
st.plot(automerge=False, color='blue', equal_scale=False)
示例3: Files
# 需要导入模块: from obspy.core.stream import Stream [as 别名]
# 或者: from obspy.core.stream.Stream import plot [as 别名]
from obspy.core.util import gps2DistAzimuth
host = 'http://examples.obspy.org/'
# Files (fmt: SAC)
files = ['TOK.2011.328.21.10.54.OKR01.HHN.inv',
'TOK.2011.328.21.10.54.OKR02.HHN.inv', 'TOK.2011.328.21.10.54.OKR03.HHN.inv',
'TOK.2011.328.21.10.54.OKR04.HHN.inv', 'TOK.2011.328.21.10.54.OKR05.HHN.inv',
'TOK.2011.328.21.10.54.OKR06.HHN.inv', 'TOK.2011.328.21.10.54.OKR07.HHN.inv',
'TOK.2011.328.21.10.54.OKR08.HHN.inv', 'TOK.2011.328.21.10.54.OKR09.HHN.inv',
'TOK.2011.328.21.10.54.OKR10.HHN.inv']
# Earthquakes' epicenter
eq_lat = 35.565
eq_lon = -96.792
# Reading the waveforms
st = Stream()
for waveform in files:
st += read(host + waveform)
# Calculating distance from SAC headers lat/lon
# (trace.stats.sac.stla and trace.stats.sac.stlo)
for tr in st:
tr.stats.distance = gps2DistAzimuth(tr.stats.sac.stla,
tr.stats.sac.stlo, eq_lat, eq_lon)[0]
# Setting Network name for plot title
tr.stats.network = 'TOK'
st.filter('bandpass', freqmin=0.1, freqmax=10)
# Plot
st.plot(type='section', plot_dx=20e3, recordlength=100,
time_down=True, linewidth=.25, grid_linewidth=.25)