if(interactive() ) {
data(KH)
amp = KH$JSTR[[1]]
OLDdt = KH$dt[1]
newdt = 0.1
yr = 2000
GIVE = FAKEDATA(amp, OLDdt=0.01, newdt = 0.1, yr = 2000,
JD = 4, mi = 12, sec = 0, Ntraces = 24*3,
seed=200, noise.est=c(1, 100) , verbose=TRUE )
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)
DB = FmakeDB(LF, kind=-1)
IDB = infoDB(DB)
pday <- 5
SAVEFILE <- tempfile()
ihour <- 15
inkhour <- .5
### days is a list of days (and associated years) that are in teh DB
days <- list(jd=c(4, 5, 6), yr=c(2000, 2000, 2000) )
aday = which(pday == days$jd)
#### aday refers to one of the days listed in the days structure
view.seis(aday, ihour, inkhour, SAVEFILE, days, DB, IDB$usta, IDB$ucomp, TZ=(-6))
}
Run the code above in your browser using DataLab