ps.options(horizontal=FALSE,onefile=FALSE)
ps.options(pagecentre=TRUE)
ps.options(paper="letter")
ps.options(width=7.0,height=5.0)

prefix <- "svsim"

particle<-read.table(paste(prefix,".usrvar.filter.csv",sep=""),header=T,sep=",")

fmean <- particle[,"filter_mean"]
smean <- particle[,"smooth_mean"]
fulim <- smean + 2.0*particle[,"filter_sdev"]
fllim <- smean - 2.0*particle[,"filter_sdev"]
sulim <- smean + 2.0*particle[,"smooth_sdev"]
sllim <- smean - 2.0*particle[,"smooth_sdev"]
true <- particle[,"x"]
data <- particle[,"y"]

mean <- smean
ulim <- sulim
llim <- sllim

ybot <- min(c(mean,ulim,llim,true))
ytop <- max(c(mean,ulim,llim,true))

xbot <- 1
xtop <- length(mean)

time <- seq(xbot,xtop)

postscript(file=paste(prefix,".particle_time.eps",sep=""))

ybot <- min(c(mean,ulim,llim,true))
ytop <- max(c(mean,ulim,llim,true))

plot(c(xbot,xtop),c(ybot,ytop),type="n",ylab="",xlab="")
  lines(time,mean,lty="solid",col="red")
  lines(time,ulim,lty="dashed")
  lines(time,llim,lty="dashed")
  lines(time,true,lty="solid",col="blue")
dev.off()

postscript(file=paste(prefix,".particle_scat.eps",sep=""))

plot(c(ybot,ytop),c(ybot,ytop),type="n",ylab="",xlab="")
  points(true,mean,pch="o")
  abline(lsfit(true,mean))
dev.off()
