The Grid Format File and the associated Grid Values File define the Grid Coordinate System and they contain the information about coordinates of each header records in the Grid Coordinate System. The Grid Coordinate System is a regularly sampled coordinate system defined by the the parameters ni_grid, oi_grid, di_grid, labeli_grid (where i=[1,2,3,...]) in the conventional SEPlib style. The mapping between the grid cells and the header record can be either regular or irregular. A gridding is regular if for each grid cell in the Grid Coordinate System exists a header record, and vice versa, for each header record exists a grid cell. The grid cells and the header records are connected by tables of pointers to header records. These tables have an entry for each grid cell, containing the header record number of the corresponding header record. The value of the header record number is equal to the position of the corresponding header record in the Header Values File. Notice that if same_record_number=0 the header record numbers are different from the data record numbers of the associated data record.
If the gridding is irregular, there are grid cells for which there is no associated header record. For these cells the pointer in the header record number tables are null (equal to -1). The following schematic illustrates the double-pointer mechanism that connects grid cells with data records, through the header records.
If the data is irregularly gridded the header record number tables are encoded in the Grid Values File. The format of the encoded tables is variable, and can be different from file to file. However, the programming interfaces for accessing the header record number are well defined and independent from the encoding. The encoding is variable because the optimal encoding strongly depends on the sparsity of the grid cells within the Grid Coordinate System, and thus depends on the particular way the header records were binned into the Grid Coordinate System. The gridding tables can be stored and retrieved by using the functions sep_get_grid_window and sep_put_grid_window described below.
The Grid Format File and the Grid Values File are optional. When no Grid Format File is associated with a data set, the Grid Coordinate System is assumed to be the same as the Header Coordinate System, and the grid coordinates of the header records are assumed to be regular.