;************************************************************************* ;NAME : fstplot (procedure) ;FUNCTION : display observation status in the header file ;DATE : 91/09/30, 91/12/25, 93/04/27 ;PROGRAMMER : k.i. ; ======================================================================== ;************************************************************************* function flttime,timestr ; timestring (hh:mm:ss) --> float value (h) hh=float(strmid(timestr,0,2)) mm=float(strmid(timestr,3,2)) ss=float(strmid(timestr,6,2)) return,hh + mm/60. + ss/3600. end ;******************************************************************** ;NAME : plotfst (procedure) ;FUNCTION : plot 10-cm observation log in header file ;DATE : 1991/10/01 ;PROGRAMMER : k.i. ;******************************************************************** pro plotfst,fst,fix=fix,y00=y00,printout=printout,date=date ; fst : array of header structure ; fix : fix x-axis scale, dots / 1 hour ; y00 : lower mergin in dots ; date : date for compressed fst (ftstatusz) ; --------------- get status arrays ------------------- nn=n_elements(fst) l0=fst.l0 ; solar brighteness gx=fst.g_balx ; x- guide balance gy=fst.g_baly ; y- guide balance t=flttime(fst.time) ; time (hour) from 00:00:00 if not keyword_set(date) then date=fst(0).date t0=float(strmid(fst(0).time,0,2)) t1=float(strmid(fst(nn-1).time,0,2))+1.0 capture=fst.tst(2)/128 t1_obs=fst.ost(1) t2_obs=fst.ost(2) t3_obs=fst.ost(3) t4_obs=fst.ost(4) temp0=fst.temp(0)/100. temp1=fst.temp(1)/100. t1_ftemp=fst.t1_ftemp/100. t4_ftemp=fst.t4_ftemp/100. ;t0=5 ;t1=19 if(total(l0)/nn gt 2000) then l0=l0-2048 if(total(gx)/nn gt 1000) then gx=gx-2048 if(total(gy)/nn gt 1000) then gy=gy-2048 ; ---------------- modify color table ------------------ r=[0,1,1,0,0,1,1,0] ; 0.black 3.green 6.purple g=[0,1,0,1,0,1,0,1] ; 1.white 4.blue 7.light blue b=[0,1,0,0,1,0,1,1] ; 2.red 5.yellow ncolor=!d.n_colors tvlct,ncolor*r,ncolor*g,ncolor*b ; ---------------- plotting initial routine ---------------------- wy=620 x0m=70. & x1m=70. ; left & right mergin of x in device unit y0m=50. & y1m=70. ; " y if keyword_set(y00) then y0m=y00 win_x=float(!d.x_size) ; window x-size win_y=float(!d.y_size) ; window y-size !p.multi=[0,1,1] if keyword_set(fix) then begin ; x0 ~ y1 normal unit dx=fix ; x-length of 1 hour in device unit x0m=x0m*dx/60 & x1m=x1m*dx/60 win_x_fix=x0m+x1m+(t1-t0)*dx if(win_x_fix gt win_x) then begin ; open a larger window win_x=win_x_fix ;device,get_screen_size=ws ws=[1100,900] if not keyword_set(printout) then $ window,xpos=200,ypos=ws(1)-wy,xsize=win_x,ysize=win_y, $ title='flare telescope status' endif x0=x0m/win_x & x1=x0+(t1-t0)*dx/win_x y0=y0m/win_y & y1=(win_y-y1m)/win_y wx=x1-x0 & wy=y1-y0 endif else begin x0=x0m/win_x & x1=(win_x-x1m)/win_x y0=y0m/win_y & y1=(win_y-y1m)/win_y wx=x1-x0 & wy=y1-y0 endelse posl0=[x0, y0+wy*0.7, x1, y1] ; normal coordinate posgx=[x0, y0+wy*0.65, x1, y0+wy*0.7] posgy=[x0, y0+wy*0.6, x1, y0+wy*0.65] poscapt=[x0, y0+wy*0.5,x1, y0+wy*0.1] y0_capt=y0+wy*0.55 y0_t1=y0+wy*0.5 y0_t2=y0+wy*0.46 y0_t3=y0+wy*0.42 y0_t4=y0+wy*0.38 postempf=[x0, y0+wy*0.25, x1, y0+wy*0.34] ; normal coordinate postemp0=[x0, y0, x1, y0+wy*0.25] ; normal coordinate ; ---------------- plotting routine ---------------------- plot,[x0,x1,x1,x0,x0],[y0,y0,y1,y1,y0],pos=[0,0,1,1], $ xstyle=1+4,ystyle=1+4,xrange=[0,1],yrange=[0,1],color=1 plot,t,l0,/nodata,color=1, $ ; ----- l0 ----- pos=posl0,charsize=1.2,/noerase, $ xstyle=1,xrange=[t0,t1],xtickname=replicate(' ',fix(t1-t0+1)), $ xticks=fix(t1-t0),xminor=6,xticklen=0.03, $ ystyle=1+8,ytitle='brightness',yrange=[0,1700] xyouts,x0/2,y1+0.03,'!5Flare Telescope Observation Status : '+"'"+date, $ size=1.4,/normal,charthick=1.8 oplot,t,l0,psym=4,symsize=0.1,color=5 ; '+' symbol xyouts,x0,y0,'!3' plot,t,gx,/nodata,color=1, $ ; ----- gx ----- pos=posgx,charsize=1.2,/noerase, $ xstyle=1+4,xrange=[t0,t1], $ ytitle='!3gx',yrange=[-200,200],yticks=2,yminor=2, $ ytickname=replicate(' ',5) oplot,[t0,t1],[0,0],color=1 oplot,t,gx,psym=3,symsize=0.1,color=2 plot,t,gy,/nodata,color=1, $ ; ----- gy ----- pos=posgy,charsize=1.2,/noerase, $ xstyle=1+4,xrange=[t0,t1], $ ytitle='gy',yrange=[-200,200],yticks=2,yminor=2, $ ytickname=replicate(' ',5) oplot,[t0,t1],[0,0] oplot,t,gy,psym=3,symsize=0.1,color=2 plot,t,capture,/nodata,color=1, $ ; ----- capture ----- pos=[x0,0,x1,1],charsize=1.2,/noerase, $ xstyle=1+4,xrange=[t0,t1], $ ystyle=1+4,yrange=[0,1] icapture=where(capture eq 1, count) if count ne 0 then $ oplot,t(icapture),replicate(y0_capt,n_elements(icapture)), $ psym=3,symsize=0.01,color=3 xyouts,x0-0.08,y0_capt,'capture',/norm ; ------ T1 obs. ------ it1=where(t1_obs eq 10,count) if count ne 0 then $ oplot,t(it1),replicate(y0_t1,n_elements(it1)), $ psym=3,symsize=0.01,color=4 it1=where(t1_obs eq 11,count) if count ne 0 then $ oplot,t(it1),replicate(y0_t1-0.005,n_elements(it1)), $ psym=3,symsize=0.01,color=4 it1=where(t1_obs eq 4 or t1_obs eq 5, count) if count ne 0 then $ oplot,t(it1),replicate(y0_t1+0.005,n_elements(it1)), $ psym=3,symsize=0.005,color=2 xyouts,x0-0.05,y0_t1,'T1',/norm ; ------ T2 obs. ------ it2=where(t2_obs eq 10, count) if count ne 0 then $ oplot,t(it2),replicate(y0_t2,n_elements(it2)), $ psym=3,symsize=0.01,color=4 it2=where(t2_obs eq 11, count) if count ne 0 then $ oplot,t(it2),replicate(y0_t2-0.005,n_elements(it2)), $ psym=3,symsize=0.01,color=4 it2=where(t2_obs eq 4 or t2_obs eq 5, count) if count ne 0 then $ oplot,t(it2),replicate(y0_t2+0.005,n_elements(it2)), $ psym=3,symsize=0.005,color=2 xyouts,x0-0.05,y0_t2,'T2',/norm ; ------ T3 obs. ------ it3=where(t3_obs eq 10, count) if count ne 0 then $ oplot,t(it3),replicate(y0_t3,n_elements(it3)), $ psym=3,symsize=0.01,color=4 it3=where(t3_obs eq 11, count) if count ne 0 then $ oplot,t(it3),replicate(y0_t3-0.005,n_elements(it3)), $ psym=3,symsize=0.01,color=4 it3=where(t3_obs eq 4 or t3_obs eq 5, count) if count ne 0 then $ oplot,t(it3),replicate(y0_t3+0.005,n_elements(it3)), $ psym=3,symsize=0.005,color=2 xyouts,x0-0.05,y0_t3,'T3',/norm ; ------ T4 obs. ------ it4=where(t4_obs eq 10, count) if count ne 0 then $ oplot,t(it4),replicate(y0_t4,n_elements(it4)), $ psym=3,symsize=0.01,color=4 it4=where(t4_obs eq 11, count) if count ne 0 then $ oplot,t(it4),replicate(y0_t4-0.005,n_elements(it4)), $ psym=3,symsize=0.01,color=4 it4=where(t4_obs eq 4 or t4_obs eq 5, count) if count ne 0 then $ oplot,t(it4),replicate(y0_t4+0.005,n_elements(it4)), $ psym=3,symsize=0.005,color=2 xyouts,x0-0.05,y0_t4,'T4',/norm plot,t,t1_ftemp,/nodata,color=1, $ ; ----- filter temp. ----- pos=postempf,charsize=1.2,/noerase, $ xstyle=1+4,xrange=[t0,t1], $ ystyle=1+8,ytitle='f-temp',yrange=[45.,46.5] oplot,t,t1_ftemp,psym=4,symsize=0.1,color=5 ; '+' symbol oplot,t,t4_ftemp,psym=4,symsize=0.1,color=6 ; '+' symbol ;temp0=temp0>(-5)<43 plot,t,temp0,/nodata,color=1, $ ; ----- temperatures ----- pos=postemp0,charsize=1.2,/noerase, $ xstyle=1+4,xrange=[t0,t1], $ ystyle=1+8,yrange=[0.,40.], $ ytitle='temp.' oplot,t,temp0,psym=4,symsize=0.1,color=3 ; '+' symbol oplot,t,temp1,psym=1,symsize=0.1,color=4 ; '+' symbol plot,[0,0],[0,0],/nodata,color=1, $ ; ----- xaxis ----- pos=[x0, y0, x1, y0+wy*0.1],charsize=1.2,/noerase, $ xstyle=1+8,xrange=[t0,t1], $ xtitle='time (JST)', $ xticks=fix(t1-t0),xminor=6,xticklen=0.1, $ ystyle=1+4,yrange=[0,2] return end ;************************************************************************* pro scircle,ox,oy,r,p=p,sc=sc ; draw circle if not keyword_set(sc) then sc=1 nn=360 i=indgen(nn+1) dth=2*!pi/nn x=ox+r*cos(dth*i) y=oy+r*sin(dth*i) plot,x*sc,y*sc,/noerase,pos=[0,0,!d.x_size-1,!d.y_size-1], $ xstyle=1+4,xrange=[0.,!d.x_size-1], $ ystyle=1+4,yrange=[0.,!d.y_size-1] if n_elements(p) ne 0 then begin r1=r+10 & r2=r+25 pcos=cos(!pi*P/360.) & psin=sin(!pi*P/360.) x=ox-psin*[r1,r2] y=oy+pcos*[r1,r2] plot,x*sc,y*sc,/noerase,pos=[0,0,!d.x_size-1,!d.y_size-1], $ xstyle=1+4,xrange=[0.,!d.x_size-1], $ ystyle=1+4,yrange=[0.,!d.y_size-1] x=ox-pcos*[r1,r2] y=oy-psin*[r1,r2] plot,x*sc,y*sc,/noerase,pos=[0,0,!d.x_size-1,!d.y_size-1], $ xstyle=1+4,xrange=[0.,!d.x_size-1], $ ystyle=1+4,yrange=[0.,!d.y_size-1] x=ox+psin*[r1,r2] y=oy-pcos*[r1,r2] plot,x*sc,y*sc,/noerase,pos=[0,0,!d.x_size-1,!d.y_size-1], $ xstyle=1+4,xrange=[0.,!d.x_size-1], $ ystyle=1+4,yrange=[0.,!d.y_size-1] x=ox+pcos*[r1,r2] y=oy+psin*[r1,r2] plot,x*sc,y*sc,/noerase,pos=[0,0,!d.x_size-1,!d.y_size-1], $ xstyle=1+4,xrange=[0.,!d.x_size-1], $ ystyle=1+4,yrange=[0.,!d.y_size-1] endif end ;******************************************************************** ;NAME : regions (procedure) ;FUNCTION : draw regions of observation ;DATE : 1992/12/05 ;PROGRAMMER : k.i. ;******************************************************************** pro regions,fst,fix=fix,sc=sc,date=date ; fst : array of header structure ; fix : fix x-axis scale, dots / 1 hour pix1=pix_size('ft1') ; arc sec. for 1 pixel of CCD devp1=5. ; arcsec for 1 pixel of window device if keyword_set(sc) then sc=sc else sc=1 nn=n_elements(fst) gxp=fst.gx gyp=-fst.gy ; 93/02/05 - !!! cc=abs(shift(gxp,-1)-gxp)+abs(shift(gyp,-1)-gyp) ii=where(cc eq 0) ; where gx & gy are constant ip=ii(0) i0=ip px=gxp(ii(0)) py=gyp(ii(0)) time1=fst(ii(0)).time time2='' no=0 count=0 nii=n_elements(ii) for i=1,nii-1 do begin if ii(i)-ii(i-1) ne 1 then begin px=[px,gxp(ii(i))] py=[py,gyp(ii(i))] time1=[time1,fst(ii(i)).time] time2=[time2,fst(ii(i-1)).time] no=[no,count] count=0 endif else begin count=count+1 endelse endfor nint=n_elements(px) time2=[time2,fst(ii(nii-1)).time] time2=time2(1:nint) no=[no,count] no=no(1:nint) garcsec,px,py ; ==> px, py in unit of arcsec from D.C. for j=0,nint-1 do $ print,str_gpos(px(j),py(j)),' ',time1(j),'-',time2(j),no(j) ; ------------ draw ------------- if sc eq 1 then $ window,2,xpos=0,ypos=400,xsize=800,ysize=500 ; -- plot solar circle -- ox=220 & oy=270 sr=1900 ; solar radius in arcsec r=sr/devp1/2 if not keyword_set(date) then date=fst(0).date print,date polangle,date,fst(0).time,P,B0,L0 print,'P=',P,' degree' scircle,ox,oy,r,p=P,sc=sc ; --- plot box --- hx=512*pix1/2 hy=480*pix1/2 comx=460 & comy=430 for j=0,nint-1 do begin l=flttime(time2(j))-flttime(time1(j)) if l lt 1./6. then linestyle=1 if l ge 1./6. and l lt 1. then linestyle=4 if l ge 1. then linestyle=0 if l ge 3. then thick=2 else thick=1 x=ox+px(j)/devp1+[-hx,hx,hx,-hx,-hx]/devp1 y=oy+py(j)/devp1+[-hy,-hy,hy,hy,-hy]/devp1 plot,x*sc,y*sc,/noerase,pos=[0,0,!d.x_size-1,!d.y_size-1], $ xstyle=1+4,xrange=[0.,!d.x_size-1], $ ystyle=1+4,yrange=[0.,!d.y_size-1], $ linestyle=linestyle,thick=thick xyouts,(ox+px(j)/devp1)*sc,(oy+py(j)/devp1)*sc,/dev, $ string(j+1,format='(I2)') com=string(j+1,format='(I2)')+'. '+str_gpos(px(j),py(j)) $ +' '+time1(j)+'-'+time2(j)+' (' $ +string(l,format='(f5.2)')+')' wc=fix(6+sc/2) wh=15+sc for k=0,strlen(com)-1 do $ xyouts,(comx+wc*k)*sc,(comy-j*wh)*sc, $ strmid(com,k,1),/dev endfor return end ;************************************************************************* ;NAME : fstplot (procedure) ;************************************************************************* pro fstplot,var=var,file=file,stdir=stdir ; var : if set x-scale is variable ; file : status filename, if set print to pcpr and return ; stdir : directory of status file on_ioerror,lab1 dx=60 ; x-scale, dots / 1 hour ;device,get_screen_size=ws ws=[1100,900] wx=600 ; display window size wy=600 if n_elements(file) eq 0 then begin window,0,xpos=200,ypos=ws(1)-wy,xsize=wx,ysize=wy loadct,0 endif ;----------- get header file information ---------------- if keyword_set(stdir) eq 0 then stdir='/data/ftobs/status' cans='' ;print,format='("enter status file directory ( default=",A," ) ",$)',stdir ;read,cans if cans ne '' then stdir=cans count=0 loop: if n_elements(file) eq 0 then begin print,'select data from menu' stfile=lsmenu(stdir,ret=['print','exit'],init=i,x=10,y=35) if( stfile eq 'exit' ) then stop if( stfile eq 'print' ) then goto,printout stfile=stdir+'/'+stfile endif else begin stfile=file(count) endelse print,'status file : ',stfile spawn,'filesize '+stfile,ss tz=strmid(stfile,strlen(stfile)-1,1) if tz eq 'z' then begin nn=fix(long(ss(0))/36l) date=strmid(stfile,strlen(stfile)-10,2)+'/' $ +strmid(stfile,strlen(stfile)-8,2)+'/' $ +strmid(stfile,strlen(stfile)-6,2) fst1=ftstatusz() endif else begin nn=fix(long(ss(0))/156l) date='' fst1=ftstatus() endelse print,nn,' status counted' if(nn le 1) then begin print,'# of status less than 1 !!' count=count+1 goto,loop endif fst=replicate(fst1,nn) openr,1,stfile readu,1,fst close,1 if tz eq 't' then begin if(fst(0).one eq 256) then begin for i=0,nn-1 do begin fst1=fst(i) fstswab,fst1 fst(i)=fst1 endfor endif endif if n_elements(file) ge 1 then goto,printout wset,0 if keyword_set(var) then plotfst,fst,date=date $ else plotfst,fst,fix=dx,date=date ans='' read,'Do you plot the target regions ? : ',ans if ans ne 'n' then regions,fst,date=date goto,loop printout: print,'printing out ------' set_plot,'ps' ;device,/landscape,xoffset=3,yoffset=26,ysize=13 device,xoffset=2.5,yoffset=2,ysize=25 ; x -> vertical, y -> horizontal (long side) if keyword_set(var) then plotfst,fst,/printout,date=date $ else plotfst,fst,fix=dx*23,y00=10000,/printout,date=date regions,fst,sc=15 device,/close spawn,'lpr -h idl.ps' device,/portrait set_plot,'x' count=count+1 if count lt n_elements(file) then goto,loop return lab1: print,'file_io error' end