The choice of the binning parameters for a data set depends on many factors, such as the acquisition geometry and the planned subsequent processing flow. Using Sort90 we can study the effects of choosing different binning parameters in order to select optimal ones. For example, we can vary the bin width along the midpoint axes to analyze the the trade-off between bin resolution and uniformity in the offset and azimuth coverage within the bins. Sort90 is an efficient tool for this study, because it bins the trace headers and creates the gridding information, without accessing the bulky Data Values File. To assess the quality of a set of binning parameters we can display subsets of the data, as described in the previous section. We can also examine the distribution of the trace headers on the grid by measuring the fold within each of the grid cells. A simple way of measuring the fold is to count the number of elements along the trace_number_in_bin axes that Sort90 creates when encountering multiple traces belonging to a single grid cell. The following subroutine performs this task, and outputs the results into a SEPlib77 data set, which can then be displayed and examined. Notice that the subroutine is coded in Fortran 90, and uses a few of the powerful features of the language (e.g. automatic allocation of arrays, reduction intrinsics) that enables the writing of simple and compact code.
! subroutine that computes the fold from the gridding information subroutine comp_fold(num_grid_axes,tot_grid_cells,n_in_bin,n_grid)
integer sep_get_grid_window,srite integer num_grid_axes,tot_grid_cells,n_in_bin integer n_grid(num_grid_axes)
integer f(num_grid_axes),j(num_grid_axes) ! notice automatic allocation integer grid_val(n_in_bin,tot_grid_cells) ! notice automatic allocation real fold(tot_grid_cells) ! notice automatic allocation
f=0 ! notice array syntax for initilization j=1
! get the pointers to header record number for the whole grid if (sep_get_grid_window('in',num_grid_axes,n_grid,n_grid,f,j,grid_val) /= 0) & call seperr('error in sep_get_grid_window')
where (grid_val > 0) grid_val =1 !There is a trace if the pointer is non-negative elsewhere grid_val =0 !There is NO trace if the pointer is negative end where
fold=float(sum(grid_val,dim=1)) !notice use of reduction intrinsic SUM
if(srite('out',fold,tot_grid_cells*4) /= tot_grid_cells*4) & call seperr('error in srite')
This subroutine is the main subroutine of a SEPlib90 application program (Fold90). Figure shows the fold values for cross-line of the data set computed using Fold90.