Splus << EOF #Plots the daily voltages values and the ratio of each instrument to the average for each day. # CHOOSE screen plot or postscript file for output. motif() ps.options(image.colors=xgetrgb('images'),colors=xgetrgb('lines')) postscript('plot.ps') # Parameters to set for specific instrument subdirectory #Solar Light plotFiles <- unix("ls /u3/ftp/pub/intercomparison_97/Ancillary/solar/tmsst*.97") Nrows<- unix("wc /u3/ftp/pub/intercomparison_97/Ancillary/solar/tmsst*.97 | cut -c 6-10") Nrows<-as.integer(Nrows) Ncol<-19 legend.nam <- c("Reference 501A #1916", "Reference 501A #2004", "Reference 501A #2005") # MULTIPLE PLOTS PER PAGE # -par command is for multiple plots, (1st#=#rows, 2nd#=#columns) par(mfrow=c(3,2)) frame() i <- 1 while (i <= length(plotFiles)) { julianDay<- substring(plotFiles[i],53,55) volt97<-matrix(scan(plotFiles[i],n=(Nrows[i]*Ncol)),nrow=Nrows[i],ncol=Ncol,byrow=T) volt97Avg<-(volt97[,5]+volt97[,6]+volt97[,7])/3. # Compute ratio ratio97a<-volt97[,5]/volt97Avg ratio97b<-volt97[,6]/volt97Avg ratio97c<-volt97[,7]/volt97Avg # Convert time to decimal number volt97[,4]<-volt97[,4]/100. itime97<-as.integer(volt97[,4]) hour97<-((volt97[,4]-itime97)*100)/60. time97<-itime97+hour97 # Times for integer zenith angle values # dat97<-c(12.58333,14.38333,16.13333,18.16667,19.90000,21.93333,23.68333) # Plot matplot(time97,volt97[,5],type="p",pch=18,tck=.02,col=1,xlab="GMT Time, hr",ylab="Signal (mV)",xlim=c(1,24),lab=c(8,8,4)) points(time97,volt97[,6],type="p",pch=15,col=2) points(time97,volt97[,7],type="p",pch=17,col=3) # axis(3,dat97,c("80","60","40","20","20","40","60")) text(12,1.12,"") ymax<-max(volt97[,5]) if (i==1){ legend(2.,ymax,legend.nam, marks=c(18,15,17),col=c(1,2,3)) } header<- paste("Julian Day ", julianDay, " 1997", sep="") title(main=header) matplot(time97,ratio97a,type="p",pch=18,tck=.02,col=1,xlab="GMT Time, hr",ylab="Instrument Voltage/Average Voltage",xlim=c(14,24),ylim=c(0.85,1.15),lab=c(8,8,4)) points(time97,ratio97b,type="p",pch=15,col=2) points(time97,ratio97c,type="p",pch=17,col=3) i <- i + 1 } EOF