DOCUMENTATION

SYNOPSIS

PERL PROGRAM NAME: xract_waveform.pl
Purpose: Simple viewing of an su file 
         to extract waveforms  
AUTHOR:  Juan M. Lorenzo
DEPENDS: Seismic Unix modules from CSM 
DATE:    July 7 2016 V0.1
DESCRIPTION:  based upon non-oop Xtract.pl  

USES

(for subroutines) 
    manage_files_by 
    System_Variables (for subroutines)

    (for variable definitions)
    SeismicUnix (Seismic Unix modules)

NOTES

We are using moose 
moose already declares that you need debuggers turned on
so you don't need a line like the following:

use warnings;

USES

(for subroutines) 
    manage_files_by 
    System_Variables (for subroutines)

    (for variable definitions)
    SeismicUnix (Seismic Unix modules)


use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su) ;
 

STEPS IN THE PROGRAM

Create

hash of shared variables and
subroutine to clear them

Do not clear: absclip

sub inbound

set inbound seismic-unix 
-formatted file name

sub absclip

set absclip for suxwigb  

sub sorted_indices

for sorting indices 

sub file_out

set name of output file
using both ref_picks_file that 
is used to select a single waveform 
and the seismic unix file containing all the data   

Read

the picked 'waveform' file 
assume local directory

Sort

the picked 'waveform' file

Error

Message

sub

set ref_picks_file 
waveform file   

sub header_word

set header_word for suwind  

sub window_title

set window_title  for suxwigb  

sub Step

Extraction of waveform

Instantiate classes

1. Instantiate classes 
     Create a new version of the package
     Personalize to give it a new name if you wish
   Use classes:
   flow
   log
   message
   suxwigb
   suwind

Declare

local variables 

Set

 Only for debugging
 set suxwigb parameters 
 In the perl module for suxwigb we should
 have (but we do not yet) an explanation of each  of  these parameters

$suxwigb-> clear();
$suxwigb-> d1(1); 
$suxwigb-> d2(1); 
$suxwigb-> f1(1); 
$suxwigb-> f2(1); 
$suxwigb-> xcur(1);
$suxwigb-> n2tic(1);
$suxwigb-> d2num(20);
$suxwigb-> windowtitle($xtract->{_window_title});
#$suxwigb-> title($xtract->{_window_title}); 
$suxwigb-> xlabel($xtract->{_header_word});  
suxwigb-> ylabel('TWTT\ s'); 
$suxwigb-> box_width(300); 
$suxwigb-> box_height(500); 
$suxwigb-> box_X0(0); 
$suxwigb-> box_Y0(0); 
$suxwigb-> absclip($xtract->{_absclip});
$suxwigb[1]  = $suxwigb->Step();

@items   = ($suwind[1],$in,$xtract->{_inbound},$to,
            $suwind[2],$to,$suxwigb[1],$go);
$flow[1] = $run->modules(\@items);

QC-Extract

	the selected waveform
       to a file 

Window by

trace 

Window by

time 

DEFINE FLOW(S)

Save a copy of extracted file