本文整理汇总了Python中obspy.core.AttribDict.items方法的典型用法代码示例。如果您正苦于以下问题:Python AttribDict.items方法的具体用法?Python AttribDict.items怎么用?Python AttribDict.items使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obspy.core.AttribDict
的用法示例。
在下文中一共展示了AttribDict.items方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: coincidenceTrigger
# 需要导入模块: from obspy.core import AttribDict [as 别名]
# 或者: from obspy.core.AttribDict import items [as 别名]
trig = coincidenceTrigger("recstalta", PAR.ON, PAR.OFF, st_trigger,
thr_coincidence_sum=PAR.MIN_STATIONS,
max_trigger_length=PAR.MAXLEN, trigger_off_extension=PAR.ALLOWANCE,
details=True, sta=PAR.STA, lta=PAR.LTA)
for t in trig:
info = "%s %ss %s %s" % (t['time'].strftime("%Y-%m-%dT%H:%M:%S"), ("%.1f" % t['duration']).rjust(4), ("%i" % t['cft_peak_wmean']).rjust(3), "-".join(t['stations']))
summary.append(info)
tmp = st.slice(t['time'] - 1, t['time'] + t['duration'])
outfilename = "%s/%s_%.1f_%i_%s-%s_%s.png" % (PLOTDIR, t['time'].strftime("%Y-%m-%dT%H:%M:%S"), t['duration'], t['cft_peak_wmean'], len(t['stations']), num_stations, "-".join(t['stations']))
tmp.plot(outfile=outfilename)
mutt += ("-a", outfilename)
summary.append("#" * 79)
summary = "\n".join(summary)
summary += "\n" + "\n".join(("%s=%s" % (k, v) for k, v in PAR.items()))
#print summary
open(SUMMARY, "at").write(summary + "\n")
# send emails
if MAILTO:
alert_lvl = 0
if len(trig) > 0:
alert_lvl = 1
for t in trig:
if t['cft_peak_wmean'] > 7:
alert_lvl = max(alert_lvl, 2)
elif t['cft_peak_wmean'] > 10:
alert_lvl = 3
mutt_base = ["mutt", "-s", "KW Alert %d %s - %s" % (alert_lvl, T1.strftime("%Y-%m-%dT%H:%M:%S"), T2.strftime("%Y-%m-%dT%H:%M:%S"))]
mutt = mutt_base + mutt + ['--'] + MAILTO