lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/supws.pm untested

filter: Statementstmt 0.0% 0 / 77 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 10 totaltotal 0.0% 0 / 113 CC 7 SCAR 14.8
CC
7
Cov
0%
dt
6.0
key
6.0
ps
6.0
CRAP 4.4
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::supws;
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 SUPWS - Phase stack or phase-weighted stack (PWS) of adjacent traces
25  
26 having the same key header word
27  
28  
29  
30 supws <stdin >stdout [optional parameters]
31  
32  
33  
34 Required parameters:
35  
36 none
37  
38  
39  
40 Optional parameters:
41  
42 key=cdp key header word to stack on
43  
44 pwr=1.0 raise phase stack to power pwr
45  
46 dt=(from header) time sampling intervall in seconds
47  
48 sl=0.0 window length in seconds used for smoothing
49  
50 of the phase stack (weights)
51  
52 ps=0 0 = output is PWS, 1 = output is phase stack
53  
54 verbose=0 1 = echo additional information
55  
56  
57  
58 Note:
59  
60 Phase weighted stacking is a tool for efficient incoherent noise
61  
62 reduction. An amplitude-unbiased coherency measure is designed
63  
64 based on the instantaneous phase, which is used to weight the
65  
66 samples of an ordinary, linear stack. The result is called the
67  
68 phase-weighted stack (PWS) and is cleaned from incoherent noise.
69  
70 PWS thus permits detection of weak but coherent arrivals.
71  
72  
73  
74 The phase-stack (coherency measure) has values between 0 and 1.
75  
76  
77  
78 If the stacking is over cdp and the PWS option is set, then the
79  
80 offset header field is set to zero. Otherwise, output traces get
81  
82 their headers from the first trace of each data ensemble to stack,
83  
84 including the offset field. Use "sushw" afterwards, if this is
85  
86 not acceptable.
87  
88  
89  
90  
91  
92  
93  
94 Author: Nils Maercklin,
95  
96 GeoForschungsZentrum (GFZ) Potsdam, Germany, 2001.
97  
98 E-mail: nils@gfz-potsdam.de
99  
100  
101  
102 References:
103  
104 B. L. N. Kennett, 2000: Stacking three-component seismograms.
105  
106 Geophysical Journal International, vol. 141, p. 263-269.
107  
108 M. Schimmel and H. Paulssen, 1997: Noise reduction and detection
109  
110 of weak , coherent signals through phase-weighted stacks.
111  
112 Geophysical Journal International, vol. 130, p. 497-505.
113  
114 M. T. Taner, A. F. Koehler, and R. E. Sheriff, 1979: Complex
115  
116 seismic trace analysis. Geophysics, vol. 44, p. 1041-1063.
117  
118  
119  
120 Trace header fields accessed: ns
121  
122 Trace header fields modified: nhs, offset
123  
124  
125  
126  
127  
128 =head2 User's notes (Juan Lorenzo)
129 untested
130  
131 =cut
132  
133  
134 =head2 CHANGES and their DATES
135  
136 =cut
137  
138 use Moose;
139 our $VERSION = '0.0.1';
140  
141  
142 =head2 Import packages
143  
144 =cut
145  
146 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
147  
148 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
149 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
150  
151  
152 =head2 instantiation of packages
153  
154 =cut
155  
156 my $get = L_SU_global_constants->new();
157 my $Project = Project_config->new();
158 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
159 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
160 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
161  
162 my $PS_SEISMIC = $Project->PS_SEISMIC();
163  
164 my $var = $get->var();
165 my $on = $var->{_on};
166 my $off = $var->{_off};
167 my $true = $var->{_true};
168 my $false = $var->{_false};
169 my $empty_string = $var->{_empty_string};
170  
171 =head2 Encapsulated
172 hash of private variables
173  
174 =cut
175  
176 my $supws = {
177 _dt => '',
178 _key => '',
179 _ps => '',
180 _pwr => '',
181 _sl => '',
182 _verbose => '',
183 _Step => '',
184 _note => '',
185  
186 };
187  
188 =head2 sub Step
189  
190 collects switches and assembles bash instructions
191 by adding the program name
192  
193 =cut
194  
195 sub Step {
196  
197 $supws->{_Step} = 'supws'.$supws->{_Step};
198 return ( $supws->{_Step} );
199  
200 }
201  
202  
203 =head2 sub note
204  
205 collects switches and assembles bash instructions
206 by adding the program name
207  
208 =cut
209  
210 sub note {
211  
212 $supws->{_note} = 'supws'.$supws->{_note};
213 return ( $supws->{_note} );
214  
215 }
216  
217  
218  
219 =head2 sub clear
220  
221 =cut
222  
223 sub clear {
224  
225 $supws->{_dt} = '';
226 $supws->{_key} = '';
227 $supws->{_ps} = '';
228 $supws->{_pwr} = '';
229 $supws->{_sl} = '';
230 $supws->{_verbose} = '';
231 $supws->{_Step} = '';
232 $supws->{_note} = '';
233 }
234  
235  
236 =head2 sub dt
237  
238  
239 =cut
240  
241 sub dt {
242  
243 my ( $self,$dt ) = @_;
244 if ( $dt ne $empty_string ) {
245  
246 $supws->{_dt} = $dt;
247 $supws->{_note} = $supws->{_note}.' dt='.$supws->{_dt};
248 $supws->{_Step} = $supws->{_Step}.' dt='.$supws->{_dt};
249  
250 } else {
251 print("supws, dt, missing dt,\n");
252 }
253 }
254  
255  
256 =head2 sub key
257  
258  
259 =cut
260  
261 sub key {
262  
263 my ( $self,$key ) = @_;
264 if ( $key ne $empty_string ) {
265  
266 $supws->{_key} = $key;
267 $supws->{_note} = $supws->{_note}.' key='.$supws->{_key};
268 $supws->{_Step} = $supws->{_Step}.' key='.$supws->{_key};
269  
270 } else {
271 print("supws, key, missing key,\n");
272 }
273 }
274  
275  
276 =head2 sub ps
277  
278  
279 =cut
280  
281 sub ps {
282  
283 my ( $self,$ps ) = @_;
284 if ( $ps ne $empty_string ) {
285  
286 $supws->{_ps} = $ps;
287 $supws->{_note} = $supws->{_note}.' ps='.$supws->{_ps};
288 $supws->{_Step} = $supws->{_Step}.' ps='.$supws->{_ps};
289  
290 } else {
291 print("supws, ps, missing ps,\n");
292 }
293 }
294  
295  
296 =head2 sub pwr
297  
298  
299 =cut
300  
301 sub pwr {
302  
303 my ( $self,$pwr ) = @_;
304 if ( $pwr ne $empty_string ) {
305  
306 $supws->{_pwr} = $pwr;
307 $supws->{_note} = $supws->{_note}.' pwr='.$supws->{_pwr};
308 $supws->{_Step} = $supws->{_Step}.' pwr='.$supws->{_pwr};
309  
310 } else {
311 print("supws, pwr, missing pwr,\n");
312 }
313 }
314  
315  
316 =head2 sub sl
317  
318  
319 =cut
320  
321 sub sl {
322  
323 my ( $self,$sl ) = @_;
324 if ( $sl ne $empty_string ) {
325  
326 $supws->{_sl} = $sl;
327 $supws->{_note} = $supws->{_note}.' sl='.$supws->{_sl};
328 $supws->{_Step} = $supws->{_Step}.' sl='.$supws->{_sl};
329  
330 } else {
331 print("supws, sl, missing sl,\n");
332 }
333 }
334  
335  
336 =head2 sub verbose
337  
338  
339 =cut
340  
341 sub verbose {
342  
343 my ( $self,$verbose ) = @_;
344 if ( $verbose ne $empty_string ) {
345  
346 $supws->{_verbose} = $verbose;
347 $supws->{_note} = $supws->{_note}.' verbose='.$supws->{_verbose};
348 $supws->{_Step} = $supws->{_Step}.' verbose='.$supws->{_verbose};
349  
350 } else {
351 print("supws, verbose, missing verbose,\n");
352 }
353 }
354  
355  
356 =head2 sub get_max_index
357  
358 max index = number of input variables -1
359
360 =cut
361
362 sub get_max_index {
363 my ($self) = @_;
364 my $max_index = 5;
365  
366 return($max_index);
367 }
368
369
370 1;