outDir='NM/testFigS/')
for i in range(50):
    tool.plotWaveformByMat(quakeLs[10][i], staInfos)
tool.plotWaveformByMat(quakeLs[0][25], staInfos)
tool.plotWaveformByMat(quakeLs[1][8], staInfos)

timeL0, mlL0, laL0, loL0, laL00, loL00 = tool.getCatalog()
timeL, laL, loL = tool.dayTimeDis(quakeLs,
                                  staInfos,
                                  mlL0,
                                  minCover=0.0,
                                  isBox=True)
tool.compareTime(timeL, timeL0, laL, loL, laL00, loL00)

quakeL = []
loc = locator(staInfos)
for qL in quakeLs:
    for q in qL:
        q, res = loc.locate(q, maxDT=50)
        if res < 2 and res > 0:
            print(q)
            quakeL.append(q)
tool.saveQuakeLs([quakeL], 'NM/phaseLsNM20190901All')
m=detecQuake.plotQuakeDis([quakeL],output='NM/quakeStaDis.pdf',R=[36,44,96,105],staInfos=staInfos,\
    markersize=0.8,alpha=0.6,minCover=0.2,minSta=3,cmd='.b',topo='Ordos.grd',laL0=laL0,loL0=loL0,isBox=True)

quakeLsTrain = tool.readQuakeLs('phaseLst_Train', staInfos)
dTimeL = []
for qL in quakeLsTrain:
    for q in qL:
        for r in q:
staInfos = sacTool.readStaInfos(staLstFile)
taupM = tool.quickTaupModel(modelFile='iaspTaupMat')
modelL = [trainPS.loadModel('modelP_320000_100-2-15'),\
trainPS.loadModel('modelS_320000_100-2-15')]
aMat = sacTool.areaMat(laL, loL, laN, loN)
staTimeML = detecQuake.getStaTimeL(staInfos, aMat, taupM=taupM)
quakeLs = list()
bSec = UTCDateTime(2015, 6, 1).timestamp + 0 * 86400 * 230
eSec = UTCDateTime(2015, 10, 1).timestamp + 0 * 86400 * 231

for date in range(int(bSec), int(eSec), 86400):
    dayNum = int(date / 86400)
    dayDir = workDir + 'output20190901/' + str(dayNum)
    if os.path.exists(dayDir):
        print('done')
        continue
    date = UTCDateTime(float(date))
    print('pick on ', date)
    staL = detecQuake.getStaL(staInfos, aMat, staTimeML,\
     modelL, date, getFileName=names.NMFileName,\
     mode='norm',f=[2,15])
    quakeLs.append(detecQuake.associateSta(staL, aMat, \
        staTimeML, timeR=10, maxDTime=3, N=1,locator=\
        locator(staInfos)))
    tool.saveQuakeLWaveform(staL, quakeLs[-1], \
        matDir=workDir+'output20190901/',\
            index0=-1500,index1=1500)
    tool.saveQuakeLs(quakeLs, workDir + 'phaseLsNM20190901V6')
    detecQuake.plotResS(staL, quakeLs[-1], outDir=workDir + 'output20190901/')
    staL = []
import mapTool as mt
import tomoDD
import locate
import iterconv
import locate
import matplotlib.pyplot as plt
import pyMFTCuda
import names
import time
import torch

staInfos = sacTool.readStaInfos('staLst_NM')

R = [37.5, 43, 95, 104.5]
RML = [38.7, 39.3, 101.8, 102]
loc = locate.locator(staInfos)
quakeTomoRelocLs = tool.readQuakeLs('NM/phaseLstTomoReloc', staInfos)
quakeWLXL=tool.selectQuake(quakeTomoRelocLs,RML,staInfos,minSta=8,maxCount=5,outDir='NM/output/',\
    minCover=0.7,laN=5,loN=5)
quakeWLXL=tool.selectQuake([quakeTomoL],RML,staInfos,minSta=6,maxCount=5,outDir='NM/output/',\
    minCover=0.7,laN=5,loN=5)
for quake in quakeWLXL:
    loc.locate(quake, isDel=True)

tool.saveQuakeLs([quakeWLXL], 'NM/phaseLstWLX')
WLXDIR = '/home/jiangyr/MatchLocate/NM2/'
tmpDir = WLXDIR + 'Template/'

for quake in quakeWLXL:
    sacTool.cutSacByQuakeForCmpAz(quake,staInfos,names.NMFileNameHour,R=[38,40,100,104],outDir=tmpDir,\
        decMul=2,B=0,E=70,isFromO=True,nameMode='ML',maxDT=30)
staInfos = sacTool.readStaInfos(staLstFile)
laL = [35, 45]
loL = [96, 105]
laN = 35
loN = 35
taupM = tool.quickTaupModel(modelFile='iaspTaupMat')
modelL = [trainPS.loadModel('modelP_320000_100-2-15'),\
trainPS.loadModel('modelS_320000_100-2-15')]#-with
aMat = sacTool.areaMat(laL, loL, laN, loN)
staTimeML = detecQuake.getStaTimeL(staInfos, aMat, taupM=taupM)
quakeLs = list()
bSec = UTCDateTime(2015, 1, 1).timestamp + 0 * 86400 * 230
eSec = UTCDateTime(2015, 2, 1).timestamp + 0 * 86400 * 231

for date in range(int(bSec), int(eSec), 86400):
    dayNum = int(date / 86400)
    dayDir = workDir + 'output20191003/' + str(dayNum)
    if os.path.exists(dayDir):
        print('done')
        continue
    date = UTCDateTime(float(date))
    print('pick on ', date)
    staL = detecQuake.getStaL(staInfos, aMat, staTimeML, modelL, date, \
        getFileName=names.NMFileName,mode='norm',f=[2,15])
    quakeLs.append(detecQuake.associateSta(staL, aMat, staTimeML,\
     timeR=10, maxDTime=3, N=1,locator=locator(staInfos)))
    tool.saveQuakeLWaveform(staL, quakeLs[-1], matDir=workDir+'output20191003/',\
            index0=-1500,index1=1500)
    tool.saveQuakeLs(quakeLs, workDir + 'phaseLsNM20191003V7')
    detecQuake.plotResS(staL, quakeLs[-1], outDir=workDir + 'output20191003/')
    staL = []
Пример #5
0
modelL = [trainPS.loadModel('modelPNew2_15'),trainPS.loadModel('modelSNew2_15')]
aMat=sacTool.areaMat(laL,loL,laN,loN)
staTimeML= detecQuake.getStaTimeL(staInfos, aMat, taupM=taupM)
quakeLs=list()

for i in range(181, 210):
    print('pick on ',i)
    date = UTCDateTime(2008,1,1)+i*86400
    dayNum=int(date.timestamp/86400)
    dayDir='output/'+str(dayNum)
    if os.path.exists(dayDir):
        print('done')
        continue
    staL = detecQuake.getStaL(staInfos, aMat, staTimeML, modelL, date, taupM=taupM, mode='mid')
    quakeLs.append(detecQuake.associateSta(staL, aMat, staTimeML, timeR=10, maxDTime=3, N=1,\
        locator=locator(staInfos)))
    tool.saveQuakeLs(quakeLs, 'phaseLst2')
    tool.saveQuakeLWaveform(staL, quakeLs[-1], matDir='output/')
    detecQuake.plotResS(staL,quakeLs[-1])

tool.saveQuakeLs(quakeLs, 'phaseLst2')

import os 
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
import detecQuake
#import trainPS
import sacTool
from imp import reload
from obspy import UTCDateTime
import numpy as np
import tool
Пример #6
0
        sacFileNames=sacFileNames+glob(fileP)
    return sacFileNames

taupM=tool.quickTaupModel(modelFile='iaspTaupMat')
laL=[32,44]
loL=[102,118]
laN=40
loN=40
modelL = [trainPS.loadModel('modelPNew2_15'),trainPS.loadModel('modelSNew2_15')]
aMat=sacTool.areaMat(laL,loL,laN,loN)
staTimeML= detecQuake.getStaTimeL(staInfos, aMat, taupM=taupM)
quakeLs=list()
bSec=UTCDateTime(2014,1,1).timestamp+0*86400*230
eSec=UTCDateTime(2017,2,4).timestamp+0*86400*231

for date in range(int(bSec),int(eSec),86400):
    dayNum=int(date/86400)
    dayDir='output/'+str(dayNum)
    if os.path.exists(dayDir):
        print('done')
        continue
    date=UTCDateTime(float(date))
    print('pick on ',date)
    #date = UTCDateTime(2015,1,1)+i*86400
    staL = detecQuake.getStaL(staInfos, aMat, staTimeML, modelL, date, getFileName=NMFileName,mode='mid')
    quakeLs.append(detecQuake.associateSta(staL, aMat, staTimeML, timeR=10, maxDTime=3, N=1,locator=locator(staInfos)))
    tool.saveQuakeLWaveform(staL, quakeLs[-1], matDir='output/')
    tool.saveQuakeLs(quakeLs, 'phaseLstHimaNewV100')
    detecQuake.plotResS(staL,quakeLs[-1])
    staL=[]