previous up next print clean
Next: CONSTRUCTORS Up: Clapp & Crawley: Fortran90: Previous: Intrinsics

STRUCTURE

Our data structure was designed with the goal of mirroring SEPlib90. Seismic data exists primarily as traces, regularly sampled in time, and regularly or irregularly sampled along various gridding axes, which may be spatial, such as midpoint and shot location; or non-spatial, such as shot number. In SEPlib90, separate grid and header files are used to represent the regular (binned) and irregular properties, respectively, of a given data set.

Our Fortran90 structure is similar, using two levels of defined data type to achieve this representation. The basic units are the trace, sep_tr and the header sep_hdr. The sep_tr type consists of a logical flag declaring whether or not that particular trace exists, and one each of complex, real, and integer valued allocatable vectors. One of these will be allocated for an existent trace, dependent upon the type of the dataset. The sep_hdr type is analogous, consisting of a logical flag which states whether or not a given header exists, and allocatable real and integer arrays for storing header keys. These types are like the data and header records of a SEPlib90 data set.

Structure is given to these random traces and headers through organization into larger arrays, which have axes analogous to SEPlib90 grid axes. A given data set actually has two such arrays, with each element in the array a pointer either to a trace, or to the headers for a trace. For very sparse data sets, missing trace locations may all point to a shared zero trace for economy of memory. The arrays have the dimensionality and axis parameters of the SEPlib90 data set which it will contain. Along with the grid arrays, a data set must have the axis parameters, number and format of header keys, certain logical flags for book keeping, etc. Seven types are defined, for one- to seven-dimensional data sets, which should easily accommodate most needs for seismic processing (since a 3D pre-stack data set requires only five-dimensional space).

The structure is most easily described graphically. This is done in Figure 1. Figure 1 displays the shape and connectivity of a two dimensional data set, such as a common midpoint gather. The figure shows a data set with four traces, binned onto a grid with six grid cells. The two empty cells share the zero trace, zero_tr, and zero header, zero_hdr. In the example there are three header keys, described by the three elements of the array keys, each of which consists of a name, type, and format (the identifying traits in a SEPlib90 header format file), and an index referring to location inside each sep_hdr array. It is not shown, but each sep_hdr can consist of real and integer components. Also not shown are various logical flags.

 
struc2
struc2
Figure 1
Diagrammatic representation of Fortran90 data structure for SEPlib90.
view

Below is the complete sep_2d structure:

type sep_2d type (sep_hdr), dimension(:), pointer :: hdrs ! 1-D header array type (sep_tr), dimension(:), pointer :: traces ! 1-D trace array type (sep_tr) :: zero_tr ! zero trace type (sep_hdr) :: zero_hdr ! zero header integer, dimension(2) :: n ! number of elements real, dimension(2) :: o ! first element location real, dimension(2) :: d ! sampling character(len=128), dimension(2):: label ! axis description integer :: n_keys ! number of keys integer :: num_int ! number of integer keys type (sep_key_info), dimension(:), pointer :: keys ! description of keys character(len=128) :: type ! type of data logical :: alloc_hdr ! if headers allocated logical :: alloc_tr ! if traces allocated logical :: alloc_keys ! if keys are allcoated logical :: rite_keys ! if keys info written end type sep_2d

type sep_tr real, pointer ,dimension(:) :: rdata ! real data storage complex, pointer ,dimension(:) :: cdata ! complex data storage integer, pointer,dimension(:) :: idata ! integer data storage logical :: exists ! if trace is allocated end type sep_tr

type sep_hdr logical :: exists ! if headers allcoated real, pointer, dimension(:) :: rhdr ! real header storage integer, pointer, dimension(:) :: ihdr ! integer header storage end type sep_hdr

type sep_key_info integer :: location ! location rhdr/ihdr array character(len=128) :: name ! key name character(len=128) :: type ! key type end type sep_key_info


previous up next print clean
Next: CONSTRUCTORS Up: Clapp & Crawley: Fortran90: Previous: Intrinsics
Stanford Exploration Project
11/12/1997