; This is main.pro ; ****************************** ; Open an output ascii file iout=20 openw,iout,'f.out' printf,iout,' ' printf,iout,' /ur/massie/bp/' ; ****************************** for ii=0,3 do begin ; Open the ps file if (ii eq 0) then begin fileps='/ur/massie/bp/graphs/bp78.ps' title='Steven Massie, 7-8 AM' labelx='Day of Year, 2025' labely='Blood Pressure, mmHG' fsaveset='/ur/massie/bp/saveset/bp78.sav' endif if (ii eq 1) then begin fileps='/ur/massie/bp/graphs/bp45.ps' title='Steven Massie, 4-5 PM' labelx='Day of Year, 2025' labely='Blood Pressure, mmHG' fsaveset='/ur/massie/bp/saveset/bp45.sav' endif if (ii eq 2) then begin fileps='/ur/massie/bp/graphs/pulse78.ps' title='Steven Massie, 7-8 AM' labelx='Day of Year, 2025' labely='Pulse, bpm' fsaveset='/ur/massie/bp/saveset/pulse78.sav' endif if (ii eq 3) then begin fileps='/ur/massie/bp/graphs/pulse45.ps' title='Steven Massie, 4-5 PM' labelx='Day of Year, 2025' labely='Pulse, bpm' fsaveset='/ur/massie/bp/saveset/pulse45.sav' endif set_plot, 'ps' device, /color, bits_per_pixel=8, file=fileps,$ /portrait,/inch,ysize=9.0,xsize=7.0,xoffset=0.6,yoffset=1.0 ; ****************************** ; have graphs plus the color bar ; [ignore,horizontal,vertical] !P.MULTI=[0,1,1] ; Load the color table loadct,26 ; Bold fonts !P.font=0 ; ****************************** x1a=0.20 x2a=0.80 y1a=0.20 y2a=0.80 ; if (ii eq 0) then begin ; y1a=0.20 ; y2a=0.80 ; endif ; if (ii eq 1) then begin ; y1a=0.50 ; y2a=0.70 ; endif ; if (ii eq 2) then begin ; y1a=0.25 ; y2a=0.45 ; endif ; if (ii eq 3) then begin ; y1a=0.05 ; y2a=0.20 ; endif ; ****************************** npts1=13 xday78=fltarr(npts1) ysys78=fltarr(npts1) ydia78=fltarr(npts1) ypls78=fltarr(npts1) xday78=[339,339,340,341,342,343,344,345,346,347,348,349,350] ysys78=[111,116,104,106,105,114,104,113,106,118,108,119,115] ydia78=[63,64,66,67,64,66,66,67,62,71,64,71,71] ypls78=[67,74,73,75,71,75,65,64,60,73,71,89,90] npts2=13 xday45=fltarr(npts2) ysys45=fltarr(npts2) ydia45=fltarr(npts2) ypls45=fltarr(npts1) xday45=[339,339,340,340,341,342,343,344,345,346,347,348,349] ysys45=[111,116,111,118,109,112,115,110,107,129,117,112,129] ydia45=[63,64,64,60,61,69,58,66,66,73,69,65,70] ypls45=[67,74,66,59,63,70,61,65,69,64,80,83,89] ; ****************************** ; blood pressure if (ii eq 0) then begin nvec0=npts1 nvec=2*npts1 clrvals=60.0 clrvald=20.0 ymax=130.0 ymin=60.0 irange=1 endif ; blood pressure if (ii eq 1) then begin nvec0=npts2 nvec=2*npts2 clrvals=60.0 clrvald=20.0 ymax=130.0 ymin=60.0 irange=1 endif ; pulse if (ii eq 2) then begin nvec0=npts1 nvec=2*npts1 clrvals=60.0 clrvald=20.0 ymax=100.0 ymin=50.0 irange=1 endif ; pulse if (ii eq 3) then begin nvec0=npts2 nvec=2*npts2 clrvals=60.0 clrvald=20.0 ymax=100.0 ymin=50.0 irange=1 endif itot=nvec xvec=fltarr(nvec) yvec=fltarr(nvec) isym=fltarr(nvec) clri=fltarr(nvec) ; **** j=-1 for i=0,nvec0-1 do begin j=j+1 isym(j)=4 clri(j)=clrvals endfor for i=0,nvec0-1 do begin j=j+1 isym(j)=4 clri(j)=clrvald endfor ; **** ave1=0.0 aven1=0.0 ave2=0.0 aven2=0.0 ; **** if (ii eq 0) then begin j=-1 for i=0,nvec0-1 do begin j=j+1 xvec(j)=xday78(i) yvec(j)=ysys78(i) ave1=ave1+yvec(j) aven1=aven1+1.00 endfor for i=0,nvec0-1 do begin j=j+1 xvec(j)=xday78(i) yvec(j)=ydia78(i) ave2=ave2+yvec(j) aven2=aven2+1.00 endfor endif ; **** if (ii eq 1) then begin j=-1 for i=0,nvec0-1 do begin j=j+1 xvec(j)=xday45(i) yvec(j)=ysys45(i) ave1=ave1+yvec(j) aven1=aven1+1.00 endfor for i=0,nvec0-1 do begin j=j+1 xvec(j)=xday45(i) yvec(j)=ydia45(i) ave2=ave2+yvec(j) aven2=aven2+1.00 endfor endif ; **** ; pulse if (ii eq 2) then begin j=-1 for i=0,nvec0-1 do begin j=j+1 xvec(j)=xday78(i) yvec(j)=ypls78(i) ave1=ave1+yvec(j) aven1=aven1+1.00 endfor for i=0,nvec0-1 do begin j=j+1 xvec(j)=xday78(i) yvec(j)=ypls78(i) ave2=ave2+yvec(j) aven2=aven2+1.00 endfor endif ; **** ; pulse if (ii eq 3) then begin j=-1 for i=0,nvec0-1 do begin j=j+1 xvec(j)=xday45(i) yvec(j)=ypls45(i) ave1=ave1+yvec(j) aven1=aven1+1.00 endfor for i=0,nvec0-1 do begin j=j+1 xvec(j)=xday45(i) yvec(j)=ypls45(i) ave2=ave2+yvec(j) aven2=aven2+1.00 endfor endif ; ****************************** ave1=ave1/aven1 ave2=ave2/aven2 n31=3*aven1 n32=3*aven2 printf,iout,' ' printf,iout,' main: ii ',ii printf,iout,' main: ave1,ave2 ',ave1,ave2 printf,iout,' main: aven1,aven2 ',aven1,aven2 printf,iout,' main: 3*aven1,3*aven2 ',n31,n32 ; ****************************** ; Graph the data ioplot=0 igraphpts=1 xmin=min(xvec) xmax=max(xvec) if (irange eq 0) then begin ymin=min(yvec) ymax=max(yvec) endif graphxyc62,iout,xvec,yvec,isym,itot,labelx,labely,title,clri,$ x1a,x2a,y1a,y2a,ioplot,xmin,xmax,ymin,ymax,igraphpts save,xvec,yvec,isym,itot,labelx,labely,title,clri,$ ioplot,xmin,xmax,ymin,ymax,igraphpts,$ file=fsaveset print,' wrote to ',fsaveset ; ****************************** device,/close print,fileps endfor ; ****************************** ; Graph all four panels on the same page fileps='/ur/massie/bp/graphs/alldat.ps' set_plot, 'ps' device, /color, bits_per_pixel=8, file=fileps,$ /portrait,/inch,ysize=9.0,xsize=7.0,xoffset=0.6,yoffset=1.0 ; have graphs plus the color bar ; [ignore,horizontal,vertical] !P.MULTI=[0,2,2] ; Load the color table loadct,26 ; Bold fonts !P.font=0 for ii=0,3 do begin if (ii eq 0) then begin fsaveset='/ur/massie/bp/saveset/bp78.sav' x1a=0.15 x2a=0.45 y1a=0.50 y2a=0.80 endif if (ii eq 1) then begin fsaveset='/ur/massie/bp/saveset/bp45.sav' x1a=0.60 x2a=0.90 y1a=0.50 y2a=0.80 endif if (ii eq 2) then begin fsaveset='/ur/massie/bp/saveset/pulse78.sav' x1a=0.15 x2a=0.45 y1a=0.10 y2a=0.40 endif if (ii eq 3) then begin fsaveset='/ur/massie/bp/saveset/pulse45.sav' x1a=0.60 x2a=0.90 y1a=0.10 y2a=0.40 xx=0.50 yy=0.44 cc=0.0 cth=2.0 ; xstr='shots: Flu 273, TDAP 295, COVID 309' xstr='Averages: SYS(7-8) 111, SYS(4-5) 115, DIA(7-8) 66, DIA(4-5) 65, PULSE 73,70' xyouts,xx,yy,xstr,CHARSIZE=1.0,COLOR=cc,/NORMAL,ALIGNMENT=0.5,$ CHARTHICK=cth endif restore,fsaveset graphxyc62,iout,xvec,yvec,isym,itot,labelx,labely,title,clri,$ x1a,x2a,y1a,y2a,ioplot,xmin,xmax,ymin,ymax,igraphpts endfor device,/close print,fileps ; ****************************** stop end