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

filter: Statementstmt 0.0% 0 / 126 Branchbran 0.0% 0 / 26 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 21 Podpod 0.0% 0 / 17 totaltotal 0.0% 0 / 190 CC 14 SCAR 16.2
CC
14
Cov
0%
cdpmax
6.0
cdpmin
6.0
dxcdp
6.0
CRAP 5.1
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::sudmofkcw;
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 SUDMOFKCW - converted-wave DMO via F-K domain (log-stretch) method for
25  
26 common-offset gathers
27  
28  
29  
30 sudmofkcw <stdin >stdout cdpmin= cdpmax= dxcdp= noffmix= [...]
31  
32  
33  
34 Required Parameters:
35  
36 cdpmin= minimum cdp (integer number) for which to apply DMO
37  
38 cdpmax= maximum cdp (integer number) for which to apply DMO
39  
40 dxcdp= distance between adjacent cdp bins (m)
41  
42 noffmix= number of offsets to mix (see notes)
43  
44  
45  
46 Optional Parameters:
47  
48 tdmo=0.0 times corresponding to rms velocities in vdmo (s)
49  
50 vdmo=1500.0 rms velocities corresponding to times in tdmo (m/s)
51  
52 gamma=0.5 velocity ratio, upgoing/downgoing
53  
54 ntable=1000 number of tabulated z/h and b/h (see notes)
55  
56 sdmo=1.0 DMO stretch factor; try 0.6 for typical v(z)
57  
58 flip=0 =1 for negative shifts and exchanging s1 and s2
59  
60 (see notes below)
61  
62 fmax=0.5/dt maximum frequency in input traces (Hz)
63  
64 verbose=0 =1 for diagnostic print
65  
66  
67  
68 Notes:
69  
70 Input traces should be sorted into common-offset gathers. One common-
71  
72 offset gather ends and another begins when the offset field of the trace
73  
74 headers changes.
75  
76  
77  
78 The cdp field of the input trace headers must be the cdp bin NUMBER, NOT
79  
80 the cdp location expressed in units of meters or feet.
81  
82  
83  
84 The number of offsets to mix (noffmix) should typically equal the ratio of
85  
86 the shotpoint spacing to the cdp spacing. This choice ensures that every
87  
88 cdp will be represented in each offset mix. Traces in each mix will
89  
90 contribute through DMO to other traces in adjacent cdps within that mix.
91  
92  
93  
94 The tdmo and vdmo arrays specify a velocity function of time that is
95  
96 used to implement a first-order correction for depth-variable velocity.
97  
98 The times in tdmo must be monotonically increasing. The velocity function
99  
100 is assumed to have been gotten by traditional NMO.
101  
102  
103  
104 For each offset, the minimum time at which a non-zero sample exists is
105  
106 used to determine a mute time. Output samples for times earlier than this
107  
108 mute time will be zeroed. Computation time may be significantly reduced
109  
110 if the input traces are zeroed (muted) for early times at large offsets.
111  
112  
113  
114 z/h is horizontal-reflector depth normalized to half source-reciver offset
115  
116 h. Normalized shift of conversion point is b/h. The code now does not
117  
118 support signed offsets, therefore it is recommended that only end-on data,
119  
120 not split-spread, be used as input (of course after being sorted into
121  
122 common-offset gathers). z/h vs b/h depends on gamma (see Alfaraj's Ph.D.
123  
124 thesis, 1993).
125  
126  
127  
128 Flip factor = 1 implies positive shift of traces (in the increasing CDP
129  
130 bin number direction). When processing split-spread data, for example,
131  
132 if one side of the spread is processed with flip=0, then the other side
133  
134 of the spread should be processed with flip=1. The flip factor also
135  
136 determines the actions of the factors s1 and s2, i.e., stretching or
137  
138 squeezing.
139  
140  
141  
142 Trace header fields accessed: nt, dt, delrt, offset, cdp.
143  
144  
145  
146  
147  
148 Credits:
149  
150 CWP: Mohamed Alfaraj
151  
152 Dave Hale
153  
154  
155  
156 Technical Reference:
157  
158 Transformation to zero offset for mode-converted waves
159  
160 Mohammed Alfaraj, Ph.D. thesis, 1993, Colorado School of Mines
161  
162  
163  
164 Dip-Moveout Processing - SEG Course Notes
165  
166 Dave Hale, 1988
167  
168  
169  
170 =head2 User's notes (Juan Lorenzo)
171 untested
172  
173 =cut
174  
175  
176 =head2 CHANGES and their DATES
177  
178 =cut
179  
180 use Moose;
181 our $VERSION = '0.0.1';
182  
183  
184 =head2 Import packages
185  
186 =cut
187  
188 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
189  
190 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
191 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
192  
193  
194 =head2 instantiation of packages
195  
196 =cut
197  
198 my $get = L_SU_global_constants->new();
199 my $Project = Project_config->new();
200 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
201 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
202 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
203  
204 my $PS_SEISMIC = $Project->PS_SEISMIC();
205  
206 my $var = $get->var();
207 my $on = $var->{_on};
208 my $off = $var->{_off};
209 my $true = $var->{_true};
210 my $false = $var->{_false};
211 my $empty_string = $var->{_empty_string};
212  
213 =head2 Encapsulated
214 hash of private variables
215  
216 =cut
217  
218 my $sudmofkcw = {
219 _cdpmax => '',
220 _cdpmin => '',
221 _dxcdp => '',
222 _factor => '',
223 _flip => '',
224 _fmax => '',
225 _gamma => '',
226 _noffmix => '',
227 _ntable => '',
228 _sdmo => '',
229 _tdmo => '',
230 _vdmo => '',
231 _verbose => '',
232 _Step => '',
233 _note => '',
234  
235 };
236  
237 =head2 sub Step
238  
239 collects switches and assembles bash instructions
240 by adding the program name
241  
242 =cut
243  
244 sub Step {
245  
246 $sudmofkcw->{_Step} = 'sudmofkcw'.$sudmofkcw->{_Step};
247 return ( $sudmofkcw->{_Step} );
248  
249 }
250  
251  
252 =head2 sub note
253  
254 collects switches and assembles bash instructions
255 by adding the program name
256  
257 =cut
258  
259 sub note {
260  
261 $sudmofkcw->{_note} = 'sudmofkcw'.$sudmofkcw->{_note};
262 return ( $sudmofkcw->{_note} );
263  
264 }
265  
266  
267  
268 =head2 sub clear
269  
270 =cut
271  
272 sub clear {
273  
274 $sudmofkcw->{_cdpmax} = '';
275 $sudmofkcw->{_cdpmin} = '';
276 $sudmofkcw->{_dxcdp} = '';
277 $sudmofkcw->{_factor} = '';
278 $sudmofkcw->{_flip} = '';
279 $sudmofkcw->{_fmax} = '';
280 $sudmofkcw->{_gamma} = '';
281 $sudmofkcw->{_noffmix} = '';
282 $sudmofkcw->{_ntable} = '';
283 $sudmofkcw->{_sdmo} = '';
284 $sudmofkcw->{_tdmo} = '';
285 $sudmofkcw->{_vdmo} = '';
286 $sudmofkcw->{_verbose} = '';
287 $sudmofkcw->{_Step} = '';
288 $sudmofkcw->{_note} = '';
289 }
290  
291  
292 =head2 sub cdpmax
293  
294  
295 =cut
296  
297 sub cdpmax {
298  
299 my ( $self,$cdpmax ) = @_;
300 if ( $cdpmax ne $empty_string ) {
301  
302 $sudmofkcw->{_cdpmax} = $cdpmax;
303 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' cdpmax='.$sudmofkcw->{_cdpmax};
304 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' cdpmax='.$sudmofkcw->{_cdpmax};
305  
306 } else {
307 print("sudmofkcw, cdpmax, missing cdpmax,\n");
308 }
309 }
310  
311  
312 =head2 sub cdpmin
313  
314  
315 =cut
316  
317 sub cdpmin {
318  
319 my ( $self,$cdpmin ) = @_;
320 if ( $cdpmin ne $empty_string ) {
321  
322 $sudmofkcw->{_cdpmin} = $cdpmin;
323 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' cdpmin='.$sudmofkcw->{_cdpmin};
324 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' cdpmin='.$sudmofkcw->{_cdpmin};
325  
326 } else {
327 print("sudmofkcw, cdpmin, missing cdpmin,\n");
328 }
329 }
330  
331  
332 =head2 sub dxcdp
333  
334  
335 =cut
336  
337 sub dxcdp {
338  
339 my ( $self,$dxcdp ) = @_;
340 if ( $dxcdp ne $empty_string ) {
341  
342 $sudmofkcw->{_dxcdp} = $dxcdp;
343 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' dxcdp='.$sudmofkcw->{_dxcdp};
344 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' dxcdp='.$sudmofkcw->{_dxcdp};
345  
346 } else {
347 print("sudmofkcw, dxcdp, missing dxcdp,\n");
348 }
349 }
350  
351  
352 =head2 sub factor
353  
354  
355 =cut
356  
357 sub factor {
358  
359 my ( $self,$factor ) = @_;
360 if ( $factor ne $empty_string ) {
361  
362 $sudmofkcw->{_factor} = $factor;
363 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' factor='.$sudmofkcw->{_factor};
364 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' factor='.$sudmofkcw->{_factor};
365  
366 } else {
367 print("sudmofkcw, factor, missing factor,\n");
368 }
369 }
370  
371  
372 =head2 sub flip
373  
374  
375 =cut
376  
377 sub flip {
378  
379 my ( $self,$flip ) = @_;
380 if ( $flip ne $empty_string ) {
381  
382 $sudmofkcw->{_flip} = $flip;
383 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' flip='.$sudmofkcw->{_flip};
384 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' flip='.$sudmofkcw->{_flip};
385  
386 } else {
387 print("sudmofkcw, flip, missing flip,\n");
388 }
389 }
390  
391  
392 =head2 sub fmax
393  
394  
395 =cut
396  
397 sub fmax {
398  
399 my ( $self,$fmax ) = @_;
400 if ( $fmax ne $empty_string ) {
401  
402 $sudmofkcw->{_fmax} = $fmax;
403 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' fmax='.$sudmofkcw->{_fmax};
404 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' fmax='.$sudmofkcw->{_fmax};
405  
406 } else {
407 print("sudmofkcw, fmax, missing fmax,\n");
408 }
409 }
410  
411  
412 =head2 sub gamma
413  
414  
415 =cut
416  
417 sub gamma {
418  
419 my ( $self,$gamma ) = @_;
420 if ( $gamma ne $empty_string ) {
421  
422 $sudmofkcw->{_gamma} = $gamma;
423 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' gamma='.$sudmofkcw->{_gamma};
424 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' gamma='.$sudmofkcw->{_gamma};
425  
426 } else {
427 print("sudmofkcw, gamma, missing gamma,\n");
428 }
429 }
430  
431  
432 =head2 sub noffmix
433  
434  
435 =cut
436  
437 sub noffmix {
438  
439 my ( $self,$noffmix ) = @_;
440 if ( $noffmix ne $empty_string ) {
441  
442 $sudmofkcw->{_noffmix} = $noffmix;
443 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' noffmix='.$sudmofkcw->{_noffmix};
444 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' noffmix='.$sudmofkcw->{_noffmix};
445  
446 } else {
447 print("sudmofkcw, noffmix, missing noffmix,\n");
448 }
449 }
450  
451  
452 =head2 sub ntable
453  
454  
455 =cut
456  
457 sub ntable {
458  
459 my ( $self,$ntable ) = @_;
460 if ( $ntable ne $empty_string ) {
461  
462 $sudmofkcw->{_ntable} = $ntable;
463 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' ntable='.$sudmofkcw->{_ntable};
464 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' ntable='.$sudmofkcw->{_ntable};
465  
466 } else {
467 print("sudmofkcw, ntable, missing ntable,\n");
468 }
469 }
470  
471  
472 =head2 sub sdmo
473  
474  
475 =cut
476  
477 sub sdmo {
478  
479 my ( $self,$sdmo ) = @_;
480 if ( $sdmo ne $empty_string ) {
481  
482 $sudmofkcw->{_sdmo} = $sdmo;
483 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' sdmo='.$sudmofkcw->{_sdmo};
484 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' sdmo='.$sudmofkcw->{_sdmo};
485  
486 } else {
487 print("sudmofkcw, sdmo, missing sdmo,\n");
488 }
489 }
490  
491  
492 =head2 sub tdmo
493  
494  
495 =cut
496  
497 sub tdmo {
498  
499 my ( $self,$tdmo ) = @_;
500 if ( $tdmo ne $empty_string ) {
501  
502 $sudmofkcw->{_tdmo} = $tdmo;
503 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' tdmo='.$sudmofkcw->{_tdmo};
504 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' tdmo='.$sudmofkcw->{_tdmo};
505  
506 } else {
507 print("sudmofkcw, tdmo, missing tdmo,\n");
508 }
509 }
510  
511  
512 =head2 sub vdmo
513  
514  
515 =cut
516  
517 sub vdmo {
518  
519 my ( $self,$vdmo ) = @_;
520 if ( $vdmo ne $empty_string ) {
521  
522 $sudmofkcw->{_vdmo} = $vdmo;
523 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' vdmo='.$sudmofkcw->{_vdmo};
524 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' vdmo='.$sudmofkcw->{_vdmo};
525  
526 } else {
527 print("sudmofkcw, vdmo, missing vdmo,\n");
528 }
529 }
530  
531  
532 =head2 sub verbose
533  
534  
535 =cut
536  
537 sub verbose {
538  
539 my ( $self,$verbose ) = @_;
540 if ( $verbose ne $empty_string ) {
541  
542 $sudmofkcw->{_verbose} = $verbose;
543 $sudmofkcw->{_note} = $sudmofkcw->{_note}.' verbose='.$sudmofkcw->{_verbose};
544 $sudmofkcw->{_Step} = $sudmofkcw->{_Step}.' verbose='.$sudmofkcw->{_verbose};
545  
546 } else {
547 print("sudmofkcw, verbose, missing verbose,\n");
548 }
549 }
550  
551  
552 =head2 sub get_max_index
553  
554 max index = number of input variables -1
555
556 =cut
557
558 sub get_max_index {
559 my ($self) = @_;
560 my $max_index = 12;
561  
562 return($max_index);
563 }
564
565
566 1;