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

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 41 CC 2 SCAR 11.0
CC
2
Cov
0%
mix
6.0
Step
2.0
note
2.0
CRAP 3.0
1 package App::SeismicUnixGui::sunix::statsMath::sumix;
2  
3 =head1 DOCUMENTATION
4  
5 =head2 SYNOPSIS
6  
7 PERL PROGRAM NAME: SUMIX - compute weighted moving average (trace MIX) on a panel
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 SUMIX - compute weighted moving average (trace MIX) on a panel
22 of seismic data
23  
24 sumix <stdin >sdout
25 mix=.6,1,1,1,.6 array of weights for weighted average
26  
27  
28 Note:
29 The number of values defined by mix=val1,val2,... determines the number
30 of traces to be averaged, the values determine the weights.
31  
32 Examples:
33 sumix <stdin mix=.6,1,1,1,.6 >sdout (default) mix over 5 traces weights
34 sumix <stdin mix=1,1,1 >sdout simple 3 trace moving average
35  
36  
37 Author:
38 CWP: John Stockwell, Oct 1995
39  
40 Trace header fields accessed: ns
41  
42 =head2 CHANGES and their DATES
43  
44 =cut
45  
46 use Moose;
47 our $VERSION = '0.0.1';
48 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
49  
50 my $get = L_SU_global_constants->new();
51  
52 my $var = $get->var();
53 my $empty_string = $var->{_empty_string};
54  
55 my $sumix = {
56 _mix => '',
57 _Step => '',
58 _note => '',
59 };
60  
61 =head2 sub Step
62  
63 collects switches and assembles bash instructions
64 by adding the program name
65  
66 =cut
67  
68 sub Step {
69  
70 $sumix->{_Step} = 'sumix' . $sumix->{_Step};
71 return ( $sumix->{_Step} );
72  
73 }
74  
75 =head2 sub note
76  
77 collects switches and assembles bash instructions
78 by adding the program name
79  
80 =cut
81  
82 sub note {
83  
84 $sumix->{_note} = 'sumix' . $sumix->{_note};
85 return ( $sumix->{_note} );
86  
87 }
88  
89 =head2 sub clear
90  
91 =cut
92  
93 sub clear {
94  
95 $sumix->{_mix} = '';
96 $sumix->{_Step} = '';
97 $sumix->{_note} = '';
98 }
99  
100 =head2 sub mix
101  
102  
103 =cut
104  
105 sub mix {
106  
107 my ( $self, $mix ) = @_;
108 if ( $mix ne $empty_string ) {
109  
110 $sumix->{_mix} = $mix;
111 $sumix->{_note} = $sumix->{_note} . ' mix=' . $sumix->{_mix};
112 $sumix->{_Step} = $sumix->{_Step} . ' mix=' . $sumix->{_mix};
113  
114 }
115 else {
116 print("sumix, mix, missing mix,\n");
117 }
118 }
119  
120 =head2 sub get_max_index
121
122 max index = number of input variables -1
123
124 =cut
125  
126 sub get_max_index {
127 my ($self) = @_;
128 my $max_index = 0;
129  
130 return ($max_index);
131 }
132  
133 1;