Exemple #1
0
def main():
    opts, ifiles = getOptions()
    ccpara = ttconfig.CCConfig()
    gsac = sacpkl.loadData(ifiles, opts, ccpara)
    opts.ccpara = ccpara
    ccpara.twcorr = opts.twcorr
    ccpara.cchdrs = [opts.ipick, opts.wpick]
    # check data coverage, initialize quality factors
    checkCoverage(gsac, opts)
    qualsort.initQual(gsac.saclist, opts.ccpara.hdrsel, opts.ccpara.qheaders)
    pdata.seisTimeData(gsac.saclist)

    if opts.auto_on:
        autoiccs(gsac, opts)
    elif opts.auto_on_all:
        print('Selecting all seismograms..')
        hdrsel = opts.ccpara.hdrsel
        for sacdh in gsac.saclist:
            sacdh.selected = True
            sacdh.sethdr(hdrsel, 'True')
        autoiccs(gsac, opts)
    else:
        stkdh, stkdata, quas = ccWeightStack(gsac.saclist, opts)
        gsac.stkdh = stkdh
        sacpkl.saveData(gsac, opts)
    if opts.plotiter:
        plotiter(stkdata)
Exemple #2
0
def main():
    opts, ifiles = getOptions()
    ccpara = ttconfig.CCConfig()
    gsac = sacpkl.loadData(ifiles, opts, ccpara)
    opts.ccpara = ccpara
    ccpara.twcorr = opts.twcorr
    ccpara.cchdrs = [opts.ipick, opts.wpick]
    # check data coverage, initialize quality factors
    checkCoverage(gsac, opts)
    qualsort.initQual(gsac.saclist, opts.ccpara.hdrsel, opts.ccpara.qheaders)

    if opts.auto_on:
        autoiccs(gsac, opts)
    elif opts.auto_on_all:
        print('Selecting all seismograms..')
        hdrsel = opts.ccpara.hdrsel
        for sacdh in gsac.saclist:
            sacdh.selected = True
            sacdh.sethdr(hdrsel, 'True')
        autoiccs(gsac, opts)
    else:
        stkdh, stkdata, quas = ccWeightStack(gsac.saclist, opts)
        gsac.stkdh = stkdh
        sacpkl.saveData(gsac, opts)
    if opts.plotiter:
        plotiter(stkdata)
Exemple #3
0
def paraDataOpts(opts, ifiles):
    'Common parameters, data and options'
    pppara = ttconfig.PPConfig()
    qcpara = ttconfig.QCConfig()
    ccpara = ttconfig.CCConfig()
    mcpara = ttconfig.MCConfig()
    gsac = sacpkl.loadData(ifiles, opts, pppara)
    mcpara.delta = opts.delta
    opts.qheaders = qcpara.qheaders
    opts.qweights = qcpara.qweights
    opts.qfactors = qcpara.qfactors
    opts.hdrsel = qcpara.hdrsel
    opts.fstack = ccpara.fstack
    ccpara.qqhdrs = qcpara.qheaders
    ccpara.twcorr = opts.twcorr
    # find phase:
    if opts.phase is None:
        phase = findPhase(ifiles[0])
        print ('Found phase to be: ' + phase + '\n')
    else:
        phase = opts.phase
    mcpara.phase = phase
    opts.qcpara = qcpara
    opts.ccpara = ccpara
    opts.mcpara = mcpara
    opts.pppara = pppara
    # initialize quality factors
    qualsort.initQual(gsac.saclist, opts.hdrsel, opts.qheaders)
    return gsac, opts
Exemple #4
0
def paraDataOpts(opts, ifiles):
    'Common parameters, data and options'
    pppara = ttconfig.PPConfig()
    qcpara = ttconfig.QCConfig()
    ccpara = ttconfig.CCConfig()
    mcpara = ttconfig.MCConfig()
    gsac = sacpkl.loadData(ifiles, opts, pppara)
    mcpara.delta = opts.delta
    opts.qheaders = qcpara.qheaders
    opts.qweights = qcpara.qweights
    opts.qfactors = qcpara.qfactors
    opts.hdrsel = qcpara.hdrsel
    opts.fstack = ccpara.fstack
    ccpara.qqhdrs = qcpara.qheaders
    ccpara.twcorr = opts.twcorr
    # find phase:
    if opts.phase is None:
        phase = findPhase(ifiles[0])
        print('Found phase to be: ' + phase + '\n')
    else:
        phase = opts.phase
    mcpara.phase = phase
    opts.qcpara = qcpara
    opts.ccpara = ccpara
    opts.mcpara = mcpara
    opts.pppara = pppara
    # initialize quality factors
    qualsort.initQual(gsac.saclist, opts.hdrsel, opts.qheaders)
    return gsac, opts
Exemple #5
0
def prepStack(opts):
    'Prep stack from existing sacfile opts.fstack'
    stkdh = sacpkl.SacDataHdrs(opts.fstack, opts.delta)
    seisTimeData([stkdh,])
    seisTimeWindow([stkdh,], opts.pppara.twhdrs)
    if opts.filterParameters['apply']:
        seisApplyFilter([stkdh,], opts.filterParameters)
    seisTimeRefr([stkdh,], opts)
    seisDataNorm([stkdh,], opts)
    qualsort.initQual([stkdh,], opts.hdrsel, opts.qheaders)
    return stkdh
Exemple #6
0
def getDataOpts():
    'Get SAC Data and Options'
    opts, ifiles = getOptions()
    pppara = ttconfig.PPConfig()
    gsac = sacpkl.loadData(ifiles, opts, pppara)
    opts.pppara = pppara
    opts.qheaders = pppara.qheaders
    opts.qfactors = pppara.qfactors
    opts.qweights = pppara.qweights
    opts.hdrsel = pppara.hdrsel
    opts.pick_on = True
    gsac = pdata.prepData(gsac, opts)
    qualsort.initQual(gsac.saclist, opts.hdrsel, opts.qheaders)
    sortSeis(gsac, opts)
    return gsac, opts
Exemple #7
0
def prepStack(opts):
    'Prep stack from existing sacfile opts.fstack'
    stkdh = sacpkl.SacDataHdrs(opts.fstack, opts.delta)
    seisTimeData([
        stkdh,
    ])
    seisTimeWindow([
        stkdh,
    ], opts.pppara.twhdrs)
    if opts.filterParameters['apply']:
        seisApplyFilter([
            stkdh,
        ], opts.filterParameters)
    seisTimeRefr([
        stkdh,
    ], opts)
    seisDataNorm([
        stkdh,
    ], opts)
    qualsort.initQual([
        stkdh,
    ], opts.hdrsel, opts.qheaders)
    return stkdh
Exemple #8
0
def main():
    opts, ifiles = getOptions()
    mcpara = ttconfig.MCConfig()
    gsac = sacpkl.loadData(ifiles, opts, mcpara)

    if opts.phase is None:
        phase = findPhase(ifiles[0])
        print('Found phase to be: ' + phase + '\n')
        mcpara.phase = phase

    opts.fstack = mcpara.fstack
    if opts.filemode == 'sac' and os.path.isfile(opts.fstack):
        print('Read array stack file: ' + opts.fstack)
        gsac.stkdh = sacpkl.SacDataHdrs(opts.fstack, opts.delta)

    getParams(gsac, mcpara, opts)
    if opts.allseis_on:
        solution = mccc(gsac, mcpara)
        gsac.selist, gsac.delist = gsac.saclist, []
    else:
        qualsort.initQual(gsac.saclist, mcpara.hdrsel, [])
        gsac.selist, gsac.delist = qualsort.seleSeis(gsac.saclist)
        solution = mccc(gsac, mcpara)
    sacpkl.saveData(gsac, opts)