コード例 #1
0
ファイル: algiccs.py プロジェクト: wbm06/aimbat
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)
コード例 #2
0
ファイル: algiccs.py プロジェクト: pysmo/aimbat
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)
コード例 #3
0
ファイル: prepdata.py プロジェクト: pysmo/aimbat
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
コード例 #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
コード例 #5
0
ファイル: plotphase.py プロジェクト: pysmo/aimbat
def getDataOpts():
    'Get SAC Data and Options'
    opts, ifiles = getOptions()
    pppara = ttconfig.PPConfig()
    gsac = sacpkl.loadData(ifiles, opts, pppara)
    opts.pppara = pppara
    return gsac, opts
コード例 #6
0
ファイル: plotphase.py プロジェクト: wbm06/aimbat
def getDataOpts():
    'Get SAC Data and Options'
    opts, ifiles = getOptions()
    pppara = ttconfig.PPConfig()
    gsac = sacpkl.loadData(ifiles, opts, pppara)
    opts.pppara = pppara
    return gsac, opts
コード例 #7
0
ファイル: egalign2.py プロジェクト: XStargate/aimbat
def load():
    "load data"
    opts, ifiles = getOptions()
    pppara = PPConfig()
    ccpara = CCConfig()
    gsac = loadData(ifiles, opts, pppara)
    if opts.filemode == "pkl":
        opts.fstack = None
    else:
        opts.fstack = ccpara.fstack
        gsac.stkdh = SacDataHdrs(opts.fstack, opts.delta)
    opts.pppara = pppara
    opts.ccpara = ccpara
    return gsac, opts
コード例 #8
0
ファイル: egalign2.py プロジェクト: unmover/aimbat
def load():
    'load data'
    opts, ifiles = getOptions()
    pppara = PPConfig()
    ccpara = CCConfig()
    gsac = loadData(ifiles, opts, pppara)
    if opts.filemode == 'pkl':
        opts.fstack = None
    else:
        opts.fstack = ccpara.fstack
        gsac.stkdh = SacDataHdrs(opts.fstack, opts.delta)
    opts.pppara = pppara
    opts.ccpara = ccpara
    return gsac, opts
コード例 #9
0
ファイル: pickphase.py プロジェクト: wbm06/aimbat
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
コード例 #10
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)