Beispiel #1
0
def site2sachdr(s):
    """
    Accepts a fielded site table row and returns a dictionary of corresponding
    sac header field/value pairs.
    """
    keymap = {'stel': 'elev', 'stal': 'lat', 'stlo': 'lon'}
    hdr = _buildhdr(keymap, s)
    return hdr
Beispiel #2
0
def site2sachdr(s):
    """
    Accepts a fielded site table row and returns a dictionary of corresponding
    sac header field/value pairs.
    """
    keymap = {'stel': 'elev', 'stal': 'lat', 'stlo': 'lon'}
    hdr = _buildhdr(keymap, s)
    return hdr
Beispiel #3
0
def origin2sachdr(o):
    """
    Accepts a fielded origin table record and produces a dictionary of
    corresponding sac header field/value pairs.
    """
    keymap = {'evdp': 'depth', 'evla': 'lat', 'evlo': 'lon', 'kuser1': 'auth',
        'nevid': 'evid', 'norid': 'orid', 'user0': 'mb'}
    hdr = _buildhdr(keymap, o)
    return hdr
Beispiel #4
0
def wfdisc2obspyhdr(wf):
    # trace header
    keymap = {'npts': 'nsamp', 'calib': 'calib', 'channel': 'chan',
            'sampling_rate': 'samprate', 'station': 'sta'}
    obshdr = _buildhdr(keymap, wf)
    obshdr['starttime'] = UTCDateTime(float(wf.time))
    obshdr['delta'] = 1./wf.samprate

    return Stats(header=obshdr)
Beispiel #5
0
def origin2sachdr(o):
    """
    Accepts a fielded origin table record and produces a dictionary of
    corresponding sac header field/value pairs.
    """
    keymap = {'evdp': 'depth', 'evla': 'lat', 'evlo': 'lon', 'kuser1': 'auth',
        'nevid': 'evid', 'norid': 'orid', 'user0': 'mb'}
    hdr = _buildhdr(keymap, o)
    return hdr
Beispiel #6
0
def wfdisc2obspyhdr(wf):
    # trace header
    keymap = {"npts": "nsamp", "calib": "calib", "channel": "chan", "sampling_rate": "samprate", "station": "sta"}
    obshdr = _buildhdr(keymap, wf)
    obshdr["starttime"] = UTCDateTime(float(wf.time))
    obshdr["delta"] = 1.0 / wf.samprate

    # endtime?

    return Stats(header=obshdr)
Beispiel #7
0
def site2sachdr(s):
    """
    Accepts a fielded site table row and returns a dictionary of corresponding
    sac header field/value pairs.

    June 13, 2016 - added deast/dnorth output to SAC user7/8 header fields
    """
    keymap = {'stel': 'elev', 'stal': 'lat', 'stlo': 'lon',
        'user7': 'deast', 'user8': 'dnorth'}
    hdr = _buildhdr(keymap, s)
    return hdr
Beispiel #8
0
def wfdisc2obspyhdr(wf):
    """ ObsPy Stats dict from Wfdisc instance.
    """
    keymap = {
        'npts': 'nsamp',
        'calib': 'calib',
        'channel': 'chan',
        'sampling_rate': 'samprate',
        'station': 'sta'
    }
    obshdr = _buildhdr(keymap, wf)
    obshdr['starttime'] = UTCDateTime(float(wf.time))
    obshdr['delta'] = 1. / wf.samprate

    return Stats(header=obshdr)
Beispiel #9
0
def site2sachdr(s):
    """
    Accepts a fielded site table row and returns a dictionary of corresponding
    sac header field/value pairs.

    June 13, 2016 - added deast/dnorth output to SAC user7/8 header fields
    """
    keymap = {
        'stel': 'elev',
        'stal': 'lat',
        'stlo': 'lon',
        'user7': 'deast',
        'user8': 'dnorth'
    }
    hdr = _buildhdr(keymap, s)
    return hdr
Beispiel #10
0
def wfdisc2obspyhdr(wf):
    # trace header
    keymap = {
        'npts': 'nsamp',
        'calib': 'calib',
        'channel': 'chan',
        'sampling_rate': 'samprate',
        'station': 'sta'
    }
    obshdr = _buildhdr(keymap, wf)
    obshdr['starttime'] = UTCDateTime(float(wf.time))
    obshdr['delta'] = 1. / wf.samprate

    #endtime?

    return Stats(header=obshdr)
Beispiel #11
0
def affiliation2sachdr(af):
    keymap = {'network': 'net'}
    hdr = _buildhdr(keymap, af)
    return hdr
Beispiel #12
0
def sitechan2sachdr(sc):
    keymap = {'cmpaz': 'hang', 'cmpinc': 'vang'}
    hdr = _buildhdr(keymap, sc)
    return hdr
Beispiel #13
0
def affiliation2sachdr(af):
    keymap = {'network': 'net'}
    hdr = _buildhdr(keymap, af)
    return hdr
Beispiel #14
0
def sitechan2sachdr(sc):
    keymap = {'cmpaz': 'hang', 'cmpinc': 'vang'}
    hdr = _buildhdr(keymap, sc)
    return hdr