lib/App/SeismicUnixGui/sunix/inversion/suinvzco3d.pm untested

filter: Statementstmt 0.0% 0 / 210 Branchbran 0.0% 0 / 50 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 33 Podpod 0.0% 0 / 29 totaltotal 0.0% 0 / 322 CC 26 SCAR 17.0
CC
26
Cov
0%
ang
6.0
dt
6.0
dx
6.0
CRAP 5.4
1 package App::SeismicUnixGui::sunix::inversion::suinvzco3d;
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 SUINVZCO3D - Seismic INVersion of Common Offset data with V(Z) velocity
25  
26 function in 3D
27  
28  
29  
30 suinvzco3d <infile >outfile [optional parameters]
31  
32  
33  
34 Required Parameters:
35  
36 vfile= file containing velocity array v[nz]
37  
38 nz= number of z samples (1st dimension) in velocity
39  
40 nxm= number of midpoints of input traces
41  
42 ny= number of lines
43  
44  
45  
46 Optional Parameters:
47  
48 dt= or from header (dt) time sampling interval of input data
49  
50 offs= or from header (offset) source-receiver offset
51  
52 dxm= or from header (d2) sampling interval of midpoints
53  
54 fxm=0 first midpoint in input trace
55  
56 nxd=5 skipped number of midpoints (see note)
57  
58 dx=50.0 x sampling interval of velocity
59  
60 fx=0.0 first x sample of velocity
61  
62 dz=50.0 z sampling interval of velocity
63  
64 nxb=nx/2 band centered at midpoints (see note)
65  
66 fxo=0.0 x-coordinate of first output trace
67  
68 dxo=15.0 horizontal spacing of output trace
69  
70 nxo=101 number of output traces ",
71  
72 fyo=0.0 y-coordinate of first output trace
73  
74 dyo=15.0 y-coordinate spacing of output trace
75  
76 nyo=101 number of output traces in y-direction
77  
78 fzo=0.0 z-coordinate of first point in output trace
79  
80 dzo=15.0 vertical spacing of output trace
81  
82 nzo=101 number of points in output trace ",
83  
84 fmax=0.25/dt Maximum frequency set for operator antialiasing
85  
86 ang=180 Maximum dip angle allowed in the image
87  
88 verbose=1 =1 to print some useful information
89  
90  
91  
92 Notes:
93  
94  
95  
96 This algorithm is based on formula (50) in Geophysics Vol. 51,
97  
98 1552-1558, by Cohen, J., Hagin, F., and Bleistein, N.
99  
100  
101  
102 Traveltime and amplitude are calculated by ray tracing.
103  
104 Interpolation is used to calculate traveltime and amplitude. ",
105  
106 For each midpoint, traveltime and amplitude are calculated in the
107  
108 horizontal range of (xm-nxb*dx, xm+nxb*dx). Velocity is changed by
109  
110 linear interpolation in two upper trianglar corners whose width is
111  
112 nxc*dx and height is nzc*dz. ",
113  
114  
115  
116 Eikonal equation will fail to solve if there is a polar turned ray.
117  
118 In this case, the program shows the related geometric information.
119  
120
121  
122 Offsets are signed - may be positive or negative. ",
123  
124  
125  
126 =head2 User's notes (Juan Lorenzo)
127 untested
128  
129 =cut
130  
131  
132 =head2 CHANGES and their DATES
133  
134 =cut
135  
136 use Moose;
137 our $VERSION = '0.0.1';
138  
139  
140 =head2 Import packages
141  
142 =cut
143  
144 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
145  
146 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
147 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
148  
149  
150 =head2 instantiation of packages
151  
152 =cut
153  
154 my $get = L_SU_global_constants->new();
155 my $Project = Project_config->new();
156 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
157 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
158 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
159  
160 my $PS_SEISMIC = $Project->PS_SEISMIC();
161  
162 my $var = $get->var();
163 my $on = $var->{_on};
164 my $off = $var->{_off};
165 my $true = $var->{_true};
166 my $false = $var->{_false};
167 my $empty_string = $var->{_empty_string};
168  
169 =head2 Encapsulated
170 hash of private variables
171  
172 =cut
173  
174 my $suinvzco3d = {
175 _ang => '',
176 _dt => '',
177 _dx => '',
178 _dxm => '',
179 _dxo => '',
180 _dyo => '',
181 _dz => '',
182 _dzo => '',
183 _fmax => '',
184 _fx => '',
185 _fxm => '',
186 _fxo => '',
187 _fyo => '',
188 _fzo => '',
189 _nxb => '',
190 _nxd => '',
191 _nxm => '',
192 _nxo => '',
193 _ny => '',
194 _nyo => '',
195 _nz => '',
196 _nzo => '',
197 _offs => '',
198 _verbose => '',
199 _vfile => '',
200 _Step => '',
201 _note => '',
202  
203 };
204  
205 =head2 sub Step
206  
207 collects switches and assembles bash instructions
208 by adding the program name
209  
210 =cut
211  
212 sub Step {
213  
214 $suinvzco3d->{_Step} = 'suinvzco3d'.$suinvzco3d->{_Step};
215 return ( $suinvzco3d->{_Step} );
216  
217 }
218  
219  
220 =head2 sub note
221  
222 collects switches and assembles bash instructions
223 by adding the program name
224  
225 =cut
226  
227 sub note {
228  
229 $suinvzco3d->{_note} = 'suinvzco3d'.$suinvzco3d->{_note};
230 return ( $suinvzco3d->{_note} );
231  
232 }
233  
234  
235  
236 =head2 sub clear
237  
238 =cut
239  
240 sub clear {
241  
242 $suinvzco3d->{_ang} = '';
243 $suinvzco3d->{_dt} = '';
244 $suinvzco3d->{_dx} = '';
245 $suinvzco3d->{_dxm} = '';
246 $suinvzco3d->{_dxo} = '';
247 $suinvzco3d->{_dyo} = '';
248 $suinvzco3d->{_dz} = '';
249 $suinvzco3d->{_dzo} = '';
250 $suinvzco3d->{_fmax} = '';
251 $suinvzco3d->{_fx} = '';
252 $suinvzco3d->{_fxm} = '';
253 $suinvzco3d->{_fxo} = '';
254 $suinvzco3d->{_fyo} = '';
255 $suinvzco3d->{_fzo} = '';
256 $suinvzco3d->{_nxb} = '';
257 $suinvzco3d->{_nxd} = '';
258 $suinvzco3d->{_nxm} = '';
259 $suinvzco3d->{_nxo} = '';
260 $suinvzco3d->{_ny} = '';
261 $suinvzco3d->{_nyo} = '';
262 $suinvzco3d->{_nz} = '';
263 $suinvzco3d->{_nzo} = '';
264 $suinvzco3d->{_offs} = '';
265 $suinvzco3d->{_verbose} = '';
266 $suinvzco3d->{_vfile} = '';
267 $suinvzco3d->{_Step} = '';
268 $suinvzco3d->{_note} = '';
269 }
270  
271  
272 =head2 sub ang
273  
274  
275 =cut
276  
277 sub ang {
278  
279 my ( $self,$ang ) = @_;
280 if ( $ang ne $empty_string ) {
281  
282 $suinvzco3d->{_ang} = $ang;
283 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' ang='.$suinvzco3d->{_ang};
284 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' ang='.$suinvzco3d->{_ang};
285  
286 } else {
287 print("suinvzco3d, ang, missing ang,\n");
288 }
289 }
290  
291  
292 =head2 sub dt
293  
294  
295 =cut
296  
297 sub dt {
298  
299 my ( $self,$dt ) = @_;
300 if ( $dt ne $empty_string ) {
301  
302 $suinvzco3d->{_dt} = $dt;
303 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' dt='.$suinvzco3d->{_dt};
304 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' dt='.$suinvzco3d->{_dt};
305  
306 } else {
307 print("suinvzco3d, dt, missing dt,\n");
308 }
309 }
310  
311  
312 =head2 sub dx
313  
314  
315 =cut
316  
317 sub dx {
318  
319 my ( $self,$dx ) = @_;
320 if ( $dx ne $empty_string ) {
321  
322 $suinvzco3d->{_dx} = $dx;
323 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' dx='.$suinvzco3d->{_dx};
324 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' dx='.$suinvzco3d->{_dx};
325  
326 } else {
327 print("suinvzco3d, dx, missing dx,\n");
328 }
329 }
330  
331  
332 =head2 sub dxm
333  
334  
335 =cut
336  
337 sub dxm {
338  
339 my ( $self,$dxm ) = @_;
340 if ( $dxm ne $empty_string ) {
341  
342 $suinvzco3d->{_dxm} = $dxm;
343 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' dxm='.$suinvzco3d->{_dxm};
344 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' dxm='.$suinvzco3d->{_dxm};
345  
346 } else {
347 print("suinvzco3d, dxm, missing dxm,\n");
348 }
349 }
350  
351  
352 =head2 sub dxo
353  
354  
355 =cut
356  
357 sub dxo {
358  
359 my ( $self,$dxo ) = @_;
360 if ( $dxo ne $empty_string ) {
361  
362 $suinvzco3d->{_dxo} = $dxo;
363 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' dxo='.$suinvzco3d->{_dxo};
364 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' dxo='.$suinvzco3d->{_dxo};
365  
366 } else {
367 print("suinvzco3d, dxo, missing dxo,\n");
368 }
369 }
370  
371  
372 =head2 sub dyo
373  
374  
375 =cut
376  
377 sub dyo {
378  
379 my ( $self,$dyo ) = @_;
380 if ( $dyo ne $empty_string ) {
381  
382 $suinvzco3d->{_dyo} = $dyo;
383 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' dyo='.$suinvzco3d->{_dyo};
384 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' dyo='.$suinvzco3d->{_dyo};
385  
386 } else {
387 print("suinvzco3d, dyo, missing dyo,\n");
388 }
389 }
390  
391  
392 =head2 sub dz
393  
394  
395 =cut
396  
397 sub dz {
398  
399 my ( $self,$dz ) = @_;
400 if ( $dz ne $empty_string ) {
401  
402 $suinvzco3d->{_dz} = $dz;
403 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' dz='.$suinvzco3d->{_dz};
404 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' dz='.$suinvzco3d->{_dz};
405  
406 } else {
407 print("suinvzco3d, dz, missing dz,\n");
408 }
409 }
410  
411  
412 =head2 sub dzo
413  
414  
415 =cut
416  
417 sub dzo {
418  
419 my ( $self,$dzo ) = @_;
420 if ( $dzo ne $empty_string ) {
421  
422 $suinvzco3d->{_dzo} = $dzo;
423 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' dzo='.$suinvzco3d->{_dzo};
424 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' dzo='.$suinvzco3d->{_dzo};
425  
426 } else {
427 print("suinvzco3d, dzo, missing dzo,\n");
428 }
429 }
430  
431  
432 =head2 sub fmax
433  
434  
435 =cut
436  
437 sub fmax {
438  
439 my ( $self,$fmax ) = @_;
440 if ( $fmax ne $empty_string ) {
441  
442 $suinvzco3d->{_fmax} = $fmax;
443 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' fmax='.$suinvzco3d->{_fmax};
444 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' fmax='.$suinvzco3d->{_fmax};
445  
446 } else {
447 print("suinvzco3d, fmax, missing fmax,\n");
448 }
449 }
450  
451  
452 =head2 sub fx
453  
454  
455 =cut
456  
457 sub fx {
458  
459 my ( $self,$fx ) = @_;
460 if ( $fx ne $empty_string ) {
461  
462 $suinvzco3d->{_fx} = $fx;
463 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' fx='.$suinvzco3d->{_fx};
464 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' fx='.$suinvzco3d->{_fx};
465  
466 } else {
467 print("suinvzco3d, fx, missing fx,\n");
468 }
469 }
470  
471  
472 =head2 sub fxm
473  
474  
475 =cut
476  
477 sub fxm {
478  
479 my ( $self,$fxm ) = @_;
480 if ( $fxm ne $empty_string ) {
481  
482 $suinvzco3d->{_fxm} = $fxm;
483 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' fxm='.$suinvzco3d->{_fxm};
484 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' fxm='.$suinvzco3d->{_fxm};
485  
486 } else {
487 print("suinvzco3d, fxm, missing fxm,\n");
488 }
489 }
490  
491  
492 =head2 sub fxo
493  
494  
495 =cut
496  
497 sub fxo {
498  
499 my ( $self,$fxo ) = @_;
500 if ( $fxo ne $empty_string ) {
501  
502 $suinvzco3d->{_fxo} = $fxo;
503 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' fxo='.$suinvzco3d->{_fxo};
504 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' fxo='.$suinvzco3d->{_fxo};
505  
506 } else {
507 print("suinvzco3d, fxo, missing fxo,\n");
508 }
509 }
510  
511  
512 =head2 sub fyo
513  
514  
515 =cut
516  
517 sub fyo {
518  
519 my ( $self,$fyo ) = @_;
520 if ( $fyo ne $empty_string ) {
521  
522 $suinvzco3d->{_fyo} = $fyo;
523 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' fyo='.$suinvzco3d->{_fyo};
524 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' fyo='.$suinvzco3d->{_fyo};
525  
526 } else {
527 print("suinvzco3d, fyo, missing fyo,\n");
528 }
529 }
530  
531  
532 =head2 sub fzo
533  
534  
535 =cut
536  
537 sub fzo {
538  
539 my ( $self,$fzo ) = @_;
540 if ( $fzo ne $empty_string ) {
541  
542 $suinvzco3d->{_fzo} = $fzo;
543 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' fzo='.$suinvzco3d->{_fzo};
544 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' fzo='.$suinvzco3d->{_fzo};
545  
546 } else {
547 print("suinvzco3d, fzo, missing fzo,\n");
548 }
549 }
550  
551  
552 =head2 sub nxb
553  
554  
555 =cut
556  
557 sub nxb {
558  
559 my ( $self,$nxb ) = @_;
560 if ( $nxb ne $empty_string ) {
561  
562 $suinvzco3d->{_nxb} = $nxb;
563 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' nxb='.$suinvzco3d->{_nxb};
564 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' nxb='.$suinvzco3d->{_nxb};
565  
566 } else {
567 print("suinvzco3d, nxb, missing nxb,\n");
568 }
569 }
570  
571  
572 =head2 sub nxd
573  
574  
575 =cut
576  
577 sub nxd {
578  
579 my ( $self,$nxd ) = @_;
580 if ( $nxd ne $empty_string ) {
581  
582 $suinvzco3d->{_nxd} = $nxd;
583 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' nxd='.$suinvzco3d->{_nxd};
584 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' nxd='.$suinvzco3d->{_nxd};
585  
586 } else {
587 print("suinvzco3d, nxd, missing nxd,\n");
588 }
589 }
590  
591  
592 =head2 sub nxm
593  
594  
595 =cut
596  
597 sub nxm {
598  
599 my ( $self,$nxm ) = @_;
600 if ( $nxm ne $empty_string ) {
601  
602 $suinvzco3d->{_nxm} = $nxm;
603 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' nxm='.$suinvzco3d->{_nxm};
604 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' nxm='.$suinvzco3d->{_nxm};
605  
606 } else {
607 print("suinvzco3d, nxm, missing nxm,\n");
608 }
609 }
610  
611  
612 =head2 sub nxo
613  
614  
615 =cut
616  
617 sub nxo {
618  
619 my ( $self,$nxo ) = @_;
620 if ( $nxo ne $empty_string ) {
621  
622 $suinvzco3d->{_nxo} = $nxo;
623 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' nxo='.$suinvzco3d->{_nxo};
624 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' nxo='.$suinvzco3d->{_nxo};
625  
626 } else {
627 print("suinvzco3d, nxo, missing nxo,\n");
628 }
629 }
630  
631  
632 =head2 sub ny
633  
634  
635 =cut
636  
637 sub ny {
638  
639 my ( $self,$ny ) = @_;
640 if ( $ny ne $empty_string ) {
641  
642 $suinvzco3d->{_ny} = $ny;
643 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' ny='.$suinvzco3d->{_ny};
644 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' ny='.$suinvzco3d->{_ny};
645  
646 } else {
647 print("suinvzco3d, ny, missing ny,\n");
648 }
649 }
650  
651  
652 =head2 sub nyo
653  
654  
655 =cut
656  
657 sub nyo {
658  
659 my ( $self,$nyo ) = @_;
660 if ( $nyo ne $empty_string ) {
661  
662 $suinvzco3d->{_nyo} = $nyo;
663 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' nyo='.$suinvzco3d->{_nyo};
664 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' nyo='.$suinvzco3d->{_nyo};
665  
666 } else {
667 print("suinvzco3d, nyo, missing nyo,\n");
668 }
669 }
670  
671  
672 =head2 sub nz
673  
674  
675 =cut
676  
677 sub nz {
678  
679 my ( $self,$nz ) = @_;
680 if ( $nz ne $empty_string ) {
681  
682 $suinvzco3d->{_nz} = $nz;
683 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' nz='.$suinvzco3d->{_nz};
684 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' nz='.$suinvzco3d->{_nz};
685  
686 } else {
687 print("suinvzco3d, nz, missing nz,\n");
688 }
689 }
690  
691  
692 =head2 sub nzo
693  
694  
695 =cut
696  
697 sub nzo {
698  
699 my ( $self,$nzo ) = @_;
700 if ( $nzo ne $empty_string ) {
701  
702 $suinvzco3d->{_nzo} = $nzo;
703 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' nzo='.$suinvzco3d->{_nzo};
704 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' nzo='.$suinvzco3d->{_nzo};
705  
706 } else {
707 print("suinvzco3d, nzo, missing nzo,\n");
708 }
709 }
710  
711  
712 =head2 sub offs
713  
714  
715 =cut
716  
717 sub offs {
718  
719 my ( $self,$offs ) = @_;
720 if ( $offs ne $empty_string ) {
721  
722 $suinvzco3d->{_offs} = $offs;
723 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' offs='.$suinvzco3d->{_offs};
724 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' offs='.$suinvzco3d->{_offs};
725  
726 } else {
727 print("suinvzco3d, offs, missing offs,\n");
728 }
729 }
730  
731  
732 =head2 sub verbose
733  
734  
735 =cut
736  
737 sub verbose {
738  
739 my ( $self,$verbose ) = @_;
740 if ( $verbose ne $empty_string ) {
741  
742 $suinvzco3d->{_verbose} = $verbose;
743 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' verbose='.$suinvzco3d->{_verbose};
744 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' verbose='.$suinvzco3d->{_verbose};
745  
746 } else {
747 print("suinvzco3d, verbose, missing verbose,\n");
748 }
749 }
750  
751  
752 =head2 sub vfile
753  
754  
755 =cut
756  
757 sub vfile {
758  
759 my ( $self,$vfile ) = @_;
760 if ( $vfile ne $empty_string ) {
761  
762 $suinvzco3d->{_vfile} = $vfile;
763 $suinvzco3d->{_note} = $suinvzco3d->{_note}.' vfile='.$suinvzco3d->{_vfile};
764 $suinvzco3d->{_Step} = $suinvzco3d->{_Step}.' vfile='.$suinvzco3d->{_vfile};
765  
766 } else {
767 print("suinvzco3d, vfile, missing vfile,\n");
768 }
769 }
770  
771  
772 =head2 sub get_max_index
773  
774 max index = number of input variables -1
775
776 =cut
777
778 sub get_max_index {
779 my ($self) = @_;
780 my $max_index = 24;
781  
782 return($max_index);
783 }
784
785
786 1;