data(GH)
DD = data.frame(GH$info)
#### get only vertical traces
WV = which( GH$COMPS=='V' )
L1 = length(WV)
GIVE = vector(mode='list')
for(j in 1:L1 )
{
i = WV[j]
AA = DD[i,]
GIVE[[j]] = list(fn = AA$fn, sta =GH$STNS[i] , comp = GH$COMP[i],
dt = AA$dt, DATTIM = AA, N = AA$n1, units = NA,
coords = NA, amp = GH$JSTR[[i]] )
}
#### par(mfrow=c(length(GIVE) , 1) )
# for(i in 1:length(GIVE) ) { plotGH(GIVE[[i]]) }
tdir = tempdir()
for(i in 1:length(GIVE) )
{
sig = GIVE[[i]]
d1 = dateStamp(sig$DATTIM, sep='_')
nam1 = paste(d1,sig$sta, sig$comp, sep='_')
nam2 = paste0(nam1, '.RDS')
nam3 = paste(tdir, nam2, sep='/')
saveRDS(file=nam3, sig)
}
######################## Now read files and make the DataBase:
LF = list.files(path=tdir,pattern='.RDS', full.names=TRUE)
Gseis = GET.seis(LF, kind = -1, Iendian=1, BIGLONG=FALSE ,
HEADONLY=FALSE, PLOT = -1, RAW=FALSE)
zed <- prepSEIS(Gseis)
#### plot the data, and interact with the data
swig(zed, sel=which(zed$COMPS=='V'), SHOWONLY=0)
if(interactive()){ plotJGET(Gseis) }
### for data created on UNIX (SUN) but read on linux:
### S1 <- GET.seis(Lname, kind = 1, Iendian="swap", BIGLONG=FALSE, PLOT = -1)
### for data created on linux (32 bit) but read on linux 64 bit:
### S1 <- GET.seis(Lname, kind = 1, Iendian="little", BIGLONG=FALSE, PLOT = -1)
### for SEGY data created on linux (64 bit) but read on linux 32 bit:
### S1 <- GET.seis(Lname, kind = 1, Iendian="little", BIGLONG=TRUE, PLOT = -1)
### for SAC data created on MAC-OS (64 bit) but read on linux 32 bit:
### S1 <- GET.seis(Lname, kind = 2, Iendian="swap", BIGLONG=TRUE, PLOT = -1)
Run the code above in your browser using DataLab