lib/App/SeismicUnixGui/sunix/model/suimp3d.pm untested

filter: Statementstmt 0.0% 0 / 181 Branchbran 0.0% 0 / 42 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 29 Podpod 0.0% 0 / 25 totaltotal 0.0% 0 / 277 CC 22 SCAR 16.8
CC
22
Cov
0%
c
6.0
dgx
6.0
dgy
6.0
CRAP 5.4
1 package App::SeismicUnixGui::sunix::model::suimp3d;
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 SUIMP3D - generate inplane shot records for a point
25  
26 scatterer embedded in three dimensions using
27  
28 the Born integral equation ",
29  
30  
31  
32 suimp3d [optional parameters] >stdout
33  
34  
35  
36 Optional parameters
37  
38 nshot=1 number of shots
39  
40 nrec=1 number of receivers
41  
42 c=5000 speed
43  
44 dt=.004 sampling rate
45  
46 nt=256 number of samples
47  
48 x0=1000 point scatterer location
49  
50 y0=0 point scatterer location
51  
52 z0=1000 point scatterer location
53  
54 dir=0 do not include direct arrival
55  
56 =1 include direct arrival
57  
58 sxmin=0 first shot location
59  
60 symin=0 first shot location
61  
62 szmin=0 first shot location
63  
64 gxmin=0 first receiver location
65  
66 gymin=0 first receiver location
67  
68 gzmin=0 first receiver location
69  
70 dsx=100 x-step in shot location
71  
72 dsy=0 y-step in shot location
73  
74 dsz=0 z-step in shot location
75  
76 dgx=100 x-step in receiver location
77  
78 dgy=0 y-step in receiver location
79  
80 dgz=0 z-step in receiver location
81  
82  
83  
84 Example:
85  
86 suimp3d nrec=32 | sufilter | supswigp | ...
87  
88  
89  
90  
91  
92 Credits:
93  
94 CWP: Norm Bleistein, Jack K. Cohen
95  
96 UHouston: Chris Liner 2010 (added direct arrival option)
97  
98  
99  
100  
101  
102
103  
104 Theory: Use the 3D Born integral equation (e.g., Geophysics,
105  
106 v51, n8, p1554(7)). Use 3-D delta function for alpha.
107  
108  
109  
110 Note: Setting a 3D offset in a single offset field beats the
111  
112 hell out of us. We did _something_.
113  
114  
115  
116 Trace header fields set: ns, dt, tracl, tracr, fldr, tracf,
117  
118 sx, sy, selev, gx, gy, gelev, offset
119  
120  
121  
122 =head2 User's notes (Juan Lorenzo)
123 untested
124  
125 =cut
126  
127  
128 =head2 CHANGES and their DATES
129  
130 =cut
131  
132 use Moose;
133 our $VERSION = '0.0.1';
134  
135  
136 =head2 Import packages
137  
138 =cut
139  
140 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
141  
142 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
143 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
144  
145  
146 =head2 instantiation of packages
147  
148 =cut
149  
150 my $get = L_SU_global_constants->new();
151 my $Project = Project_config->new();
152 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
153 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
154 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
155  
156 my $var = $get->var();
157 my $on = $var->{_on};
158 my $off = $var->{_off};
159 my $true = $var->{_true};
160 my $false = $var->{_false};
161 my $empty_string = $var->{_empty_string};
162  
163 =head2 Encapsulated
164 hash of private variables
165  
166 =cut
167  
168 my $suimp3d = {
169 _c => '',
170 _dgx => '',
171 _dgy => '',
172 _dgz => '',
173 _dir => '',
174 _dsx => '',
175 _dsy => '',
176 _dsz => '',
177 _dt => '',
178 _gxmin => '',
179 _gymin => '',
180 _gzmin => '',
181 _nrec => '',
182 _nshot => '',
183 _nt => '',
184 _sxmin => '',
185 _symin => '',
186 _szmin => '',
187 _x0 => '',
188 _y0 => '',
189 _z0 => '',
190 _Step => '',
191 _note => '',
192  
193 };
194  
195 =head2 sub Step
196  
197 collects switches and assembles bash instructions
198 by adding the program name
199  
200 =cut
201  
202 sub Step {
203  
204 $suimp3d->{_Step} = 'suimp3d'.$suimp3d->{_Step};
205 return ( $suimp3d->{_Step} );
206  
207 }
208  
209  
210 =head2 sub note
211  
212 collects switches and assembles bash instructions
213 by adding the program name
214  
215 =cut
216  
217 sub note {
218  
219 $suimp3d->{_note} = 'suimp3d'.$suimp3d->{_note};
220 return ( $suimp3d->{_note} );
221  
222 }
223  
224  
225  
226 =head2 sub clear
227  
228 =cut
229  
230 sub clear {
231  
232 $suimp3d->{_c} = '';
233 $suimp3d->{_dgx} = '';
234 $suimp3d->{_dgy} = '';
235 $suimp3d->{_dgz} = '';
236 $suimp3d->{_dir} = '';
237 $suimp3d->{_dsx} = '';
238 $suimp3d->{_dsy} = '';
239 $suimp3d->{_dsz} = '';
240 $suimp3d->{_dt} = '';
241 $suimp3d->{_gxmin} = '';
242 $suimp3d->{_gymin} = '';
243 $suimp3d->{_gzmin} = '';
244 $suimp3d->{_nrec} = '';
245 $suimp3d->{_nshot} = '';
246 $suimp3d->{_nt} = '';
247 $suimp3d->{_sxmin} = '';
248 $suimp3d->{_symin} = '';
249 $suimp3d->{_szmin} = '';
250 $suimp3d->{_x0} = '';
251 $suimp3d->{_y0} = '';
252 $suimp3d->{_z0} = '';
253 $suimp3d->{_Step} = '';
254 $suimp3d->{_note} = '';
255 }
256  
257  
258 =head2 sub c
259  
260  
261 =cut
262  
263 sub c {
264  
265 my ( $self,$c ) = @_;
266 if ( $c ne $empty_string ) {
267  
268 $suimp3d->{_c} = $c;
269 $suimp3d->{_note} = $suimp3d->{_note}.' c='.$suimp3d->{_c};
270 $suimp3d->{_Step} = $suimp3d->{_Step}.' c='.$suimp3d->{_c};
271  
272 } else {
273 print("suimp3d, c, missing c,\n");
274 }
275 }
276  
277  
278 =head2 sub dgx
279  
280  
281 =cut
282  
283 sub dgx {
284  
285 my ( $self,$dgx ) = @_;
286 if ( $dgx ne $empty_string ) {
287  
288 $suimp3d->{_dgx} = $dgx;
289 $suimp3d->{_note} = $suimp3d->{_note}.' dgx='.$suimp3d->{_dgx};
290 $suimp3d->{_Step} = $suimp3d->{_Step}.' dgx='.$suimp3d->{_dgx};
291  
292 } else {
293 print("suimp3d, dgx, missing dgx,\n");
294 }
295 }
296  
297  
298 =head2 sub dgy
299  
300  
301 =cut
302  
303 sub dgy {
304  
305 my ( $self,$dgy ) = @_;
306 if ( $dgy ne $empty_string ) {
307  
308 $suimp3d->{_dgy} = $dgy;
309 $suimp3d->{_note} = $suimp3d->{_note}.' dgy='.$suimp3d->{_dgy};
310 $suimp3d->{_Step} = $suimp3d->{_Step}.' dgy='.$suimp3d->{_dgy};
311  
312 } else {
313 print("suimp3d, dgy, missing dgy,\n");
314 }
315 }
316  
317  
318 =head2 sub dgz
319  
320  
321 =cut
322  
323 sub dgz {
324  
325 my ( $self,$dgz ) = @_;
326 if ( $dgz ne $empty_string ) {
327  
328 $suimp3d->{_dgz} = $dgz;
329 $suimp3d->{_note} = $suimp3d->{_note}.' dgz='.$suimp3d->{_dgz};
330 $suimp3d->{_Step} = $suimp3d->{_Step}.' dgz='.$suimp3d->{_dgz};
331  
332 } else {
333 print("suimp3d, dgz, missing dgz,\n");
334 }
335 }
336  
337  
338 =head2 sub dir
339  
340  
341 =cut
342  
343 sub dir {
344  
345 my ( $self,$dir ) = @_;
346 if ( $dir ne $empty_string ) {
347  
348 $suimp3d->{_dir} = $dir;
349 $suimp3d->{_note} = $suimp3d->{_note}.' dir='.$suimp3d->{_dir};
350 $suimp3d->{_Step} = $suimp3d->{_Step}.' dir='.$suimp3d->{_dir};
351  
352 } else {
353 print("suimp3d, dir, missing dir,\n");
354 }
355 }
356  
357  
358 =head2 sub dsx
359  
360  
361 =cut
362  
363 sub dsx {
364  
365 my ( $self,$dsx ) = @_;
366 if ( $dsx ne $empty_string ) {
367  
368 $suimp3d->{_dsx} = $dsx;
369 $suimp3d->{_note} = $suimp3d->{_note}.' dsx='.$suimp3d->{_dsx};
370 $suimp3d->{_Step} = $suimp3d->{_Step}.' dsx='.$suimp3d->{_dsx};
371  
372 } else {
373 print("suimp3d, dsx, missing dsx,\n");
374 }
375 }
376  
377  
378 =head2 sub dsy
379  
380  
381 =cut
382  
383 sub dsy {
384  
385 my ( $self,$dsy ) = @_;
386 if ( $dsy ne $empty_string ) {
387  
388 $suimp3d->{_dsy} = $dsy;
389 $suimp3d->{_note} = $suimp3d->{_note}.' dsy='.$suimp3d->{_dsy};
390 $suimp3d->{_Step} = $suimp3d->{_Step}.' dsy='.$suimp3d->{_dsy};
391  
392 } else {
393 print("suimp3d, dsy, missing dsy,\n");
394 }
395 }
396  
397  
398 =head2 sub dsz
399  
400  
401 =cut
402  
403 sub dsz {
404  
405 my ( $self,$dsz ) = @_;
406 if ( $dsz ne $empty_string ) {
407  
408 $suimp3d->{_dsz} = $dsz;
409 $suimp3d->{_note} = $suimp3d->{_note}.' dsz='.$suimp3d->{_dsz};
410 $suimp3d->{_Step} = $suimp3d->{_Step}.' dsz='.$suimp3d->{_dsz};
411  
412 } else {
413 print("suimp3d, dsz, missing dsz,\n");
414 }
415 }
416  
417  
418 =head2 sub dt
419  
420  
421 =cut
422  
423 sub dt {
424  
425 my ( $self,$dt ) = @_;
426 if ( $dt ne $empty_string ) {
427  
428 $suimp3d->{_dt} = $dt;
429 $suimp3d->{_note} = $suimp3d->{_note}.' dt='.$suimp3d->{_dt};
430 $suimp3d->{_Step} = $suimp3d->{_Step}.' dt='.$suimp3d->{_dt};
431  
432 } else {
433 print("suimp3d, dt, missing dt,\n");
434 }
435 }
436  
437  
438 =head2 sub gxmin
439  
440  
441 =cut
442  
443 sub gxmin {
444  
445 my ( $self,$gxmin ) = @_;
446 if ( $gxmin ne $empty_string ) {
447  
448 $suimp3d->{_gxmin} = $gxmin;
449 $suimp3d->{_note} = $suimp3d->{_note}.' gxmin='.$suimp3d->{_gxmin};
450 $suimp3d->{_Step} = $suimp3d->{_Step}.' gxmin='.$suimp3d->{_gxmin};
451  
452 } else {
453 print("suimp3d, gxmin, missing gxmin,\n");
454 }
455 }
456  
457  
458 =head2 sub gymin
459  
460  
461 =cut
462  
463 sub gymin {
464  
465 my ( $self,$gymin ) = @_;
466 if ( $gymin ne $empty_string ) {
467  
468 $suimp3d->{_gymin} = $gymin;
469 $suimp3d->{_note} = $suimp3d->{_note}.' gymin='.$suimp3d->{_gymin};
470 $suimp3d->{_Step} = $suimp3d->{_Step}.' gymin='.$suimp3d->{_gymin};
471  
472 } else {
473 print("suimp3d, gymin, missing gymin,\n");
474 }
475 }
476  
477  
478 =head2 sub gzmin
479  
480  
481 =cut
482  
483 sub gzmin {
484  
485 my ( $self,$gzmin ) = @_;
486 if ( $gzmin ne $empty_string ) {
487  
488 $suimp3d->{_gzmin} = $gzmin;
489 $suimp3d->{_note} = $suimp3d->{_note}.' gzmin='.$suimp3d->{_gzmin};
490 $suimp3d->{_Step} = $suimp3d->{_Step}.' gzmin='.$suimp3d->{_gzmin};
491  
492 } else {
493 print("suimp3d, gzmin, missing gzmin,\n");
494 }
495 }
496  
497  
498 =head2 sub nrec
499  
500  
501 =cut
502  
503 sub nrec {
504  
505 my ( $self,$nrec ) = @_;
506 if ( $nrec ne $empty_string ) {
507  
508 $suimp3d->{_nrec} = $nrec;
509 $suimp3d->{_note} = $suimp3d->{_note}.' nrec='.$suimp3d->{_nrec};
510 $suimp3d->{_Step} = $suimp3d->{_Step}.' nrec='.$suimp3d->{_nrec};
511  
512 } else {
513 print("suimp3d, nrec, missing nrec,\n");
514 }
515 }
516  
517  
518 =head2 sub nshot
519  
520  
521 =cut
522  
523 sub nshot {
524  
525 my ( $self,$nshot ) = @_;
526 if ( $nshot ne $empty_string ) {
527  
528 $suimp3d->{_nshot} = $nshot;
529 $suimp3d->{_note} = $suimp3d->{_note}.' nshot='.$suimp3d->{_nshot};
530 $suimp3d->{_Step} = $suimp3d->{_Step}.' nshot='.$suimp3d->{_nshot};
531  
532 } else {
533 print("suimp3d, nshot, missing nshot,\n");
534 }
535 }
536  
537  
538 =head2 sub nt
539  
540  
541 =cut
542  
543 sub nt {
544  
545 my ( $self,$nt ) = @_;
546 if ( $nt ne $empty_string ) {
547  
548 $suimp3d->{_nt} = $nt;
549 $suimp3d->{_note} = $suimp3d->{_note}.' nt='.$suimp3d->{_nt};
550 $suimp3d->{_Step} = $suimp3d->{_Step}.' nt='.$suimp3d->{_nt};
551  
552 } else {
553 print("suimp3d, nt, missing nt,\n");
554 }
555 }
556  
557  
558 =head2 sub sxmin
559  
560  
561 =cut
562  
563 sub sxmin {
564  
565 my ( $self,$sxmin ) = @_;
566 if ( $sxmin ne $empty_string ) {
567  
568 $suimp3d->{_sxmin} = $sxmin;
569 $suimp3d->{_note} = $suimp3d->{_note}.' sxmin='.$suimp3d->{_sxmin};
570 $suimp3d->{_Step} = $suimp3d->{_Step}.' sxmin='.$suimp3d->{_sxmin};
571  
572 } else {
573 print("suimp3d, sxmin, missing sxmin,\n");
574 }
575 }
576  
577  
578 =head2 sub symin
579  
580  
581 =cut
582  
583 sub symin {
584  
585 my ( $self,$symin ) = @_;
586 if ( $symin ne $empty_string ) {
587  
588 $suimp3d->{_symin} = $symin;
589 $suimp3d->{_note} = $suimp3d->{_note}.' symin='.$suimp3d->{_symin};
590 $suimp3d->{_Step} = $suimp3d->{_Step}.' symin='.$suimp3d->{_symin};
591  
592 } else {
593 print("suimp3d, symin, missing symin,\n");
594 }
595 }
596  
597  
598 =head2 sub szmin
599  
600  
601 =cut
602  
603 sub szmin {
604  
605 my ( $self,$szmin ) = @_;
606 if ( $szmin ne $empty_string ) {
607  
608 $suimp3d->{_szmin} = $szmin;
609 $suimp3d->{_note} = $suimp3d->{_note}.' szmin='.$suimp3d->{_szmin};
610 $suimp3d->{_Step} = $suimp3d->{_Step}.' szmin='.$suimp3d->{_szmin};
611  
612 } else {
613 print("suimp3d, szmin, missing szmin,\n");
614 }
615 }
616  
617  
618 =head2 sub x0
619  
620  
621 =cut
622  
623 sub x0 {
624  
625 my ( $self,$x0 ) = @_;
626 if ( $x0 ne $empty_string ) {
627  
628 $suimp3d->{_x0} = $x0;
629 $suimp3d->{_note} = $suimp3d->{_note}.' x0='.$suimp3d->{_x0};
630 $suimp3d->{_Step} = $suimp3d->{_Step}.' x0='.$suimp3d->{_x0};
631  
632 } else {
633 print("suimp3d, x0, missing x0,\n");
634 }
635 }
636  
637  
638 =head2 sub y0
639  
640  
641 =cut
642  
643 sub y0 {
644  
645 my ( $self,$y0 ) = @_;
646 if ( $y0 ne $empty_string ) {
647  
648 $suimp3d->{_y0} = $y0;
649 $suimp3d->{_note} = $suimp3d->{_note}.' y0='.$suimp3d->{_y0};
650 $suimp3d->{_Step} = $suimp3d->{_Step}.' y0='.$suimp3d->{_y0};
651  
652 } else {
653 print("suimp3d, y0, missing y0,\n");
654 }
655 }
656  
657  
658 =head2 sub z0
659  
660  
661 =cut
662  
663 sub z0 {
664  
665 my ( $self,$z0 ) = @_;
666 if ( $z0 ne $empty_string ) {
667  
668 $suimp3d->{_z0} = $z0;
669 $suimp3d->{_note} = $suimp3d->{_note}.' z0='.$suimp3d->{_z0};
670 $suimp3d->{_Step} = $suimp3d->{_Step}.' z0='.$suimp3d->{_z0};
671  
672 } else {
673 print("suimp3d, z0, missing z0,\n");
674 }
675 }
676  
677  
678 =head2 sub get_max_index
679  
680 max index = number of input variables -1
681
682 =cut
683
684 sub get_max_index {
685 my ($self) = @_;
686 my $max_index = 20;
687  
688 return($max_index);
689 }
690
691
692 1;