本文整理汇总了Python中obspy.core.Trace.stats["station"]方法的典型用法代码示例。如果您正苦于以下问题:Python Trace.stats["station"]方法的具体用法?Python Trace.stats["station"]怎么用?Python Trace.stats["station"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obspy.core.Trace
的用法示例。
在下文中一共展示了Trace.stats["station"]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: export_sac
# 需要导入模块: from obspy.core import Trace [as 别名]
# 或者: from obspy.core.Trace import stats["station"] [as 别名]
def export_sac(
db, filename, pair, components, filterid, corr, ncorr=0, sac_format=None, maxlag=None, cc_sampling_rate=None
):
if sac_format is None:
sac_format = get_config(db, "sac_format")
if maxlag is None:
maxlag = float(get_config(db, "maxlag"))
if cc_sampling_rate is None:
cc_sampling_rate = float(get_config(db, "cc_sampling_rate"))
try:
os.makedirs(os.path.split(filename)[0])
except:
pass
filename += ".SAC"
mytrace = Trace(data=corr)
mytrace.stats["station"] = pair
mytrace.stats["sampling_rate"] = cc_sampling_rate
mytrace.stats.sac = AttribDict()
mytrace.stats.sac.b = -maxlag
mytrace.stats.sac.depmin = np.min(corr)
mytrace.stats.sac.depmax = np.max(corr)
mytrace.stats.sac.depmen = np.mean(corr)
mytrace.stats.sac.scale = 1
mytrace.stats.sac.npts = len(corr)
st = Stream(traces=[mytrace])
st.write(filename, format="SAC")
del st
return
示例2: export_mseed
# 需要导入模块: from obspy.core import Trace [as 别名]
# 或者: from obspy.core.Trace import stats["station"] [as 别名]
def export_mseed(db, filename, pair, components, filterid, corr, ncorr=0, maxlag=None, cc_sampling_rate=None):
try:
os.makedirs(os.path.split(filename)[0])
except:
pass
filename += ".MSEED"
if maxlag is None:
maxlag = float(get_config(db, "maxlag"))
if cc_sampling_rate is None:
cc_sampling_rate = float(get_config(db, "cc_sampling_rate"))
mytrace = Trace(data=corr)
mytrace.stats["station"] = pair[:11]
mytrace.stats["sampling_rate"] = cc_sampling_rate
mytrace.stats["start_time"] = -maxlag
mytrace.stats["location"] = "%02i" % ncorr
st = Stream(traces=[mytrace])
st.write(filename, format="MSEED")
del st
return