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


Python Stream.count方法代碼示例

本文整理匯總了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):
開發者ID:ftilmann,項目名稱:miic,代碼行數:33,代碼來源:db.py


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