/* This ufh script applies a trace dependent phase rotation to seismic data Application steps: 1. You must determine the phase rotation in degrees for each trace and put that value in the trace header (in the slot of your choice, e.g. StaCor for the static word). 2. Then run the freqtim/ufh/timfreq combo: timfreq -Nindata -AP | ufh rot.ufh | freqtim -Orotdata -AP where indata is the input data with the rotations written into the trace headers, rotdata is the output rotated data, "-AP" is the ampl/phase option of the time-to-freq & freq-to-time transformers (the phase in the freq domain is every other trace in each record starting with trace 2), and rot.ufh is the ufh script below to actualy extract each trace rotation from the header and apply it. The header word used by the script below is StaCor */ func Begin() { trc = 1; /* initialize trace counter */ } func OnLineHeader() { nsamp = LH.NumSmp; /* get number samples/trace */ ntrc = LH.NumTrc; /* get number traces/rec */ output(LH); /* output line header (unmodified in this case) */ } /* here is the guts of what we want to do to each trace header */ func OnTrace() { /* for every other trace starting at trace 2 (in each record) extract the phase rotation from the header location and apply it by adding to each sample of the phase trace */ if (trc%2 == 0){ phz = Tr.StaCor; for(i=0; i