DoRLocate(Rquake)
DoRLocate()所属R语言包:Rquake
Locate a set of picks in native R format
找到一组精选的本地R格式
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This is a script to apply Vlocate. After picking arrival times on several earthquake events and saving them with swig, the saved files can be located sequentially with this wrapper function.
这是一个脚本将Vlocate。采摘后在几个地震事件的到达时间和保存他们痛饮,保存的文件,可以依次位于这个包装函数。
用法----------Usage----------
DoRLocate(LF, stas, vel, params=list(distwt = 100,
lambdareg=20,
REG = TRUE,
WTS = TRUE,
STOPPING = TRUE,
tolx = 0.005,
toly = 0.005,
tolz = 0.01, RESMAX = c(4,5),
maxITER = c(7, 5, 7, 4)
))
DoUWLocate(LF, stas, vel, params=list(distwt = 100,
lambdareg=20,
REG = TRUE,
WTS = TRUE,
STOPPING = TRUE,
tolx = 0.005,
toly = 0.005,
tolz = 0.01))
参数----------Arguments----------
参数:LF
List of file location to read (output of list.files)
列表文件的位置来读取(输出list.files)
参数:stas
list, station location: name, lat, lon, z (and correction if available)
列表,站的位置:名称,纬度,经度,Z(和修正如果有的话)
参数:vel
list, velocity structure
列表,速度结构;
参数:params
list, parameters for Vlocate function
列表,Vlocate功能参数
Details
详细信息----------Details----------
Use swig and viewCHAC to pick P and S-wave arrivals, mostly via the PickWin button. After an event has been saved to disk in a native R format (suffix RDATA), these can be loaded and located.
使用SWIG和viewCHAC的挑P和S波到达,,主要通过PickWin按钮。事件后已保存在本机R格式的磁盘(后缀RDATA),可以加载和位置。
The UW version is for files already picked and in the ascii-text UW-pickfile format.
威斯康星大学麦迪逊分校的版本是已经挑选和的ASCII文本UW-pickfile格式的文件。
值----------Value----------
list of earthquake location and error ellipsoids.
地震的地点和错误的椭球的列表。
(作者)----------Author(s)----------
Jonathan M. Lees<jonathan.lees@unc.edu>
参见----------See Also----------
Vlocate
Vlocate
实例----------Examples----------
## Not run: [#不运行:]
########## read in list of pick data[#########列表中的选图数据读取]
LF = list.files(path="./Detail_picks", pat="RDATA", full=TRUE)
### read in station location file[##站的位置文件中读取]
fsta = "/home/lees/Site/CHAC/staLLZ.txt"
stas = scan(file=fsta,what=list(name="", lat=0, lon=0, z=0))
stas$z = stas$z/1000
############ set the velocity (this vel is for a geothermal field in Califormia)[###########设置速度(此德维尔是为地热场Califormia)]
data(VELMOD1D)
vel= VELMOD1D
############# calculate the locations: (use default values)[############计算的位置:(使用默认值)]
KAM = DoRLocate(LF, stas, vel)
############ Done with earthquake locations....next pull data out of list[###########做地震的位置......往后拉数据列表]
N = length(KAM)
H = list(lat=vector(length=N), lon=vector(length=N),
z=vector(length=N), date=vector(length=N) , gap=vector(length=N),
herr =vector(length=N),
zerr=vector(length=N),
qual=vector(length=N))
for(i in 1:length(KAM))
{
zip = KAM[[i]]
H$lat[i] = zip$EQ$lat
H$lon[i] = zip$EQ$lon
H$z[i] = zip$EQ$z
H$date[i] = dateStamp(zip$EQ$Time)
H$gap[i] = zip$ERR$gap
H$herr[i] = zip$ERR$herr
H$zerr[i] = zip$ERR$sterrz
H$qual[i] = paste(zip$ERR$Q1, zip$ERR$Q2, sep="")
}
data.frame(H)
MLAT = median(stas$lat)
MLON = median(stas$lon)
proj = setPROJ(type=2, LAT0=MLAT, LON0=MLON)
staxy = GLOB.XY(stas$lat, stas$lon, proj)
zq = GLOB.XY(H$lat, H$lon, proj)
plot(c(staxy$x, zq$x) , c(staxy$y, zq$y), type='n', xlab="E, km",
ylab="N, km", asp=1)
points(staxy, pch=6, col='red')
points(zq, pch=8, col='blue')
XYerror.bars(zq$x, zq$y, zq$y-H$herr/2, zq$y+H$herr/2, zq$x-H$herr/2, zq$x+H$herr/2,
pch = 1, col =1, barw = 0.05, add = TRUE )
############# or: plot 95 percent confidence bounds[############或图95%的置信区间]
for(i in 1:length(KAM))
{
zip = KAM[[i]]
KOV = zip$ERR$cov[2:4, 2:4]
eqlipse(zq$x[i], zq$y[i] , KOV, wcols = c(1,2) , dof=zip$ERR$ndf, border="blue" )
}
######################################[#####################################]
###################################### UW format data[#####################################UW格式数据]
######################################[#####################################]
setwd("/home/lees/Progs/R_stuff/EARTHQUAKE")
stafile = "coso_sta.LLZ"
staf = stafile
stas = setstas(stafile )
pdir = "/home/lees/Progs/R_stuff/EARTHQUAKE/pfiles"
LF = list.files(path=pdir, pattern="p$", full.names=TRUE )
KAM = DoUWLocate(LF, stas, vel)
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|