/* This is a VERY simple ufh source script to read Miro's CDP data and do a quick fix of the Source Location Index. The line should be properly prepped from the shot input data to be sure all indices are properly related. Nevertheless, this script should do ok for processing this line */ /* must have function "Begin" to start with. Here we set the group interval and an index increment for use in the trace read loop below */ func Begin() { dx = 75; dd =12.5; dg = 3; xi = 0; /* initialize some variables */ di = 0; si = 0; gi = 0; } func OnLineHeader() { /* output line header unchanged in this case */ output(LH); } /* here is the guts of what we want to do to each trace header */ func OnTrace() { stat = Tr.StaCor; /* get static value */ if(stat != 30000){ /* for each LIVE trace... */ di = Tr.DphInd; /* extract depth index */ gi = Tr.RecInd; /* extract receiver index */ xi = Tr.DstSgn; /* extract signed trc distance */ } else { /* for each DEAD trace... */ di = 0; gi = gi - dg; /* decrement grp index by the grp increment which will give some negative gi's at t start of the line but at least they'll unique and can be further sorted on */ xi = xi + dx; /* put in the trace distances knowing that for the roll-on & roll-off we will have phony spread with dists out to 6000m */ } si = gi + xi/dd; /* calculate actual src pt. number NOTE: this is probably not correct in a absolute sense but is ok for sorting. Could use si = gi + xi/cdp where cdp is the cdp interval */ if(gi <= 0){ /* for our phony spread make it invisible to presort */ gi = 0; si = 0; di = 0; xi = 0; } Tr.SoPtNm = si; /* put src pt # in proper slot */ Tr.SrcLoc = si; /* put this in primary src sort slot */ Tr.DstSgn = xi; /* update trace distances */ Tr.RecInd = gi; /* update group index */ Tr.DphInd = di; /* update group index */ output(Tr); /* output modified trace */ } func End() { /* if we do nothing at the end "End" is optional */ } /* this is run by entering ufh index < indata > outdata where index is the name of the above script, indata is the input data, and outdata is the output data */