DOCUMENTATION

SYNOPSIS

PERL PROGRAM NAME:  SUOP2 - do a binary operation on two data sets			
AUTHOR: Juan Lorenzo (Perl module only)
DATE:   Feb. 19 2015,
DESCRIPTION:
Version:  0.0.1

USE

NOTES

Examples

SEISMIC UNIX NOTES

 SUOP2 - do a binary operation on two data sets			

 suop2 data1 data2 op=diff [trid=111] >stdout				

 Required parameters:							
 	none								

 Optional parameter:							
 	op=diff		difference of two panels of seismic data	
 			=sum  sum of two panels of seismic data		
 			=prod product of two panels of seismic data	
 			=quo quotient of two panels of seismic data	
 			=ptdiff differences of a panel and single trace	
 			=ptsum sum of a panel and single trace		
 			=ptprod product of a panel and single trace	
 			=ptquo quotient of a panel and single trace	
 			=zipper do "zipper" merge of two panels	

  trid=FUNPACKNYQ	output trace identification code. (This option  
 			is active only for op=zipper)			
			For SU version 39-43 FUNPACNYQ=111		
 			(See: sukeyword trid     for current value)	


 Note1: Output = data1 "op" data2 with the header of data1		

 Note2: For convenience and backward compatibility, this		
 	program may be called without an op code as:			

 For:  panel "op" panel  operations: 				
 	susum  file1 file2 == suop2 file1 file2 op=sum			
 	sudiff file1 file2 == suop2 file1 file2 op=diff			
 	suprod file1 file2 == suop2 file1 file2 op=prod			
 	suquo  file1 file2 == suop2 file1 file2 op=quo			

 For:  panel "op" trace  operations: 				
 	suptsum  file1 file2 == suop2 file1 file2 op=ptsum		
 	suptdiff file1 file2 == suop2 file1 file2 op=ptdiff		
 	suptprod file1 file2 == suop2 file1 file2 op=ptprod		
 	suptquo  file1 file2 == suop2 file1 file2 op=ptquo		

 Note3: If an explicit op code is used it must FOLLOW the		
	filenames.							

 Note4: With op=quo and op=ptquo, divide by 0 is trapped and 0 is returned.

 Note5: Weighted operations can be specified by setting weighting	
	coefficients for the two datasets:				
	w1=1.0								
	w2=1.0								

 Note6: With op=zipper, it is possible to set the output trace id code 
 		(See: sukeyword trid)					
  This option processes the traces from two files interleaving its samples.
  Both files must have the same trace length and must not longer than	
  SU_NFLTS/2  (as in SU 39-42  SU_NFLTS=32768).			

  Being "tr1" a trace of data1 and "tr2" the corresponding trace of
  data2, The merged trace will be :					

  tr[2*i]= tr1[i]							
  tr[2*i+1] = tr2[i]							

  The default value of output tr.trid is that used by sufft and suifft,
  which is the trace id reserved for the complex traces obtained through
  the application of sufft. See also, suamp.				

 For operations on non-SU binary files  use:farith 			

 Credits:
	SEP: Shuki Ronen
	CWP: Jack K. Cohen
	CWP: John Stockwell, 1995, added panel op trace options.
	: Fernando M. Roxo da Motta <petro@roxo.org> - added zipper op

 Notes:
	If efficiency becomes important consider inverting main loop
	and repeating operation code within the branches of the switch.
	

User's notes (Juan Lorenzo)

(old) $file[1] = fileA $file[2]= fileB suop2->clear(); suop2->AminusB(); suop2->fileA(\$file[1]); suop2->fileB(\$file[2]); $suop[1] = suop2->Step();

V 0.0.3 May 2023
You can include a list of file names

CHANGES and their DATES

V 0.0.2 Oct 4 2018
V 0.0.3 May 2023

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

subroutine AminusB

fis operation to be diff
subtract one su file from another
trace by trace

subroutine AplusB

add one su file to another
trace by trace

subroutine file1

subs fileA and file1, first file with which to operate

subroutine file2

subs file2, fileB, second file with which to operate

subroutine file_list1

subroutine file_list2

subroutine fileA

subs fileA and file1, first file with which to operate

subroutine fileB

subs file2, fileB, second file with which to operate

sub op

sub trid

sub w1

sub w2

sub get_max_index

max index = number of input variables -1