DOCUMENTATION
SYNOPSIS
PROGRAM NAME: sucat
AUTHOR: Juan Lorenzo (Perl module only)
DATE: May 25 2016
DESCRIPTION concatenate a list of files
Version 1
1.01 June 23 2016
Variable suffix changed to input_suffix
Notes:
Package name is the same as the file name
Moose is a package that allows an object-oriented
syntax to organizing your programs
USAGE 1 (todo)
To cat an array of trace numbers
Example
$sucat->tracl(\@array);
$sucat->Steps()
USAGE 2
To cat a defined range of numerically-named
files
Example:
$sucat->first_file_number_in('1000');
$sucat->last_file_number_in('1001');
$sucat->number_of_files_in('2');
$sucat->Step();
import packages
instantiate new variables
declare local variables
newline:
is a special character
list:
an empty list array
sucat: is a hash of important variables
sub clear:
clean hash of its values
_get_data_type
instantiate packages
declare local variables
_get_gather_type
instantiate packages
declare local variables
sub _set_data_type
set_data_type can be velan,su,txt, cat
sub _set_gather_type
set_gather_type can be cdp,ep,fldr
sub data_type
data_type can be velan,su,txt,mute
bring in packages
instantiate packages
Declare local variables
1.Read a list of file names
2.Read contents of each file in the list
into arrays.
3. Each line of the list uses a file name that indicates
gather number and the other file name in which to find
velocity picks.
4. Sort the cdp or gather number into monotonically increasing
values and rearrange the pick pairs accordingly.
Place contents
of each file in the list into an array.
sort by gather number
sub get_outbound
sub first_file_number_in:
for first_file_number_in numerical file name
sub inbound_directory:
for inbound directory name
sub input_name_extension
use after names and numbers
e.g., gather_100_input_name_extension.su
sub input_name_prefix
use before names and numbers
input_prefix_100.su
sub input_suffix
use after dot for all names
e.g., .su
sub last_file_number_in:
for last_file_number_in numerical file name
sub list:
for list directory name
sub list_directory:
for list directory name
sub number_of_files_in:
for number_of_files_in
sub number_of_files_in:
for number of files to concatenate
sub outbound_directory:
for outbound directory name
sub output_file_name:
for number of files to concatenate
sub set_ist_aref
list array
sub set_outbound
subroutine Step
builds array to concatenate
first_file_number_in line ,
output contacts program name,
successive lines
final output name is provided by user name
add new file names