func Begin() { /* Number of lines in flat file containing water depths */ num = 686; recordnum = 1; counter = 1; } func OnLineHeader(){ output(LH); /* flatfile called "newwaterbottom" contains water depths. */ stream= fopen("newwaterbottom","r"); /* read in each line to get the string tokens[0], tokens[1] for each line Then convert the string tokens to vector values. Divide the water depth by 32.81 which is the sample interval so that when using a sample interval of unity the mute will be correct. */ for (i=1; i<=num;i++) { tokens = getTokenLine(stream); if (tokens == Nothing) { print("Nothing read from water depth file"); } else record[i]=strtonum(tokens[0]); depth[i]=strtonum(tokens[1]); print("Record ",record[i],"Water Depth ",depth[i],"\n"); } } func OnTrace() { /* Read a trace find the RecNum install the associated water depth */ if ( record[recordnum] != Tr.RecNum ){ recordnum ++; } Tr.WDepDP = depth[recordnum]/32.81 - 7; Tr.VPick1 = depth[recordnum]/32.81 - 7; output(Tr); } func End() { fclose(stream); }