from imp import reload
from obspy import UTCDateTime
import numpy as np
import tool
from glob import glob
from locate import locator
import names
import mapTool as mt
import matplotlib.pyplot as plt

plt.rcParams['font.sans-serif'] = ['Arial']
plt.rcParams['font.size'] = 6
staLstFile = 'staLst_NM_New'
workDir = '/home/jiangyr/accuratePickerV3/NM/'
R = [35, 45, 96, 105]  #[34,42,104,112]
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')
]
aMat = sacTool.areaMat(laL, loL, laN, loN)
staTimeML = detecQuake.getStaTimeL(staInfos, aMat, taupM=taupM)
quakeLs = list()
bSec = UTCDateTime(2014, 10, 1).timestamp + 0 * 86400 * 230
eSec = UTCDateTime(2015, 1, 1).timestamp + 0 * 86400 * 231
from glob import glob
import tool
import sacTool
staInfos = sacTool.readStaInfos('staLstAll')
staFileLst = tool.loadFileLst(staInfos, 'fileLst')
compL = {'BHE': '3', 'BHN': '2', 'BHZ': '1'}


def NMFileName(net, station, comp, YmdHMSJ):
    sacFileNames = list()
    Y = YmdHMSJ
    if net == 'GS' or net == 'NM':
        dir = '/media/jiangyr/shanxidata2/nmSacData/'
        staDir = dir + net + '.' + station + '/'
        YmDir = staDir + Y['Y'] + Y['m'] + '/'
        sacFileNamesStr = YmDir + net + '.' + station + '.' + Y['Y'] + Y[
            'm'] + Y['d'] + '.*' + comp + '*SAC'
        for file in glob(sacFileNamesStr):
            sacFileNames.append(file)
        return sacFileNames
    comp = compL[comp]
    if station in staFileLst:
        if YmdHMSJ['Y'][2:4] + '.' + YmdHMSJ['j'] + '_BH' in staFileLst[
                station]:
            staDir = staFileLst[station][YmdHMSJ['Y'][2:4] + '.' +
                                         YmdHMSJ['j'] + '_BH']
            fileP = staDir + '/??/' + YmdHMSJ['Y'][2:4] + '.' + YmdHMSJ[
                'j'] + '*' + comp + '.m'
            sacFileNames = sacFileNames + glob(fileP)
    return sacFileNames
예제 #3
0
import matplotlib.pyplot as plt
import pyMFTCuda
import names
import time
import torch
os.environ["MKL_NUM_THREADS"] = "10"
workDir = 'NM/'
f = [2, 8]
R = [37.5, 43, 95, 104.5]
deviceL = ['cuda:1']
quakeCCLsName = 'NM/phaseCCLstNew8'
sDate = UTCDateTime(2014, 12, 1, 0, 0, 0)
eDate = UTCDateTime(2015, 10, 1, 0, 0, 0)
#staInfos=sacTool.readStaInfos('staLst_NM_New')
cmpAz = sacTool.loadCmpAz()
staInfos = sacTool.readStaInfos('staLst_NM_New', cmpAz=cmpAz)
loc = locator(staInfos)

quakeLs = tool.readQuakeLs('NM/phaseLstNMALLReloc_removeBadSta', staInfos)
quakeTmpL = tool.readQuakeLs('NM/phaseLstTomoReloc_removeBadSta', staInfos)[0]
quakeCCLs = tool.readQuakeLs('NM/quakeCCLstNewAll', staInfos, isQuakeCC=True)

##plot quakeDis###
figDir = workDir + 'fig/'
detecQuake.plotQuakeDis(quakeLs, R=R, staInfos=staInfos, topo='Ordos.grd')
plt.savefig(figDir + 'quakeLsDis.png', dpi=500)
#plt.savefig(figDir+'quakeLsDis.eps')
plt.close()

detecQuake.plotQuakeDis([quakeTmpL],
                        R=R,
예제 #4
0
import detecQuake
import sacTool
from imp import reload
from obspy import UTCDateTime
import numpy as np
import tool
from glob import glob
from locate import locator
import matplotlib.pyplot as plt
import mapTool as mt
import tomoDD
import locate
import iterconv
R=[34,42,104,116]
cmpAz=sacTool.loadCmpAz()
staInfos=sacTool.readStaInfos('staLst_test',cmpAz=cmpAz)

staInfos=sacTool.readStaInfos('staLst_NM_New',cmpAz=cmpAz)

taupM=tool.quickTaupModel(modelFile='iaspTaupMat.mat')
quakeCCLs=list()
quakeLs=tool.readQuakeLsByP('phaseLstDir/phaseLstAll*',staInfos)
quakeCCLs=tool.readQuakeLsByP('NM/phaseCCLstNew?',staInfos)
quakeL=[]
R=[35,45,96,105]
for quakeLTmp in quakeLs:
    quakeL=quakeL+quakeLTmp
detecQuake.plotQuakeCCDis(quakeCCLs,quakeL,R=R,staInfos=staInfos,alpha=1,mul=0.1,markersize=0.05)

mt.plotInline([quakeL],[39,106],[40,107])
mt.plotInline([quakeL],[39,106],[40,107],along=False)
import tool
from glob import glob
from locate import locator
import matplotlib.pyplot as plt
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/'
예제 #6
0
import os 
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
import detecQuake
import trainPS
import sacTool
from imp import reload
from obspy import UTCDateTime
import numpy as np
import tool
from glob import glob
from locate import locator
staLstFile='staLstAll'
R=[34,42,104,116]#[34,42,104,112]
staInfos=sacTool.readStaInfos(staLstFile)
tool.getStaInArea(staInfos,'staLst_test',R)
staInfos=sacTool.readStaInfos('staLst_test')
staFileLst=tool.loadFileLst(staInfos,'fileLst')
compL={'BHE':'3','BHN':'2','BHZ':'1'}
def NMFileName(net, station, comp, YmdHMSJ):
    #dir='tmpSacFile/'
    comp0=comp
    sacFileNames = list()
    comp=compL[comp]
    if YmdHMSJ['Y'][2:4]+'.'+YmdHMSJ['j']+'_BH' in staFileLst[station]:
        staDir=staFileLst[station][YmdHMSJ['Y'][2:4]+'.'+YmdHMSJ['j']+'_BH']
        fileP=staDir+'/??/'+YmdHMSJ['Y'][2:4]+'.'+YmdHMSJ['j']+'*'+comp+'.m'
        sacFileNames=sacFileNames+glob(fileP)
    if len(sacFileNames)==0:
        sacDir='/media/jiangyr/Hima_Bak/hima31/'
        fileP=sacDir+YmdHMSJ['Y']+YmdHMSJ['m']+YmdHMSJ['d']+\
        '.'+YmdHMSJ['J']+'*/*.'+station+'*.'+comp0