/* must have function "Begin" to start with even if nothing inside */ func Begin() { ind1 = 0; /* initialize some counter */ live = 0; } func OnLineHeader() { numtrc = LH.NumTrc; /* get number traces per record */ } /* here is the guts of what we want to do to each trace header */ func OnTrace() { recnum = Tr.RecNum; /* get sequential rec number */ ++ind1; /* increment counter by 1 */ if ( ind1%numtrc == 0 ) { /* are we end of a record? */ ind1 = 0; /* reset counter */ print(recnum," ",di," ",live,"\n"); live = 0; /* reset live trc counter */ } if (Tr.StaCor != 30000) { /* if trace NOT dead... */ ++live; /* increment live trc counter */ di = Tr.DphInd; /* store DI */ } } /* we're finished run as follows: ufh live_traces.ufh < input data >& index results may be examined by editting the out file "index", or graphically, xgraph < index (you will have to set your DISPLAY environmental variable on the cray or remote machine to your local ip address:0 */