Exemple #1
0
def get_rxy_sac(nr, st0):
    from subroutine_CLEAN_3c import grt
    import numpy as np
    rx = np.zeros(nr)
    ry = np.zeros(nr)
    for i in range(nr):
        decl, dist, az, baz = grt(st0[0].stats.sac.stla, st0[0].stats.sac.stlo,
                                  st0[i].stats.sac.stla, st0[i].stats.sac.stlo)
        rx[i] = decl * np.cos(0.017453 * (90.0 - az))
        ry[i] = decl * np.sin(0.017453 * (90.0 - az))
    return rx, ry
def get_rxy_sac(nr, st0):
    from subroutine_CLEAN_3c import grt
    import numpy as np

    rx = np.zeros(nr)
    ry = np.zeros(nr)
    for i in range(nr):
        decl, dist, az, baz = grt(
            st0[0].stats.sac.stla, st0[0].stats.sac.stlo, st0[i].stats.sac.stla, st0[i].stats.sac.stlo
        )
        rx[i] = decl * np.cos(0.017453 * (90.0 - az))
        ry[i] = decl * np.sin(0.017453 * (90.0 - az))
    return rx, ry
def metric_mseed(st, d, nr):
    import numpy as np
    import scipy as sp
    from subroutine_CLEAN_3c import grt

    """
    function takes data matrix and returns interstation distances rx and ry (vectors) in [deg].
    """
    rx_0, ry_0 = d[st[0].stats.station]
    rx = np.zeros(nr)
    ry = np.zeros(nr)
    for i in range(nr):
        rx_i, ry_i = d[st[i].stats.station]
        decl, dist, az, baz = grt(float(rx_0), float(ry_0), float(rx_i), float(ry_i))
        # decl,dist,az,baz = ut.grt(st[0].stats.sac.stla,st[0].stats.sac.stlo,st[i].stats.sac.stla,st[i].stats.sac.stlo)
        rx[i] = decl * sp.cos(0.017453 * (90.0 - az))
        ry[i] = decl * sp.sin(0.017453 * (90.0 - az))
    return rx, ry
Exemple #4
0
def metric_mseed(st, d, nr):
    import numpy as np
    import scipy as sp
    from subroutine_CLEAN_3c import grt
    '''
    function takes data matrix and returns interstation distances rx and ry (vectors) in [deg].
    '''
    rx_0, ry_0 = d[st[0].stats.station]
    rx = np.zeros(nr)
    ry = np.zeros(nr)
    for i in range(nr):
        rx_i, ry_i = d[st[i].stats.station]
        decl, dist, az, baz = grt(float(rx_0), float(ry_0), float(rx_i),
                                  float(ry_i))
        #decl,dist,az,baz = ut.grt(st[0].stats.sac.stla,st[0].stats.sac.stlo,st[i].stats.sac.stla,st[i].stats.sac.stlo)
        rx[i] = decl * sp.cos(0.017453 * (90.0 - az))
        ry[i] = decl * sp.sin(0.017453 * (90.0 - az))
    return rx, ry