Пример #1
0
def main():

    if len(sys.argv) < 4:
        raise MTex.MTpyError_inputarguments('Need at least 3 arguments: <path to BIRRP executable> <station name> <directory for time series>')

    try:
        coherence_th = float(sys.argv[4])
        if not 0 < coherence_th <= 1: 
            raise
    except: 
        print 'coherence value invalid (float from interval ]0,1]) - set to 0.5 instead'
        coherence_th = 0.5

    birrp_exe_raw = sys.argv[1] 
    birrp_exe = op.abspath(op.realpath(birrp_exe_raw))

    if not op.isfile(birrp_exe):
        raise MTex.MTpyError_inputarguments('Birrp executable not existing: %s' % (birrp_exe))

    stationname = sys.argv[2].upper()

    ts_dir_raw = sys.argv[3]
    ts_dir = op.abspath(op.realpath(ts_dir_raw))


    if not op.isdir(ts_dir):
        raise MTex.MTpyError_inputarguments('Time series directory not existing: %s' % (ts_dir))

    if 1:
        MTbp.runbirrp2in2out_simple(birrp_exe, stationname, ts_dir, coherence_th)
Пример #2
0
def main():

    if len(sys.argv) < 5:
        print '\nNeed at least 4 arguments: <path to BIRRP executable> '\
                        '<station name> <remote station name> <directory for'\
                        ' time series>\n\n'\
                        'Optional arguments: \n [coherence threshold]\n'\
                        ' [start time] \n [end time]\n\n'
        return

    try:
        coherence_th = float(sys.argv[5])
        if not 0 < coherence_th <= 1: 
            raise
    except: 
        print ' Warning - Coherence value invalid (float from interval ]0,1]) '\
                '- set to 0.5 instead'
        coherence_th = 0.5

    try:
        starttime = float(sys.argv[6])
    except:
        starttime = None

    try:
        endtime = float(sys.argv[7])
    except:
        endtime = None
    

    birrp_exe_raw = sys.argv[1] 
    birrp_exe = op.abspath(op.realpath(birrp_exe_raw))

    if not op.isfile(birrp_exe):
        print '\nError - Birrp executable not existing: {0}\n'.format(birrp_exe)

    stationname = sys.argv[2].upper()
    rr_stationname = sys.argv[3].upper()

    ts_dir_raw = sys.argv[4]
    ts_dir = op.abspath(op.realpath(ts_dir_raw))


    if not op.isdir(ts_dir):
        print '\nError - Time series directory not existing: {0}\n'.format(ts_dir)
        return

    try:
        MTbp.runbirrp2in2out_simple(birrp_exe, stationname, ts_dir,coherence_th, 
                                    rr_stationname, None, starttime, endtime)
    except:
        print '\nERROR - Could not process input data using BIRRP'
        return
Пример #3
0
def main():

    if len(sys.argv) < 5:
        print '\nNeed at least 4 arguments: <path to BIRRP executable> '\
                        '<station name> <remote station name> <directory for'\
                        ' time series>\n\n'\
                        'Optional arguments: \n [coherence threshold]\n'\
                        ' [start time] \n [end time]\n\n'
        return

    try:
        coherence_th = float(sys.argv[5])
        if not 0 < coherence_th <= 1:
            raise
    except:
        print ' Warning - Coherence value invalid (float from interval ]0,1]) '\
                '- set to 0.5 instead'
        coherence_th = 0.5

    try:
        starttime = float(sys.argv[6])
    except:
        starttime = None

    try:
        endtime = float(sys.argv[7])
    except:
        endtime = None

    birrp_exe_raw = sys.argv[1]
    birrp_exe = op.abspath(op.realpath(birrp_exe_raw))

    if not op.isfile(birrp_exe):
        print '\nError - Birrp executable not existing: {0}\n'.format(
            birrp_exe)

    stationname = sys.argv[2].upper()
    rr_stationname = sys.argv[3].upper()

    ts_dir_raw = sys.argv[4]
    ts_dir = op.abspath(op.realpath(ts_dir_raw))

    if not op.isdir(ts_dir):
        print '\nError - Time series directory not existing: {0}\n'.format(
            ts_dir)
        return

    if 1:
        MTbp.runbirrp2in2out_simple(birrp_exe, stationname, ts_dir,
                                    coherence_th, rr_stationname, None,
                                    starttime, endtime)
def main():

    if len(sys.argv) < 4:
        print '\nNeed at least 3 arguments: <path to BIRRP executable> '\
                        '<station name> <directory for time series>\n\n'\
                        'Optional arguments: \n [coherence threshold]\n'\
                        ' [start time] \n [end time]\n\n'
        return

    try:
        coherence_th = float(sys.argv[4])
        if not 0 < coherence_th <= 1:
            raise
    except:
        print 'coherence value invalid (float from interval ]0,1]) - set to 0.5 instead'
        coherence_th = 0.5

    try:
        starttime = float(sys.argv[5])
    except:
        starttime = None

    try:
        endtime = float(sys.argv[6])
    except:
        endtime = None

    birrp_exe_raw = sys.argv[1]
    birrp_exe = op.abspath(op.realpath(birrp_exe_raw))

    if not op.isfile(birrp_exe):
        raise MTex.MTpyError_inputarguments(
            'Birrp executable not existing: %s' % (birrp_exe))

    stationname = sys.argv[2].upper()

    ts_dir_raw = sys.argv[3]
    ts_dir = op.abspath(op.realpath(ts_dir_raw))

    if not op.isdir(ts_dir):
        raise MTex.MTpyError_inputarguments(
            'Time series directory not existing: %s' % (ts_dir))

    if 1:
        MTbp.runbirrp2in2out_simple(birrp_exe, stationname, ts_dir,
                                    coherence_th, None, None, starttime,
                                    endtime)
def main():

    if len(sys.argv) < 4:
        print '\nNeed at least 3 arguments: <path to BIRRP executable> '\
                        '<station name> <directory for time series>\n\n'\
                        'Optional arguments: \n [coherence threshold]\n'\
                        ' [start time] \n [end time]\n\n'
        return

    try:
        coherence_th = float(sys.argv[4])
        if not 0 < coherence_th <= 1: 
            raise
    except: 
        print 'coherence value invalid (float from interval ]0,1]) - set to 0.5 instead'
        coherence_th = 0.5

    try:
        starttime = float(sys.argv[5])
    except:
        starttime = None

    try:
        endtime = float(sys.argv[6])
    except:
        endtime = None
    

    birrp_exe_raw = sys.argv[1] 
    birrp_exe = op.abspath(op.realpath(birrp_exe_raw))

    if not op.isfile(birrp_exe):
        raise MTex.MTpyError_inputarguments('Birrp executable not existing: %s' % (birrp_exe))

    stationname = sys.argv[2].upper()

    ts_dir_raw = sys.argv[3]
    ts_dir = op.abspath(op.realpath(ts_dir_raw))


    if not op.isdir(ts_dir):
        raise MTex.MTpyError_inputarguments('Time series directory not existing: %s' % (ts_dir))

    if 1:
        MTbp.runbirrp2in2out_simple(birrp_exe, stationname, ts_dir, coherence_th,
                                                    None, None, starttime, endtime)