ahmilb@houu64$bhpwritecube

                                                                 

 BHPWRITECUBE creates a BHPIO cube dataset from SU trace data.   

                                                                 

 Usage: bhpwritecube < stdin filename= [optional parameters]     

                                                                 

 Required Parameters:                                            

  filename=fname       User-supplied filename                    

                                                                  

 Optional Parameters:                                            

  init=no              The default action of bhpwrite is to accumulate

                       data and trace index information into an  

                       existing BHPIO dataset. This allows you to run

                       multiple, concurrent jobs that all contributing

                       to the same data volume, once the first chunk

                       has been written. To create a new dataset,

                       use init=yes.                             

  pathlist=            ASCII file containing list of directories in which

  'filename'.dat       to write the dataset. BHPIO datasets are composed

                       of multiple partitions, which can be distributed across

                       multiple UNIX files and filesystems.      

                       Names for BHPIO datasets are composed of  

                       a path, which comes from the pathlist file,

                       followed by the filename, a partition sequence

                       number, and the extension .su             

                       For example, if filename=stack, and stack.dat contains

                       /data/D_170_001                           

                       /data/D_170_004                           

                       /data/D_170_006  ,                        

                       then complete filenames are

                        /data/D_170_001/stack_0001.su ,       

                        /data/D_170_004/stack_0002.su ,       

                        /data/D_170_006/stack_0003.su ,       

                        /data/D_170_001/stack_0004.su ,       

                       The size of each file is determined by the

                       size parameter                            

  key1=...

  key2=...

  key3=...

  key4=...

  key5=...

                      Key parameters enable random reading of BHPIO

                      datasets. Up to 5 SU header keys may be specified

                      when a file is created. Each header used as a key

                      must be integer format. When you read the file

                      using BHPREAD, it can be read in any order defined

                      by combining the 5 keys which were used to

                      create it. The syntax of the keyn parameter is

                      name,minimum-value,increment,number-of-bins, where

                      name is the SU header name,                 

                      minimum-value is the minimum header value to write,

                      increment is the increment between successive header

                      values, and number-of-bins is the number of bins

                      to allocate. The total number of traces which can

                      be written for a given key is defined as:

                      ((max-value - min-value + incr)/incr) * traces-per-bin

  bin=1               Maximum traces per bin

  action=w            Action to take if a key value is less than the

                      specified minimum or greater than the allowable

                      maximum, or if bin overflow occurs. Specify w, i, or a

                      to discard the offending trace and issue a warning, or

                      to discard the offending trace without a warning, or

                      to abort the job, respectively.

  rule=keep           Binning rule. Choose from:

                      keep - keep only the first bin=n traces in a bin,

                      replace - keep only the last trace to occupy a bin.

                      stack - sum traces into a bin, and update the nhs

                      trace header. The stacked trace is NOT normalized.

                      min - keep trace with smallest value in binhdr.

                      max - keep trace with largest value in binhdr.

                      Rules replace, stack, min and max work only if bin=1

  binhdr=offset       Binning header, used to decide which trace to keep

                      if rule=min or max

  maxens=0            Maximum ensemble size, in traces, in the input data.

                      To switch output partitions whenever the the end of

                      an input ensemble is reached, set maxens to the

                      maximum input ensemble size.

                      For this option to be effective key1 must correspond

                      to the major sort order of the input data.

  prealloc=no         Use prealloc=zero to cause output datasets to be

                      filled with zeros before writing any data.

                      Use prealloc=hdrs to pre-fill the dataset with trace headers

                      containing the correct key values, and traces consisting of zeros

  stripe=yes          Create multiple partitions of 'size' Megabytes each.

                      Use no to write a single partition. NOTE: there is an

                      arbitrary limit of 1 Million traces in a partition.

  size=1999           Size of each file partition, in megabytes.

  properties=...      List of model properties. BHPWRITECUBE can be used to

                      create layer-based models using input data that were

                      created by bhproffread or bhpmodel. Properties can

                      be any attribute such as velocity, density, etc 

                      that can be represented as layered data.        

  horizons=...        List of horizons, if input data were

                      created by bhphorizon. If init=yes, new horizons

                      are created. If init=no, existing horizons are updated,

                      allowing for partial-trace updates

  endian=native       Omit endian parameter to write native byte-order

                      Specify endian=1 to force BIG_ENDIAN     

                      Specify endian=0 to force LITTLE_ENDIAN  

  stdin_endian=2      Default endianness for data from stdin is NATIVE,

                      where NATIVE is the endianness of the platform

                      on which bhpwritecube is running.

                      Specify stdin_endian=0 to read LITTLE_ENDIAN from stdin

                      Specify stdin_endian=1 to read BIG_ENDIAN from stdin

  transpose=no        Specify yes to write transposed data. Transposed data

                      is used to create time-slice or map-view datasets.

                      When writing transposed data, the last key is taken as the vertical

                      key. When writing non-transposed data, trace header tracl is automatically

                      used to store vertical key values, and is added to the file

                      header.                                            

  vkey=tracl          The vertical key specification provides a way to access

                      vertical subsets of the data. The tracl header is not actually

                      used to store any infomation. After the data are written, use

                      the BHPIO utility to see how tracl is used.

  units=              0=Seconds, 1=Feet, 2=Meters. If unspecified, the first

                      input trace is checked. If dt/1000 > 8, units=2 is used.

                      If dt/1000 <= 8, units=0 is used. The units value is saved

                      in the header file for bhpread to use if required.

  verbose=0           For debug print, use verbose=1                       

                                                                  

 Trace Header Usage:                                        

   The trace header values associated with key1,...key5 are used to index

   data for future access.                                  

   dt, ns and delrt are used to determine vertical extent and interval of

   the input data.                                          

   Each trace after the first is checked for the same dt and ns value.

   If a different value is found, bhpwritecube will print an appropriate

   message and perform an orderly shutdown. Data up to the point of failure

   is preserved.                                         

   If any of the keys is sx, sy, gx, or gy, the coordinate scalar, scalco is applied.

   If rule=stack is specified, nhs is updated

                                                                 

 BHPWRITECUBE saves trace header keys in an n-dimensional cube format,

 where, n is the number of specified keys. This allows bhpreadcube

 to quickly access traces randomly by doing a simple lookup operation.

 Contrast with bhpwriteseq, which has an "open-ended" method of

 defining trace headers to save. bhpwriteseq is useful when the  

 limits of the data being processed are not well-defined. However,

 bhpwritecube is significantly more efficient and uses less system

 resources than bhpwriteseq.                                     

                                                                 

 Error Conditions:                                             

  If any of the folowing error conditions occurs, bhpwritecube will attempt

  to perform and orderly shutdown. Once the error is resolved, you should

  be able to restart at the shutdown point without loss of data.   

    Sample interval(dt) or trace length(ns) changes in input data.

    Out of disk space and unable to open next partition.

    Disk write returns an error status.              

    Input data out of specified range, and action=a is specified.

    User does Ctrl-C or kill -s SIGINT pid                    

                                                                 

  EXAMPLES:                                                      

    Write 10 lines, each with 101 CDPs of pre-stack data: 

      bhpwritecube < line2031-2040.su filename=lines2031-2040 init=yes \

         key1=fldr,2031,1,10 key2=cdp,1500,1,101 key3=offset,181,121,80 bin=2

      Use bin=2 to keep from losing any offsets.

    Same as previous job, but swap partitions on line boundaries.

      bhpwritecube < line2031-2040.su filename=lines2031-2040 init=yes \

        maxens=80800 key1=fldr,2031,1,10 key2=cdp,1500,1,101 \

        key3=offset,181,121,80 bin=2

      80800 = 10 lines times 101 CDPs times 80 offsets

    Initialize dataset with one line of data, then add lines 2-10

      bhpwritecube < line2031.su filename=lines2031-2040 init=yes \

        key1=fldr,2031,1,10 key2=cdp,1500,1,101 \

        key3=offset,181,121,80 bin=2

      bhpwritecube < line2032-2036.su filename=lines2031-2040

      bhpwritecube < line2037-2040.su filename=lines2031-2040

      Notice that the second 2 jobs specifiy only the filename.

      All other dataset information has already been saved.

      The second two jobs can be run serially or concurrently,

      but they cannot run until the first job completes.