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

filter: Statementstmt 0.0% 0 / 133 Branchbran 0.0% 0 / 28 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 22 Podpod 0.0% 0 / 18 totaltotal 0.0% 0 / 201 CC 15 SCAR 16.3
CC
15
Cov
0%
cdpmax
6.0
cdpmin
6.0
dxcdp
6.0
CRAP 5.1
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::sudmotivz;
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 SUDMOTIVZ - DMO for Transeversely Isotropic V(Z) media for common-offset
25  
26 gathers
27  
28  
29  
30 sudmotivz <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 vnfile= binary (non-ascii) file containing NMO interval
49  
50 velocities (m/s)
51  
52 vfile= binary (non-ascii) file containing interval velocities (m/s)
53  
54 etafile= binary (non-ascii) file containing eta interval values (m/s)
55  
56 tdmo=0.0 times corresponding to interval velocities in vdmo (s)
57  
58 vndmo=1500.0 NMO interval velocities corresponding to times in tdmo (m/s)
59  
60 vdmo=vndmo interval velocities corresponding to times in tdmo (m/s)
61  
62 etadmo=1500.0 eta interval values corresponding to times in tdmo (m/s)
63  
64 fmax=0.5/dt maximum frequency in input traces (Hz)
65  
66 smute=1.5 stretch mute used for NMO correction
67  
68 speed=1.0 twist this knob for speed (and aliasing)
69  
70 verbose=0 =1 for diagnostic print
71  
72  
73  
74 Notes:
75  
76 Input traces should be sorted into common-offset gathers. One common-
77  
78 offset gather ends and another begins when the offset field of the trace
79  
80 headers changes.
81  
82  
83  
84 The cdp field of the input trace headers must be the cdp bin NUMBER, NOT
85  
86 the cdp location expressed in units of meters or feet.
87  
88  
89  
90 The number of offsets to mix (noffmix) should typically equal the ratio of
91  
92 the shotpoint spacing to the cdp spacing. This choice ensures that every
93  
94 cdp will be represented in each offset mix. Traces in each mix will
95  
96 contribute through DMO to other traces in adjacent cdps within that mix.
97  
98  
99  
100 vnfile, vfile and etafile should contain the regularly sampled interval
101  
102 values of NMO velocity, velocity and eta respectivily as a
103  
104 function of time. If, for example, vfile is not supplied, the interval
105  
106 velocity function is defined by linear interpolation of the values in the
107  
108 tdmo and vdmo arrays. The times in tdmo must be monotonically increasing.
109  
110 If vfile or vdmo are not given it will be equated to vnfile or vndmo.
111  
112  
113  
114 For each offset, the minimum time to process is determined using the
115  
116 smute parameter. The DMO correction is not computed for samples that
117  
118 have experienced greater stretch during NMO.
119  
120  
121  
122 Trace header fields accessed: nt, dt, delrt, offset, cdp.
123  
124 =head2 User's notes (Juan Lorenzo)
125 untested
126  
127 =cut
128  
129  
130 =head2 CHANGES and their DATES
131  
132 =cut
133  
134 use Moose;
135 our $VERSION = '0.0.1';
136  
137  
138 =head2 Import packages
139  
140 =cut
141  
142 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
143  
144 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
145 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
146  
147  
148 =head2 instantiation of packages
149  
150 =cut
151  
152 my $get = L_SU_global_constants->new();
153 my $Project = Project_config->new();
154 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
155 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
156 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
157  
158 my $PS_SEISMIC = $Project->PS_SEISMIC();
159  
160 my $var = $get->var();
161 my $on = $var->{_on};
162 my $off = $var->{_off};
163 my $true = $var->{_true};
164 my $false = $var->{_false};
165 my $empty_string = $var->{_empty_string};
166  
167 =head2 Encapsulated
168 hash of private variables
169  
170 =cut
171  
172 my $sudmotivz = {
173 _cdpmax => '',
174 _cdpmin => '',
175 _dxcdp => '',
176 _etadmo => '',
177 _etafile => '',
178 _fmax => '',
179 _smute => '',
180 _speed => '',
181 _tdmo => '',
182 _vdmo => '',
183 _verbose => '',
184 _vfile => '',
185 _vndmo => '',
186 _vnfile => '',
187 _Step => '',
188 _note => '',
189  
190 };
191  
192 =head2 sub Step
193  
194 collects switches and assembles bash instructions
195 by adding the program name
196  
197 =cut
198  
199 sub Step {
200  
201 $sudmotivz->{_Step} = 'sudmotivz'.$sudmotivz->{_Step};
202 return ( $sudmotivz->{_Step} );
203  
204 }
205  
206  
207 =head2 sub note
208  
209 collects switches and assembles bash instructions
210 by adding the program name
211  
212 =cut
213  
214 sub note {
215  
216 $sudmotivz->{_note} = 'sudmotivz'.$sudmotivz->{_note};
217 return ( $sudmotivz->{_note} );
218  
219 }
220  
221  
222  
223 =head2 sub clear
224  
225 =cut
226  
227 sub clear {
228  
229 $sudmotivz->{_cdpmax} = '';
230 $sudmotivz->{_cdpmin} = '';
231 $sudmotivz->{_dxcdp} = '';
232 $sudmotivz->{_etadmo} = '';
233 $sudmotivz->{_etafile} = '';
234 $sudmotivz->{_fmax} = '';
235 $sudmotivz->{_smute} = '';
236 $sudmotivz->{_speed} = '';
237 $sudmotivz->{_tdmo} = '';
238 $sudmotivz->{_vdmo} = '';
239 $sudmotivz->{_verbose} = '';
240 $sudmotivz->{_vfile} = '';
241 $sudmotivz->{_vndmo} = '';
242 $sudmotivz->{_vnfile} = '';
243 $sudmotivz->{_Step} = '';
244 $sudmotivz->{_note} = '';
245 }
246  
247  
248 =head2 sub cdpmax
249  
250  
251 =cut
252  
253 sub cdpmax {
254  
255 my ( $self,$cdpmax ) = @_;
256 if ( $cdpmax ne $empty_string ) {
257  
258 $sudmotivz->{_cdpmax} = $cdpmax;
259 $sudmotivz->{_note} = $sudmotivz->{_note}.' cdpmax='.$sudmotivz->{_cdpmax};
260 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' cdpmax='.$sudmotivz->{_cdpmax};
261  
262 } else {
263 print("sudmotivz, cdpmax, missing cdpmax,\n");
264 }
265 }
266  
267  
268 =head2 sub cdpmin
269  
270  
271 =cut
272  
273 sub cdpmin {
274  
275 my ( $self,$cdpmin ) = @_;
276 if ( $cdpmin ne $empty_string ) {
277  
278 $sudmotivz->{_cdpmin} = $cdpmin;
279 $sudmotivz->{_note} = $sudmotivz->{_note}.' cdpmin='.$sudmotivz->{_cdpmin};
280 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' cdpmin='.$sudmotivz->{_cdpmin};
281  
282 } else {
283 print("sudmotivz, cdpmin, missing cdpmin,\n");
284 }
285 }
286  
287  
288 =head2 sub dxcdp
289  
290  
291 =cut
292  
293 sub dxcdp {
294  
295 my ( $self,$dxcdp ) = @_;
296 if ( $dxcdp ne $empty_string ) {
297  
298 $sudmotivz->{_dxcdp} = $dxcdp;
299 $sudmotivz->{_note} = $sudmotivz->{_note}.' dxcdp='.$sudmotivz->{_dxcdp};
300 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' dxcdp='.$sudmotivz->{_dxcdp};
301  
302 } else {
303 print("sudmotivz, dxcdp, missing dxcdp,\n");
304 }
305 }
306  
307  
308 =head2 sub etadmo
309  
310  
311 =cut
312  
313 sub etadmo {
314  
315 my ( $self,$etadmo ) = @_;
316 if ( $etadmo ne $empty_string ) {
317  
318 $sudmotivz->{_etadmo} = $etadmo;
319 $sudmotivz->{_note} = $sudmotivz->{_note}.' etadmo='.$sudmotivz->{_etadmo};
320 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' etadmo='.$sudmotivz->{_etadmo};
321  
322 } else {
323 print("sudmotivz, etadmo, missing etadmo,\n");
324 }
325 }
326  
327  
328 =head2 sub etafile
329  
330  
331 =cut
332  
333 sub etafile {
334  
335 my ( $self,$etafile ) = @_;
336 if ( $etafile ne $empty_string ) {
337  
338 $sudmotivz->{_etafile} = $etafile;
339 $sudmotivz->{_note} = $sudmotivz->{_note}.' etafile='.$sudmotivz->{_etafile};
340 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' etafile='.$sudmotivz->{_etafile};
341  
342 } else {
343 print("sudmotivz, etafile, missing etafile,\n");
344 }
345 }
346  
347  
348 =head2 sub fmax
349  
350  
351 =cut
352  
353 sub fmax {
354  
355 my ( $self,$fmax ) = @_;
356 if ( $fmax ne $empty_string ) {
357  
358 $sudmotivz->{_fmax} = $fmax;
359 $sudmotivz->{_note} = $sudmotivz->{_note}.' fmax='.$sudmotivz->{_fmax};
360 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' fmax='.$sudmotivz->{_fmax};
361  
362 } else {
363 print("sudmotivz, fmax, missing fmax,\n");
364 }
365 }
366  
367  
368 =head2 sub smute
369  
370  
371 =cut
372  
373 sub smute {
374  
375 my ( $self,$smute ) = @_;
376 if ( $smute ne $empty_string ) {
377  
378 $sudmotivz->{_smute} = $smute;
379 $sudmotivz->{_note} = $sudmotivz->{_note}.' smute='.$sudmotivz->{_smute};
380 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' smute='.$sudmotivz->{_smute};
381  
382 } else {
383 print("sudmotivz, smute, missing smute,\n");
384 }
385 }
386  
387  
388 =head2 sub speed
389  
390  
391 =cut
392  
393 sub speed {
394  
395 my ( $self,$speed ) = @_;
396 if ( $speed ne $empty_string ) {
397  
398 $sudmotivz->{_speed} = $speed;
399 $sudmotivz->{_note} = $sudmotivz->{_note}.' speed='.$sudmotivz->{_speed};
400 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' speed='.$sudmotivz->{_speed};
401  
402 } else {
403 print("sudmotivz, speed, missing speed,\n");
404 }
405 }
406  
407  
408 =head2 sub tdmo
409  
410  
411 =cut
412  
413 sub tdmo {
414  
415 my ( $self,$tdmo ) = @_;
416 if ( $tdmo ne $empty_string ) {
417  
418 $sudmotivz->{_tdmo} = $tdmo;
419 $sudmotivz->{_note} = $sudmotivz->{_note}.' tdmo='.$sudmotivz->{_tdmo};
420 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' tdmo='.$sudmotivz->{_tdmo};
421  
422 } else {
423 print("sudmotivz, tdmo, missing tdmo,\n");
424 }
425 }
426  
427  
428 =head2 sub vdmo
429  
430  
431 =cut
432  
433 sub vdmo {
434  
435 my ( $self,$vdmo ) = @_;
436 if ( $vdmo ne $empty_string ) {
437  
438 $sudmotivz->{_vdmo} = $vdmo;
439 $sudmotivz->{_note} = $sudmotivz->{_note}.' vdmo='.$sudmotivz->{_vdmo};
440 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' vdmo='.$sudmotivz->{_vdmo};
441  
442 } else {
443 print("sudmotivz, vdmo, missing vdmo,\n");
444 }
445 }
446  
447  
448 =head2 sub verbose
449  
450  
451 =cut
452  
453 sub verbose {
454  
455 my ( $self,$verbose ) = @_;
456 if ( $verbose ne $empty_string ) {
457  
458 $sudmotivz->{_verbose} = $verbose;
459 $sudmotivz->{_note} = $sudmotivz->{_note}.' verbose='.$sudmotivz->{_verbose};
460 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' verbose='.$sudmotivz->{_verbose};
461  
462 } else {
463 print("sudmotivz, verbose, missing verbose,\n");
464 }
465 }
466  
467  
468 =head2 sub vfile
469  
470  
471 =cut
472  
473 sub vfile {
474  
475 my ( $self,$vfile ) = @_;
476 if ( $vfile ne $empty_string ) {
477  
478 $sudmotivz->{_vfile} = $vfile;
479 $sudmotivz->{_note} = $sudmotivz->{_note}.' vfile='.$sudmotivz->{_vfile};
480 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' vfile='.$sudmotivz->{_vfile};
481  
482 } else {
483 print("sudmotivz, vfile, missing vfile,\n");
484 }
485 }
486  
487  
488 =head2 sub vndmo
489  
490  
491 =cut
492  
493 sub vndmo {
494  
495 my ( $self,$vndmo ) = @_;
496 if ( $vndmo ne $empty_string ) {
497  
498 $sudmotivz->{_vndmo} = $vndmo;
499 $sudmotivz->{_note} = $sudmotivz->{_note}.' vndmo='.$sudmotivz->{_vndmo};
500 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' vndmo='.$sudmotivz->{_vndmo};
501  
502 } else {
503 print("sudmotivz, vndmo, missing vndmo,\n");
504 }
505 }
506  
507  
508 =head2 sub vnfile
509  
510  
511 =cut
512  
513 sub vnfile {
514  
515 my ( $self,$vnfile ) = @_;
516 if ( $vnfile ne $empty_string ) {
517  
518 $sudmotivz->{_vnfile} = $vnfile;
519 $sudmotivz->{_note} = $sudmotivz->{_note}.' vnfile='.$sudmotivz->{_vnfile};
520 $sudmotivz->{_Step} = $sudmotivz->{_Step}.' vnfile='.$sudmotivz->{_vnfile};
521  
522 } else {
523 print("sudmotivz, vnfile, missing vnfile,\n");
524 }
525 }
526  
527  
528 =head2 sub get_max_index
529  
530 max index = number of input variables -1
531
532 =cut
533
534 sub get_max_index {
535 my ($self) = @_;
536 my $max_index = 13;
537  
538 return($max_index);
539 }
540
541
542 1;