lib/App/SeismicUnixGui/sunix/statsMath/suacor.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 50 CC 4 SCAR 14.8
CC
4
Cov
0%
ntout
6.0
norm
6.0
sym
6.0
CRAP 4.4
1 package App::SeismicUnixGui::sunix::statsMath::suacor;
2  
3 =head1 DOCUMENTATION
4  
5 =head2 SYNOPSIS
6  
7 PERL PROGRAM NAME: SUACOR - auto-correlation
8 AUTHOR: Juan Lorenzo (Perl module only)
9 DATE:
10 DESCRIPTION:
11 Version:
12  
13 =head2 USE
14  
15 =head3 NOTES
16  
17 =head4 Examples
18  
19 =head3 SEISMIC UNIX NOTES
20  
21 SUACOR - auto-correlation
22  
23 suacor <stdin >stdout [optional parms]
24  
25 Optional Parameters:
26 ntout=101 odd number of time samples output
27 norm=1 if non-zero, normalize maximum absolute output to 1
28 sym=1 if non-zero, produce a symmetric output from
29 lag -(ntout-1)/2 to lag +(ntout-1)/2
30  
31 Credits:
32 CWP: Dave Hale
33  
34 Trace header fields accessed: ns
35 Trace header fields modified: ns and delrt
36  
37 =head2 CHANGES and their DATES
38  
39 =cut
40  
41 use Moose;
42 our $VERSION = '0.0.1';
43  
44 my $suacor = {
45 _ntout => '',
46 _norm => '',
47 _sym => '',
48 _Step => '',
49 };
50  
51 =head2 sub Step
52  
53 collects switches and assembles bash instructions
54 by adding the program name
55  
56 =cut
57  
58 sub Step {
59  
60 $suacor->{_Step} = 'suacor' . $suacor->{_Step};
61 return ( $suacor->{_Step} );
62  
63 }
64  
65 =head2 sub clear
66  
67 =cut
68  
69 sub clear {
70  
71 $suacor->{_ntout} = '';
72 $suacor->{_norm} = '';
73 $suacor->{_sym} = '';
74 }
75  
76 =head2 sub ntout
77  
78  
79 =cut
80  
81 sub ntout {
82  
83 my ( $self, $ntout ) = @_;
84 if ($ntout) {
85  
86 $suacor->{_ntout} = $ntout;
87 $suacor->{_note} = $suacor->{_note} . ' ntout=' . $suacor->{_ntout};
88 $suacor->{_Step} = $suacor->{_Step} . ' ntout=' . $suacor->{_ntout};
89  
90 }
91 else {
92 print("suacor\n");
93 }
94 }
95  
96 =head2 sub norm
97  
98  
99 =cut
100  
101 sub norm {
102  
103 my ( $self, $norm ) = @_;
104 if ($norm) {
105  
106 $suacor->{_norm} = $norm;
107 $suacor->{_note} = $suacor->{_note} . ' norm=' . $suacor->{_norm};
108 $suacor->{_Step} = $suacor->{_Step} . ' norm=' . $suacor->{_norm};
109  
110 }
111 else {
112 print("suacor\n");
113 }
114 }
115  
116 =head2 sub sym
117  
118  
119 =cut
120  
121 sub sym {
122  
123 my ( $self, $sym ) = @_;
124 if ($sym) {
125  
126 $suacor->{_sym} = $sym;
127 $suacor->{_note} = $suacor->{_note} . ' sym=' . $suacor->{_sym};
128 $suacor->{_Step} = $suacor->{_Step} . ' sym=' . $suacor->{_sym};
129  
130 }
131 else {
132 print("suacor\n");
133 }
134 }
135  
136 =head2 sub get_max_index
137
138 max index = number of input variables -1
139
140 =cut
141  
142 sub get_max_index {
143 my ($self) = @_;
144  
145 my $max_index = 2;
146  
147 return ($max_index);
148 }
149  
150 1;