macro htime zone 2 3 set stat 1 set hcol 2 option stat hi/pl dtime_hdc1x1 exec find_20 rawhist=dtime_hdc1x1 set hcol 4 option stat hi/pl dtime_hdc1y1 exec find_20 rawhist=dtime_hdc1y1 set hcol 2 option stat hi/pl dtime_hdc1u1 exec find_20 rawhist=dtime_hdc1u1 set hcol 4 option nsta hi/pl dtime_hdc1v1 exec find_20 rawhist=dtime_hdc1v1 set hcol 2 option nsta hi/pl dtime_hdc1y2 exec find_20 rawhist=dtime_hdc1y2 set hcol 4 option nsta hi/pl dtime_hdc1x2 exec find_20 rawhist=dtime_hdc1x2 wait set hcol 2 option stat hi/pl dtime_hdc2y1 exec find_20 rawhist=dtime_hdc2y1 set hcol 4 option nsta hi/pl dtime_hdc2x1 exec find_20 rawhist=dtime_hdc2x1 set hcol 2 option stat hi/pl dtime_hdc2u1 exec find_20 rawhist=dtime_hdc2u1 set hcol 4 option nsta hi/pl dtime_hdc2v1 exec find_20 rawhist=dtime_hdc2v1 set hcol 2 option nsta hi/pl dtime_hdc2y2 exec find_20 rawhist=dtime_hdc2y2 set hcol 4 option stat hi/pl dtime_hdc2x2 exec find_20 rawhist=dtime_hdc2x2 zone 1 1 option sta set hcol 4 set htyp 0 return macro find_20 if ( $hexist([rawhist]) ) then hrin [rawhist] histxbins = $hinfo([rawhist],'xbins') histxmax = $hinfo([rawhist],'xmax') histxmin = $hinfo([rawhist],'xmin') histsum = $hinfo([rawhist],'sum') histmax = $hinfo([rawhist],'max') vec/create ltdc([histxbins]) R hist/get_vect/contents [rawhist] ltdc if ([histsum] .gt. 300) then histstep = ([histxmax] - [histxmin])/[histxbins] found = 0 histmax = 0 maxtemp=[histxbins]-8 do nn=2,[maxtemp] nmin = [nn] + 8 nseq = 0 lave=0 do nnn=[nn],[nmin] test = ltdc([nnn]) if ( [test] .gt. 10) then lave = [lave] + ltdc([nnn]) nseq = [nseq] + 1 endif enddo if ( [nseq] .gt. 6 ) then lave = [lave]/[nseq] if ( [lave] .gt. [histmax] ) then histmax = [lave] endif endif enddo histcut = [histmax]*.2 if ([histcut] .lt. 2) then histcut = 2 endif maxtemp=[histxbins]-8 do nn=10,[maxtemp] if ([found] .eq. 0) then nmin = [nn] + 8 nseq = 0 do nnn=[nn],[nmin] if ([nnn] .lt. [histxbins]) then if ( ltdc([nnn]) .gt. [histcut]) then nseq = [nseq] + 1 endif endif enddo if ( [nseq] .ge. 7) then found = 1 tzero_offset = ([histxmin] + ([nn]-1)*[histstep]) tzero_offset = [tzero_offset] - 10 message $HTITLE([rawhist]) time offset = [tzero_offset] histmax = $hinfo([rawhist],'MAX') set plci 3. line [tzero_offset] 0 [tzero_offset] [histmax] set plci 1. endif endif enddo endif endif return