;**************************************************** ;* cut_as_tmono_each_beam.pro ;* ;* modified cut_as_tmono.pro ;* Version 1.0 February 22, 2001 Made ;**************************************************** pro set_values,filename,date1,date2,time1,time2,alt1,alt2 ; Edit here filename='ti980921cp2l_esr_lpsugi.V_1.das' ; file to read date1=921 ; start date time1=1700 ; start time date2=922 ; end date time2=1900 ; end time alt1=100 ; lowest height alt2=400 ; highest height end ;--------------------------------------------------------- pro print_proname,proname date='February 22, 2001: V1.0 ' & s='-----' & s2=' ' print,' ' & print,s,s2,proname,s2,date,s2,s & print,' ' end ;--- function check_data,date1,date2,time1,time2,alt1,alt2,date,time,alt i=-1 if date ge date1 and date le date2 then i=1 if i eq -1 then return, i i=-1 if date eq date1 and time ge time1 then i=1 if date eq date2 and time le time2 then i=1 if date gt date1 and date lt date2 then i=1 if i eq -1 then return, i i=-1 if alt ge alt1 and alt le alt2 then i=1 return,i end ;------------------------------------------------------------ ; MAIN, main, Main ;------------------------------------------------------------ ; proname='cut_as_tmono_each_beam.pro' & print_proname,proname set_values,filename,date1,date2,time1,time2,alt1,alt2 i=strpos(filename,'.das') outfile=strmid(filename,0,i)+'_cut'+strmid(filename,i,strlen(filename)-i) openr,1,filename & print,'----- Open(r) = ',filename openw,2,outfile & print,'----- Open(w) = ',outfile ;header moji='string' for i=1,3 do begin readf,1,moji & printf,2,moji endfor str1='(I5,I5,I5,f7.1,I6,I7,2I5)' ;str1='(I4,I5,3F6.1,I2)' date=0 & time=0 & qq=0 & alt=0.0 & Ti=0 & Tisig=0 & lat0=0 & lon0=0 icount=0 iend=0 while EOF(1) ne 1 and iend eq 0 do begin readf,1,format=str1,date,time,qq,alt,Ti,Tisig,lat0,lon0 if (icount mod 500) eq 0 then print,format=str1,date,time,qq,alt,Ti,Tisig,lat0,lon0 if check_data(date1,date2,time1,time2,alt1,alt2,date,time,alt) eq 1 then $ printf,2,format=str1,date,time,qq,alt,Ti,Tisig,lat0,lon0 if date gt date2 then iend=1 if date ge date2 and time gt time2 then iend=1 icount=icount+1 endwhile close,1 & close,2 end