【问题标题】:Python - How to transform counts in to m/s using the obspy modulePython - 如何使用 obspy 模块将计数转换为 m/s
【发布时间】:2021-05-20 11:47:08
【问题描述】:

我有一个带有单通道跟踪的 miniseed 文件,我假设数据是计数的(我如何检查跟踪的单位?)。我需要将其转换为 m/s。 我已经检查了 obspy 教程,我的主要问题是我不知道如何从 miniseed 文件中访问极点和零点以及放大因子。 另外,我需要校准文件吗?

这是我的代码:

from obspy.core import *
st=read('/Users/guilhermew/Documents/Projecto/Dados sismicos 1 dia/2012_130_DOC01.mseed')
st.plot()

提前致谢, 吉尔赫姆

编辑: 我终于明白如何转换数据了。 Obspy 有不同的方法来实现这一点,但这一切都归结为从波形数据中删除仪器响应。 就像@Robert Barsch 所说,我需要另一个文件来获取仪器响应元数据。 所以我想出了以下代码:

parser=Parser("dir/parser/file")
for tr in stream_aux:
    stream_id=tr.stats.network+'.'+tr.stats.station+ '..' + tr.stats.channel
    paz=parser.getPAZ(stream_id, tr.stats.starttime)
    df = tr.stats.sampling_rate
    tr.data = seisSim(tr.data, df, paz_remove=paz)

我使用 seisSim 函数来转换数据。 我现在的问题是输出看起来不正确(但我似乎无法发布图像)

【问题讨论】:

  • 我们需要一些代码,日期,任何东西,你不能只发布一个问题。记住我们没有写你的代码,我们看不到你的逻辑。
  • 从StackOverflow以代码为中心的角度来看,这个问题是没有问题的。
  • 我只有3行代码:这是我项目的第一步。对于这个结构糟糕的问题,我很抱歉,但我很迷茫。
  • 你能贴出那3行代码吗?

标签: python obspy


【解决方案1】:

这显然是应该向地震学界而不是 StackOverflow 提出的问题!写信给ObsPy user mailinglist怎么样?

更新:我仍然认为他/她应该直接在 ObsPy 邮件列表中询问。但是,为了对实际问题给出正确答案:MiniSEED 是一种纯数据格式,不包含任何元信息,例如极点和零点或使用的单位。所以是的,您将需要另一个文件,例如 RESP、SAC PAZ、Dataless SEED、Full SEED 等,以获取站点特定的元数据。要应用您的地震仪校正,请阅读http://docs.obspy.org/tutorial/code_snippets/seismometer_correction_simulation.html

【讨论】:

    【解决方案2】:

    要获得真实单位而不是计数,您需要删除仪器响应。我使用此代码删除仪器响应:

    # Define math defaults
    from __future__ import division #allows real devision without rounding
    
    # Retrieve modules needed
    from obspy.core import read
    import numpy as np
    import matplotlib.pyplot as plt
    
    #%% Choose and import data
    str1 = read(fileloc)
    print(str1) #show imported data
    print(str1[0].stats) #show stats for trace
    
    #%% Remove instrument response
    
    # create dictionary of poles and zeros
    TrillC = {'gain': 800.0,
            'poles': [complex(-3.691000e-02,3.712000e-02),
                      complex(-3.691000e-02,-3.712000e-02),
                      complex(-3.739000e+02,4.755000e+02),
                      complex(-3.739000e+02,-4.755000e+02),
                      complex(-5.884000e+02,1.508000e+03),
                      complex(-5.884000e+02,-1.508000e+03)],
            'sensitivity': 8.184000E+11,
            'zeros': [0 -4.341E+02]}
    str1_remres = str1.copy() #make a copy of data, so original isn't changed
    str1_remres.simulate(paz_remove=TrillC, paz_simulate=None, water_level=60.0)
    print("Instrument Response Removed")
    
    plt.figure()
    str1_remres_m = str1_remres.merge()
    plt.plot(str1_remres_m[0].data) #only will plot first trace of the stream
    

    如您所见,我手动定义了极点和零点。可能有一种方法可以自动输入它,但我发现这是可行的方法。

    记住每种乐器都有不同的极点和零点。

    您使用的零的数量取决于您希望输出的内容。地震仪通常是速度(2 个零)

    • 3 个零 = 位移
    • 2 个零 = 速度
    • 1 零 = 加速度

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多