def main():
    stations = 'PB01 PB02 PB03 PB04 PB05 PB06 PB07 PB08 HMBCX MNMCX PATCX PSGCX'

    components = 'Z'
    # TOcopilla earthquake: 2007-11-14 15:14
    t1 = UTC('2006-07-01')
    t2 = UTC('2008-12-31')

    shift = 500
    correlations = get_correlations(stations, components)

    method = 'FINAL_filter0.005-10_1bit_Tocopilla'

    data = IPOC(xcorr_append='/' + method, use_local_LVC=False)
    data.setXLogger('_' + method)
    pool = Pool()
    prepare(data, stations.split(), t1, t2, component=components,
            filter=(0.005, 10, 2, True), downsample=20,
            whitening=False,
            normalize='1bit', param_norm=None,
            pool=pool)
    noisexcorrf(data, correlations, t1, t2, shift, pool=pool)
    pool.close()
    pool.join()
    stack(data, correlations, dt=10 * 24 * 3600, shift=5 * 24 * 3600)
    stack(data, correlations, dt= -1)

    filters = None
    #filters = getFilters((0.005, 0.01, 0.1, 1, 5, 10), zerophase=True, corners=2)
#    plotXcorrs(data, correlations, t1, t2, start=None, end=None, filters=filters, plot_overview=True, plot_years=False, use_dlognorm=False,
#                      plot_stack=True, plot_psd=True, add_to_title='', downsample=None)
    plotXcorrs(data, correlations, t1=None, t2=None, start=None, end=None, filters=filters, plot_overview=True, plot_years=False, use_dlognorm=False,
                      plot_stack=True, plot_psd=True, add_to_title='', downsample=None, stack=('10days', '5days'))
def main():
    stations = 'PB01 PB02 PB03 PB04 PB05 PB06 PB07 PB08 HMBCX MNMCX PATCX PSGCX LVC'
    stations = 'PB09 PB10 PB11 PB12 PB13 PB14 PB15 PB16'
    stations = 'PB02 PB03 PB04 PB05 HMBCX MNMCX PSGCX'
    stations = 'PATCX'
    stations2 = None


    components = 'Z'
    # TOcopilla earthquake: 2007-11-14 15:14
    t1 = UTC('2007-01-01')
    #t1 = UTC('2007-12-01')
    #t2 = UTC('2008-12-31')
    #t2 = UTC('2012-10-01')
    t2 = UTC('2011-12-31')
    #t2 = UTC('2007-02-03')
#    t1 = UTC('2009-05-01')
#    t2 = UTC('2009-05-03')

    shift = 100
    shift = 60
    correlations = get_correlations(stations, components, stations2, only_auto=True)
    #correlations = get_correlations(stations, components, stations2)
    print correlations

    method = 'FINAL_filter4-6_1bit_auto'
    method = 'FINAL_filter4-6_1bit_auto_3C'
    method = 'FINAL_filter4-6_1bit_auto_hour2'

    data = IPOC(xcorr_append='/' + method, use_local_LVC=False)
    data.setXLogger('_' + method)

#    pool = Pool()
    pool = None
    prepare(data, stations.split(), t1, t2, component=components,
            filter=(4, 6, 2, True), downsample=50,
            eventremoval='waterlevel_env2', param_removal=(10, 0),
            whitening=False,
            normalize='1bit', param_norm=None,
            pool=pool, discard=0.1 * 24 * 3600, freq_domain=False, trim='day')
    noisexcorrf(data, correlations, t1, t2, shift, period=3600, pool=pool, overlap=1800)

#    noisexcorrf(data, correlations, t1, t2, shift, period=5 * 60, pool=pool,
#                max_preload=1000)
#    pool.close()
#    pool.join()

#    plotXcorrs(data, correlations, t1, t2, start=None, end=None, plot_overview=True, plot_years=False, use_dlognorm=False,
#                      plot_stack=True, plot_psd=False, add_to_title='', downsample=None)

    plotXcorrs(data, correlations, t1, t2, start= -20, end=20, plot_overview=True, plot_years=True, use_dlognorm=False,
                      plot_stack=True, plot_psd=False, add_to_title='', downsample=None, ext='_hg.png', vmax=0.1,
                      period=3600)
Example #3
0
def main():
    stations = 'PB01 PB02 PB03 PB04 PB05 PB06 PB07 PB08 HMBCX MNMCX PATCX PSGCX'

    components = 'Z'
    # TOcopilla earthquake: 2007-11-14 15:14
    t1 = UTC('2006-07-01')
    t2 = UTC('2008-12-31')

    shift = 500
    correlations = get_correlations(stations, components)

    method = 'FINAL_filter0.005-10_1bit_Tocopilla'

    data = IPOC(xcorr_append='/' + method, use_local_LVC=False)
    data.setXLogger('_' + method)
    pool = Pool()
    prepare(data,
            stations.split(),
            t1,
            t2,
            component=components,
            filter=(0.005, 10, 2, True),
            downsample=20,
            whitening=False,
            normalize='1bit',
            param_norm=None,
            pool=pool)
    noisexcorrf(data, correlations, t1, t2, shift, pool=pool)
    pool.close()
    pool.join()
    stack(data, correlations, dt=10 * 24 * 3600, shift=5 * 24 * 3600)
    stack(data, correlations, dt=-1)

    filters = None
    #filters = getFilters((0.005, 0.01, 0.1, 1, 5, 10), zerophase=True, corners=2)
    #    plotXcorrs(data, correlations, t1, t2, start=None, end=None, filters=filters, plot_overview=True, plot_years=False, use_dlognorm=False,
    #                      plot_stack=True, plot_psd=True, add_to_title='', downsample=None)
    plotXcorrs(data,
               correlations,
               t1=None,
               t2=None,
               start=None,
               end=None,
               filters=filters,
               plot_overview=True,
               plot_years=False,
               use_dlognorm=False,
               plot_stack=True,
               plot_psd=True,
               add_to_title='',
               downsample=None,
               stack=('10days', '5days'))
Example #4
0
def main():
    stations = 'PB01 PB02 PB03 PB04 PB05 PB06 PB07 PB08 HMBCX MNMCX PATCX PSGCX LVC'
    stations = 'PB09 PB10 PB11 PB12 PB13 PB14 PB15 PB16'
    stations = 'PATCX'
    stations2 = None


    components = 'Z'
    # TOcopilla earthquake: 2007-11-14 15:14
    t1 = UTC('2007-10-01')
    t2 = UTC('2007-11-30')
    #t2 = UTC('2012-10-01')
    #t2 = UTC('2011-12-31')
#    t1 = UTC('2009-05-01')
#    t2 = UTC('2009-05-03')

    shift = 100
    shift = 60
    #correlations = get_correlations(stations, components, stations2, only_auto=True)
    correlations = get_correlations(stations, components, stations2)
    print correlations

    method = 'zerotest_nozero'
    #method = 'FINAL_filter4-6_1bit_auto_3C'
    #method = 'FINAL_filter3-5'

    data = IPOC(xcorr_append='/' + method, use_local_LVC=False)
    data.setXLogger('_' + method)

    pool = Pool()
    prepare(data, stations.split(), t1, t2, component=components,
            filter=(4, 6, 2, True), downsample=50,
            #eventremoval='waterlevel_env2', param_removal=(10, 0),
            eventremoval=None, param_removal=None,
            whitening=False,
            normalize='1bit', param_norm=None,
            pool=pool)
    noisexcorrf(data, correlations, t1, t2, shift, period=24 * 3600, pool=pool)

#    noisexcorrf(data, correlations, t1, t2, shift, period=5 * 60, pool=pool,
#                max_preload=1000)
    pool.close()
    pool.join()

#    plotXcorrs(data, correlations, t1, t2, start=None, end=None, plot_overview=True, plot_years=False, use_dlognorm=False,
#                      plot_stack=True, plot_psd=False, add_to_title='', downsample=None)
    #plt.rc('font', size=16)
    plotXcorrs(data, correlations, t1, t2, start=-20, end=20, plot_overview=True, plot_years=False, use_dlognorm=False,
                      plot_stack=True, plot_psd=False, downsample=None, ext='_hg0.02_dis.pdf', vmax=0.02,
                      add_to_title='4-6Hz', ylabel=None)
def main():
    stations = (
        "PB01 PB02 PB03 PB04 PB05 PB06 PB07 PB08 PB09 PB10 PB11 PB12 PB13 PB14 PB15 PB16 HMBCX MNMCX PATCX PSGCX LVC"
    )
    # TAIQ
    stations2 = None

    components = "Z"
    # TOcopilla earthquake: 2007-11-14 15:14
    t1 = UTC("2006-01-01")
    # t2 = UTC('2011-09-01')
    # t1 = UTC('2007-01-01')
    # t2 = UTC('2009-01-01')
    t2 = UTC("2012-09-01")

    shift = 500
    correlations = get_correlations(stations, components, stations2)

    method = "FINAL_filter0.01-1_1bit"

    data = IPOC(xcorr_append="/" + method, use_local_LVC=False)
    data.setXLogger("_" + method)

    pool = Pool()
    prepare(
        data,
        stations.split(),
        t1,
        t2,
        component=components,
        filter=(0.01, 1, 2, True),
        downsample=10,
        eventremoval="waterlevel_env2",
        param_removal=(10, 0),
        whitening=False,
        normalize="1bit",
        param_norm=None,
        pool=pool,
    )
    noisexcorrf(data, correlations, t1, t2, shift, pool=pool)
    pool.close()
    pool.join()

    stack(data, correlations, dt=10 * 24 * 3600, shift=5 * 24 * 3600)
    stack(data, correlations, dt=50 * 24 * 3600, shift=5 * 24 * 3600)
    stack(data, correlations, dt=-1)

    plotXcorrs(
        data,
        correlations,
        t1,
        t2,
        start=None,
        end=None,
        plot_overview=True,
        plot_years=False,
        use_dlognorm=False,
        plot_stack=True,
        plot_psd=False,
        add_to_title="",
        downsample=None,
    )

    plotXcorrs(
        data,
        correlations,
        t1=None,
        t2=None,
        start=None,
        end=None,
        plot_overview=True,
        plot_years=False,
        use_dlognorm=False,
        plot_stack=True,
        plot_psd=False,
        add_to_title="",
        downsample=None,
        stack=("10days", "5days"),
    )

    plotXcorrs(
        data,
        correlations,
        t1=None,
        t2=None,
        start=None,
        end=None,
        plot_overview=True,
        plot_years=False,
        use_dlognorm=False,
        plot_stack=True,
        plot_psd=False,
        add_to_title="",
        downsample=None,
        stack=("50days", "5days"),
    )
def main():
    stations = 'PB01 PB02 PB03 PB04 PB05 PB06 PB07 PB08 PB09 PB10 PB11 PB12 PB13 PB14 PB15 PB16 HMBCX MNMCX PATCX PSGCX LVC'
    # TAIQ
    stations2 = None

    components = 'Z'
    # TOcopilla earthquake: 2007-11-14 15:14
    t1 = UTC('2006-01-01')
    #t2 = UTC('2011-09-01')
    #t1 = UTC('2007-01-01')
    #t2 = UTC('2009-01-01')
    t2 = UTC('2012-09-01')

    shift = 500
    correlations = get_correlations(stations, components, stations2)

    method = 'FINAL_filter0.01-1_1bit'

    data = IPOC(xcorr_append='/' + method, use_local_LVC=False)
    data.setXLogger('_' + method)

    pool = Pool()
    prepare(data,
            stations.split(),
            t1,
            t2,
            component=components,
            filter=(0.01, 1, 2, True),
            downsample=10,
            eventremoval='waterlevel_env2',
            param_removal=(10, 0),
            whitening=False,
            normalize='1bit',
            param_norm=None,
            pool=pool)
    noisexcorrf(data, correlations, t1, t2, shift, pool=pool)
    pool.close()
    pool.join()

    stack(data, correlations, dt=10 * 24 * 3600, shift=5 * 24 * 3600)
    stack(data, correlations, dt=50 * 24 * 3600, shift=5 * 24 * 3600)
    stack(data, correlations, dt=-1)

    plotXcorrs(data,
               correlations,
               t1,
               t2,
               start=None,
               end=None,
               plot_overview=True,
               plot_years=False,
               use_dlognorm=False,
               plot_stack=True,
               plot_psd=False,
               add_to_title='',
               downsample=None)

    plotXcorrs(data,
               correlations,
               t1=None,
               t2=None,
               start=None,
               end=None,
               plot_overview=True,
               plot_years=False,
               use_dlognorm=False,
               plot_stack=True,
               plot_psd=False,
               add_to_title='',
               downsample=None,
               stack=('10days', '5days'))

    plotXcorrs(data,
               correlations,
               t1=None,
               t2=None,
               start=None,
               end=None,
               plot_overview=True,
               plot_years=False,
               use_dlognorm=False,
               plot_stack=True,
               plot_psd=False,
               add_to_title='',
               downsample=None,
               stack=('50days', '5days'))