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

filter: Statementstmt 0.0% 0 / 69 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 9 totaltotal 0.0% 0 / 101 CC 6 SCAR 14.4
CC
6
Cov
0%
dx
6.0
key
6.0
keyg
6.0
CRAP 4.2
1 package App::SeismicUnixGui::sunix::statsMath::sufwmix;
2  
3 =head2 SYNOPSIS
4  
5 PERL PROGRAM NAME:
6  
7 AUTHOR: Juan Lorenzo (Perl module only)
8  
9 DATE:
10  
11 DESCRIPTION:
12  
13 Version:
14  
15 =head2 USE
16  
17 =head3 NOTES
18  
19 =head4 Examples
20  
21 =head2 SYNOPSIS
22  
23 =head3 SEISMIC UNIX NOTES
24 SUFWMIX - FX domain multidimensional Weighted Mix
25  
26  
27  
28 sufwmix < stdin > stdout [optional parameters]
29  
30  
31  
32 Required parameters:
33  
34 key=key1,key2,.. Header words defining mixing dimension
35  
36 dx=d1,d2,.. Distance units for each header word
37  
38 Optional parameters:
39  
40 keyg=ep Header word indicating the start of gather
41  
42 vf=0 =1 Do a frequency dependent mix
43  
44 vmin=5000 Velocity of the reflection slope
45  
46 than should not be attenuated
47  
48 Notes:
49  
50 Trace with the header word mark set to one will be
51  
52 the output trace
53  
54 (a work in progress)
55  
56  
57  
58  
59  
60 Credits:
61  
62  
63  
64 Potash Corporation: Balazs Nemeth, Saskatoon Saskatchewan CA,
65  
66 given to CWP in 2008
67  
68  
69  
70  
71  
72  
73  
74 =head2 User's notes (Juan Lorenzo)
75 untested
76  
77 =cut
78  
79  
80 =head2 CHANGES and their DATES
81  
82 =cut
83  
84 use Moose;
85 our $VERSION = '0.0.1';
86  
87  
88 =head2 Import packages
89  
90 =cut
91  
92 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
93  
94 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
95 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
96  
97  
98 =head2 instantiation of packages
99  
100 =cut
101  
102 my $get = L_SU_global_constants->new();
103 my $Project = Project_config->new();
104 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
105 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
106 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
107  
108 my $var = $get->var();
109 my $on = $var->{_on};
110 my $off = $var->{_off};
111 my $true = $var->{_true};
112 my $false = $var->{_false};
113 my $empty_string = $var->{_empty_string};
114  
115 =head2 Encapsulated
116 hash of private variables
117  
118 =cut
119  
120 my $sufwmix = {
121 _dx => '',
122 _key => '',
123 _keyg => '',
124 _vf => '',
125 _vmin => '',
126 _Step => '',
127 _note => '',
128  
129 };
130  
131 =head2 sub Step
132  
133 collects switches and assembles bash instructions
134 by adding the program name
135  
136 =cut
137  
138 sub Step {
139  
140 $sufwmix->{_Step} = 'sufwmix'.$sufwmix->{_Step};
141 return ( $sufwmix->{_Step} );
142  
143 }
144  
145  
146 =head2 sub note
147  
148 collects switches and assembles bash instructions
149 by adding the program name
150  
151 =cut
152  
153 sub note {
154  
155 $sufwmix->{_note} = 'sufwmix'.$sufwmix->{_note};
156 return ( $sufwmix->{_note} );
157  
158 }
159  
160  
161  
162 =head2 sub clear
163  
164 =cut
165  
166 sub clear {
167  
168 $sufwmix->{_dx} = '';
169 $sufwmix->{_key} = '';
170 $sufwmix->{_keyg} = '';
171 $sufwmix->{_vf} = '';
172 $sufwmix->{_vmin} = '';
173 $sufwmix->{_Step} = '';
174 $sufwmix->{_note} = '';
175 }
176  
177  
178 =head2 sub dx
179  
180  
181 =cut
182  
183 sub dx {
184  
185 my ( $self,$dx ) = @_;
186 if ( $dx ne $empty_string ) {
187  
188 $sufwmix->{_dx} = $dx;
189 $sufwmix->{_note} = $sufwmix->{_note}.' dx='.$sufwmix->{_dx};
190 $sufwmix->{_Step} = $sufwmix->{_Step}.' dx='.$sufwmix->{_dx};
191  
192 } else {
193 print("sufwmix, dx, missing dx,\n");
194 }
195 }
196  
197  
198 =head2 sub key
199  
200  
201 =cut
202  
203 sub key {
204  
205 my ( $self,$key ) = @_;
206 if ( $key ne $empty_string ) {
207  
208 $sufwmix->{_key} = $key;
209 $sufwmix->{_note} = $sufwmix->{_note}.' key='.$sufwmix->{_key};
210 $sufwmix->{_Step} = $sufwmix->{_Step}.' key='.$sufwmix->{_key};
211  
212 } else {
213 print("sufwmix, key, missing key,\n");
214 }
215 }
216  
217  
218 =head2 sub keyg
219  
220  
221 =cut
222  
223 sub keyg {
224  
225 my ( $self,$keyg ) = @_;
226 if ( $keyg ne $empty_string ) {
227  
228 $sufwmix->{_keyg} = $keyg;
229 $sufwmix->{_note} = $sufwmix->{_note}.' keyg='.$sufwmix->{_keyg};
230 $sufwmix->{_Step} = $sufwmix->{_Step}.' keyg='.$sufwmix->{_keyg};
231  
232 } else {
233 print("sufwmix, keyg, missing keyg,\n");
234 }
235 }
236  
237  
238 =head2 sub vf
239  
240  
241 =cut
242  
243 sub vf {
244  
245 my ( $self,$vf ) = @_;
246 if ( $vf ne $empty_string ) {
247  
248 $sufwmix->{_vf} = $vf;
249 $sufwmix->{_note} = $sufwmix->{_note}.' vf='.$sufwmix->{_vf};
250 $sufwmix->{_Step} = $sufwmix->{_Step}.' vf='.$sufwmix->{_vf};
251  
252 } else {
253 print("sufwmix, vf, missing vf,\n");
254 }
255 }
256  
257  
258 =head2 sub vmin
259  
260  
261 =cut
262  
263 sub vmin {
264  
265 my ( $self,$vmin ) = @_;
266 if ( $vmin ne $empty_string ) {
267  
268 $sufwmix->{_vmin} = $vmin;
269 $sufwmix->{_note} = $sufwmix->{_note}.' vmin='.$sufwmix->{_vmin};
270 $sufwmix->{_Step} = $sufwmix->{_Step}.' vmin='.$sufwmix->{_vmin};
271  
272 } else {
273 print("sufwmix, vmin, missing vmin,\n");
274 }
275 }
276  
277  
278 =head2 sub get_max_index
279  
280 max index = number of input variables -1
281
282 =cut
283
284 sub get_max_index {
285 my ($self) = @_;
286 my $max_index = 4;
287  
288 return($max_index);
289 }
290
291
292 1;