本文整理匯總了Python中obspy.core.stream.Stream.count方法的典型用法代碼示例。如果您正苦於以下問題:Python Stream.count方法的具體用法?Python Stream.count怎麽用?Python Stream.count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類obspy.core.stream.Stream
的用法示例。
在下文中一共展示了Stream.count方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Stream
# 需要導入模塊: from obspy.core.stream import Stream [as 別名]
# 或者: from obspy.core.stream.Stream import count [as 別名]
# Create the Stream obj and populate it
st = Stream()
for (_, rec) in df.iterrows():
fname = os.path.join(rec['path'], rec['file'])
for tr in _read(fname, fformat, headonly=False, **kwargs).traces:
if (networks_ok) and (tr.stats.network not in networks):
continue
if (stations_ok) and (tr.stats.station not in stations):
continue
if (locations_ok) and (tr.stats.location not in locations):
continue
if (channels_ok) and (tr.stats.channel not in channels):
continue
st.append(tr)
if st.count() > 0:
# If the starttime is given then it trims the resulting traces
if starttime:
st.trim(starttime=starttime, endtime=endtime,
nearest_sample=nearest_sample)
st.merge(method=1, fill_value=0, interpolation_samples=1)
else:
print "Empty stream"
n_trace = st.count()
return st, n_trace
if BC_UI:
class _stream_dbread_view(HasTraits):