;function ReadRFs,path ;+ ; NAME: ; ReadRFs ; PURPOSE: ; read a RF15-i datas ; ; CALLING EXAMPLES: ; ; xxx=ReadRFs('c:\951021.001') ; ; INPUTS: ; path - full path to the RF15-I soft X-ray data files ; ; ; OUTPUTS: ; returns RF15-I data buffer for soft X-ray channels ; ; MODIFICATION HISTORY: ; Written, Szymon Gburek 1998. ;- ;---------------------------------------------------- pro winplotr,xxx,t1,t2,date t=xxx(0,*)/32. ;co 1 sec s1=xxx(1,*)/2. ;na 1 sec s2=xxx(2,*)/2. ;na 1 sec s3=xxx(3,*)/2. ;na 1 sec h1=xxx(4,*)/2. ;na 1 sec ;y1,y2,y3,y4 -skala zliczen dla poszczegolnych kanalow ;t1,t2,zakres czasu ;------------------------------------------------------------- ;wstaw wartosc -1000. w miejscach odpowiadajacych przerwom w czasie ; nn=n_elements(t) k1=0 for k=0L,nn-2 do begin if(t(k+1)-t(k)) gt 2.1d0 then begin s1(k)=-1000. & s1(k+1)=-1000. s2(k)=-1000. & s2(k+1)=-1000. s3(k)=-1000. & s3(k+1)=-1000. h1(k)=-1000. & h1(k+1)=-1000. endif endfor ;------------------------------------------------------------- ;----- save current system variables ----------------- old_P=!P old_X=!X old_Y=!Y !P.BACKGROUND = 255 !P.color=0 !P.font=0 DEVICE, FONT = "ARIAL*BOLD*20" ;DEVICE, FONT = "Courier*15" ;/times,/isolatin1????????????? !p.multi=[0,0,4] !p.charsize=2 !X.MARGIN = [2,2] !X.OMARGIN = [10,4] !Y.MARGIN = [0,0] !Y.OMARGIN = [4,5] ;------- determine maximal values fo y axis --------- indx1=min(where(t/3600 gt t1)) indx2=max(where(t/3600 lt t2)) ;y1=1.05*max(xxx(1,indx1:indx2)) ;y2=1.05*max(xxx(2,indx1:indx2))-1. ;y3=1.05*max(xxx(3,indx1:indx2))-1. ;y4=1.05*max(xxx(4,indx1:indx2))-1. ; y range seting indx1=min(where(t/3600. gt t1)) indx2=max(where(t/3600. lt t2)) y1=1.05*max(s1(indx1:indx2)) y01=min(s1(indx1+where(s1(indx1:indx2) gt 0) > 0)) -1. > 1. y2=1.05*max(s2(indx1:indx2))-1. y02=min(s2(indx1+where(s2(indx1:indx2) gt 0) > 0)) -1. > 1. y3=1.05*max(s3(indx1:indx2))-1. y03=min(s3(indx1+where(s3(indx1:indx2) gt 0) > 0)) -1. > 1. y4=1.05*max(h1(indx1:indx2))-1. y04=min(h1(indx1+where(h1(indx1:indx2) gt 0) > 0)) -1. > 1. ;----------------------------------------------------- ;cy=550 ;window,0, xpos=300, ypos=0, xsize=0.61*cy+100, ysize=cy cx=900 window,0, xpos=100, ypos=0, xsize=cx, ysize=0.61*cx ;ymin=1. ymin=0. ticfunc='hmticks' t1S=t1*3600. t2S=t2*3600. h_min=floor(t1) h_max=ceil(t2) s_min=h_min*3600 s_max=h_max*3600 ;print, 'h_min=', h_min ;print, 'h_max=', h_max ;hour_val=(findgen(23)+1)*3600. ;h_min=floor(t1) ;h_max=ceil(t2) s_min=t1*3600. s_max=t2*3600. ;------- choose two hour intervals ------------- hour_val=get_tval(t1s,t2s, xminor) ;print, hour_val hour_ticks=hour_val ;count=0 index = WHERE( ((hour_val GE s_min) AND (hour_val LE s_max)) , count) ;Use Count to get the number of nonzero elements. ;print, 'count=',count ;Only subscript the array if it's safe. IF count NE 0 THEN hour_ticks = hour_val(index) ;hour_val=[8*3600., 12*3600., 22*3600.] ;sh=size(hour_val) ;XTCV=[0., 5*3600, 10*3600, 15*3600, 20*3600] ;XTCV=[5*3600., 10*3600., 15*3600.] XTCV=hour_ticks s_tcv=size(XTCV) ;stop ;xtc_mask=make_array(24, /string, value=' ') xtc_mask=make_array(30, /string, value=' ') !X.TICKV=XTCV !X.TICKNAME=xtc_mask !X.TICKS=s_tcv(1)-1 !X.TICKLEN=0.08 !X.MINOR=xminor !X.RANGE=[S_min,S_max] !Y.TICKFORMAT='(I10)' !P.CHARSIZE=2 !P.PSYM=10 plot,t,s1,yrange=[y01,y1],/ystyle, MIN_VALUE=-0.01 plot,t,s2,yrange=[y02,y2],/ystyle, MIN_VALUE=-0.01 plot,t,s3,yrange=[y03,y3],/ystyle, MIN_VALUE=-0.01 plot,t,h1,xtitle='time UT',XTICKFORMAT='hmticks', $ yrange=[y04,y4],/ystyle, MIN_VALUE=-1 ;print, 'min1=', min(xxx(1,*)) ;print, 'min2=', min(xxx(2,*)) ;print, 'min3=', min(xxx(3,*)) ;print, 'min4=', min(xxx(4,*)) cx=!D.x_size cy=!D.y_size BCK=READ_BMP('kevs.BMP',R,G,B) ;TVlct,r,g,b TVscl, BCK, cx-35, 55, /device BCK=READ_BMP('crate.BMP',R,G,B) TVscl, BCK, 5, cy/2-50, /device !P=old_P !P.color=0 !P.font=0 ;--------------- DISPLAY TITLE ----------------- DEVICE, FONT = "ARIAL*BOLD*30" XYOUTS, cx/2., cy-35, 'INTERBALL-Tail RF15-I SOFT X-RAY EMISSION ', /device, alignment=0.5 XYOUTS, cx/2., cy-70, date, /device, alignment=0.5 ;----- restore old system variables ----------------- !P=old_P !X=old_X !Y=old_Y end ;################################################## ;-------------- example of displaying one day datas -------------- ;date='950808' ;date='950809' ;date='950811' ;xxx=ReadRFs('T:\zk\siark\s'+date+'.001') ;sx=size(xxx) ;check=sx(0) ;if check NE 0 then begin ; time=xxx(0,*)/32. ;co 1 sec ; tmin=min(time/3600) & tmax=max(time/3600) ;print, tmin, tmax ;winplotRFs,xxx,tmin,tmax,date ;logwinplotRFs,xxx,tmin,tmax,date ;STFIG1AL,TIME, xxx,5,4,tmin,tmax,date ;graph=tvrd() ;WRITE_GIF, date+'.gif', graph ;endif ;end