PRO showcv,nrun1,nrun2 ; This procedure makes a plots of current velocity from the boat-wake ; setup at Tiburon. A series of runs are read in one by one, cvss1 is ; graphed, and the graph is either displayed on the screen or written to ; a printer file. The series of runs in selected in the prodedure ; read1.pro. RWB, Jan 18 2000. ; This procedure is now moving towards automatic marking of scheduled ; passage of ferries and of the tide and current predictions. RWB, ; 3-15-00. IF n_params() ne 2 THEN BEGIN print,'Incorrect number of parameters.' print,'Calling sequence: showcv,irun1,irun2' RETURN ENDIF imarkf=0; Do not mark ferries. fname='/d4/Darmat/data/naut/ferry/fer9711.prn' openr,lun1,fname,/get_lun itype=0 bday=double(0.) iprint=0 chr1='' read,'Output to printer?' + $ '(enter 1 for printer, return for screen)',chr1 iprint = fix(chr1) IF iprint eq 1 THEN BEGIN set_plot,'ps' device,/landscape ENDIF !p.multi=0; one plot per page !p.multi=[0,2,2,0,0]; four plots per page FOR irun=nrun1,nrun2 do begin read1,irun restore npts=n_elements(cvss1); number of points in arrays. IF iprint eq 0 THEN read,'return to continue',chr1; delay xmax=float(npts) day1pst=day1-.3333333; change DOS time (GMT) to PST offset=double(fix(day1pst(0))); integer day number (floated) plot, (day1pst-offset)*24., cvss1- $ total(cvss1)/n_elements(cvss1), $ title=infile,xtitle= $ 'hour of the day (PST)', $ ytitle='Velocity (m/sec)',yrange=[-.2,.2], $ xstyle=1 d0 = day1pst(0) d1 = day1pst(npts-1) print,'d0, d1 = ',d0,d1 ; The next section marks the predicted times of ferry passage. while (imarkf eq 1) and (bday lt d1) do begin IF (bday gt d0) and (bday lt d1) THEN BEGIN print,'itype, bday = ', bday,itype xyouts,(bday-offset)*24.,0.17, $ strtrim(string(itype),1) oplot,[-.01,0,.01,0,0]+(bday-offset)*24., $ [.14,.13,.14,.13,.16] print,'(bday-offset)*24. = ',(bday-offset)*24. endif readf,lun1,'$(f15.5,i8)',bday,itype bday=bday-25569. ; conversion from Excel to DOS. print,'Just read from file: bday, itype = ',bday,itype endwhile ENDFOR IF iprint eq 1 THEN BEGIN device,/close set_plot,'x' ; spawn,'lp -o simplex idl.ps' ; this prints on only one side. ; spawn,'lp -s idl.ps'; print; -s for long jobs. ; spawn,'lp idl.ps'; standard print. ENDIF END