;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 pssht, xxx_soft, xxx_hard,t1,t2,date, info_str t=xxx_soft(0,*)/32. ;co 1 sec s1=xxx_soft(1,*)/2. ;na 1 sec s2=xxx_soft(2,*)/2. ;na 1 sec s3=xxx_soft(3,*)/2. ;na 1 sec h1=xxx_soft(4,*)/2. ;na 1 sec th=xxx_hard(0,*)/32. ;co 1 sec h2=xxx_hard(1,*)*8. ;na 1 sec h3=xxx_hard(2,*)*8. ;na 1 sec h4=xxx_hard(3,*)*8. ;na 1 sec h5=xxx_hard(4,*)*8. ;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 diff=t(k+1)-t(k) if diff gt 2.1d0 and diff ne 8. 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 ;----------------- set postscript output -------------- mydevice = !D.NAME ;The NAME field of the !D system variable contains the name of the current plotting device. SET_PLOT, 'PS' ;Set plotting to PostScript. device,filename=date+'.ps',/portrait, xsize=18.,ysize=26.,yoffset=3.5,xoffset=2.,/times,/isolatin1;,bits_per_pixel=8 ;DEVICE, FONT = "ARIAL*BOLD*20" ;DEVICE, FONT = "Courier*15" ;/times,/isolatin1????????????? !p.multi=[0,0,8] !p.charsize=2 !X.MARGIN = [2,2] !X.OMARGIN = [10,4] !Y.MARGIN = [0,0] !Y.OMARGIN = [4,5] ;------- determine maximal values of y axis --------- indx1=min(where(t/3600 gt t1)) indx2=max(where(t/3600 lt t2)) ;y1=1.05*max(xxx_soft(1,indx1:indx2)) ;y2=1.05*max(xxx_soft(2,indx1:indx2))-1. ;y3=1.05*max(xxx_soft(3,indx1:indx2))-1. ;y4=1.05*max(xxx_soft(4,indx1:indx2))-1. ; y range seting indx1=min(where(t/3600. gt t1)) indx2=max(where(t/3600. lt t2)) ;------------------------ soft channels range ------------------ 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. ;------------------------ HARD channels range ------------------ ;kanaly twarde ; ; ustalanie zakresow dla osi y indx1=min(where(th/3600. gt t1)) indx2=max(where(th/3600. lt t2)) y1h=1.15*max(h2(indx1:indx2)) y01h=min(h2(where(h2(indx1:indx2) gt 0) > 0)) -1. > 1. y2h=1.15*max(h3(indx1:indx2))-1. y02h=min(h3(where(h3(indx1:indx2) gt 0) > 0)) -1. > 1. y3h=1.15*max(h4(indx1:indx2))-1. y03h=min(h4(where(h4(indx1:indx2) gt 0) > 0)) -1. > 1. y4h=1.15*max(h5(indx1:indx2))-1. y04h=min(h5(where(h5(indx1:indx2) gt 0) > 0)) -1. > 1. ;----------------------------------------------------- cy=550 ;window,0, xpos=300, ypos=0, xsize=0.61*cy+100, ysize=cy cx=720 ;window,0, xpos=100, ypos=0, xsize=cx, ysize=cy ;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>1,/ylog, yrange=[y01,y1],/ystyle, MIN_VALUE=-0.01 ;plot,t,s2>1,/ylog, yrange=[y02,y2],/ystyle, MIN_VALUE=-0.01 ;plot,t,s3>1,/ylog, yrange=[y03,y3],/ystyle, MIN_VALUE=-0.01 ;plot,t,h1>1,/ylog, yrange=[y04,y4],/ystyle, MIN_VALUE=-0.01 ;plot,th,h2>1,/ylog, yrange=[y01h,y1h],/ystyle, MIN_VALUE=-0.01 ;plot,th,h3>1,/ylog, yrange=[y02h,y2h],/ystyle, MIN_VALUE=-0.01 ;plot,th,h4>1,/ylog, yrange=[y03h,y3h],/ystyle, MIN_VALUE=-0.01 ;plot,th,h5>1,/ylog, xtitle='time UT',XTICKFORMAT='hmticks', $ ;yrange=[y04h,y4h],/ystyle, MIN_VALUE=-1 plot,t,s1>0.1, yrange=[0.1,y1];, MIN_VALUE=0.1 plot,t,s2>0.1, yrange=[0.1,y2];, MIN_VALUE=0.1 plot,t,s3>0.1, yrange=[0.1,y3];, MIN_VALUE=0.1 plot,t,h1>0.1, yrange=[0.1,y4];, MIN_VALUE=0.1 plot,th,h2>0.1, yrange=[0.1,y1h];, MIN_VALUE=0.1 plot,th,h3>0.1, yrange=[0.1,y2h];, MIN_VALUE=0.1 plot,th,h4>0.1, yrange=[0.1,y3h];, MIN_VALUE=0.1 plot,th,h5>0.1, xtitle='time UT',XTICKFORMAT='hmticks', $ yrange=[0.1,y4h];, MIN_VALUE=0.1 ;print, 'min1=', min(xxx_soft(1,*)) ;print, 'min2=', min(xxx_soft(2,*)) ;print, 'min3=', min(xxx_soft(3,*)) ;print, 'min4=', min(xxx_soft(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, 18000/2., 25000., 'INTERBALL-Tail RF15-I HARD/SOFT X-RAY EMISSION ', /device, alignment=0.5 XYOUTS, 18000/2., 24500., date+' COUNT RATE IN CHANNELS s1-s3, h1-h5', /device, alignment=0.5 XYOUTS, 18000.-200., 26000.-3000., 's1', /device, alignment=0.5 ;, orientation=90 XYOUTS, 18000.-200., 26000.-6000., 's2', /device, alignment=0.5 ;, orientation=90 XYOUTS, 18000.-200., 26000.-9000., 's3', /device, alignment=0.5 ;, orientation=90 XYOUTS, 18000.-200., 26000.-12000., 'h1', /device, alignment=0.5 ;, orientation=90 XYOUTS, 18000.-200., 26000.-14500., 'h2', /device, alignment=0.5 ;, orientation=90 XYOUTS, 18000.-200., 26000.-17500., 'h3', /device, alignment=0.5 ;, orientation=90 XYOUTS, 18000.-200., 26000.-20500., 'h4', /device, alignment=0.5 ;, orientation=90 XYOUTS, 18000.-200., 26000.-23500., 'h5', /device, alignment=0.5 ;, orientation=90 ;XYOUTS, 10., cy/2, 'count rate', /device, alignment=0.5, orientation=270 DEVICE, /CLOSE ;DEVICE closes the PostScript file. SET_PLOT, mydevice ;Return plotting to the original device. ;----- restore old system variables ----------------- !P=old_P !X=old_X !Y=old_Y end