SYNOPSIS

PERL PROGRAM NAME:

AUTHOR: Juan Lorenzo (Perl module only)

DATE:

DESCRIPTION:

Version:

USE

NOTES

Examples

SYNOPSIS

SEISMIC UNIX NOTES SUAHW - Assign Header Word using another header word

  suahw <stdin >stdout [optional parameters]				



 Required parameters:							

  key1=ep		output key 					

  key2=fldr		input key 					

  a=			array of key1 output values			

  b=			array of key2 input values			

  mode=extrapolate	how to assign a key1-value, when the key2-value	

			is not found in b:				

			=interpolate	interpolate			

			=extrapolate	interpolate and extrapolate	

			=zero		zero key1-values		

			=preserve	preserve key1-values		

			=transfer	transfer key2-values to key1	



 Optional parameters:							

  key3=tracf		input key 					

  c=			array of key3 input values			



 The key1-value is assigned based on the key2-value and the arrays a,b.

 If the header value of key2= equals the n'th element in b=, then the	

 header value key1= is set to the n'th element in a=.			

 The arrays a= and b= must have the same size, and the elements of b=	

 must be in ascending order.						



 The mode-switch decides what to do when a trace header has a key2-value

 that is not an element of the b-array:				

    zero - the key1-value will be set to zero				

    preserve - the key1-value will not be modified			

    transfer - the key2-value will be assigned to key1			

    interpolate - if the key2-value is greater than the n'th element	

	and less than the (n+1)'th element of b=, then the key1-value	

	will be	interpolated accordingly from the n'th and (n+1)'th	

	element of a=. Otherwise, key1 will not be changed.		

    extrapolate - same as interpolate, plus, if the key2-value is	

	smaller/greater than the first/last element of b=, then the	

	key1-value will be set to the first/last element of a=		



 The array c= can be used to prevent the modification of trace headers	

 with certain key3-values. The number of elements in c= is independent	

 of the other arrays.							

 The key1-value will not be modified, if the mode-switch is set to	

    zero, preserve, transfer - and the key3-value is an element of c=	

    interpolate, extrapolate - and the key3-value is outside of c=	

				(smaller than the first or greater than	

				the last element of c=)			



 Examples:								

  Assign shot numbers 1-3 to field file ID 1009,1011,1015 and 0 to the	

  remaining FFID (fldr):						

    suahw <data a=1,2,3 b=1009,1011,1015 mode=zero			



  Use channel numbers (tracf) to assign stations numbers (tracr) for a	

  split spread with a gap:						

    suahw <data key1=tracr a=151,128,124,101 key2=tracf b=1,24,25,48	



  Assign shot-statics:							

    suahw <data key1=sstat key2=ep a=-32,13,-4 b=1,2,3			



  Set trid to 0 for channel 1-24, but only for the record 1016:	

    suahw <data key1=trid key2=tracf key3=fldr a=0,0 b=1,24 c=1016	



 Credits:

	Florian Bleibinhaus, U Salzburg, Austria

	cloned from suchw of Einar Kajartansson, SEP

User's notes (Juan Lorenzo) untested

CHANGES and their DATES

Import packages

instantiation of packages

Encapsulated hash of private variables

sub Step

collects switches and assembles bash instructions by adding the program name

sub note

collects switches and assembles bash instructions by adding the program name

sub clear

sub a

sub b

sub c

sub key1

sub key2

sub key3

sub mode

sub get_max_index

max index = number of input variables -1