當前位置: 首頁>>代碼示例>>Python>>正文


Python Stream.plot方法代碼示例

本文整理匯總了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
開發者ID:rclement1,項目名稱:python,代碼行數:30,代碼來源:noisecodes.py

示例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)
開發者ID:gthompson,項目名稱:obspy,代碼行數:29,代碼來源:test_signal.py

示例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)
開發者ID:Ciack404,項目名稱:obspy,代碼行數:33,代碼來源:waveform_plotting_tutorial_6.py


注:本文中的obspy.core.stream.Stream.plot方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。