lib/App/SeismicUnixGui/sunix/migration/sumigprefd.pm untested

filter: Statementstmt 0.0% 0 / 140 Branchbran 0.0% 0 / 30 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 23 Podpod 0.0% 0 / 19 totaltotal 0.0% 0 / 212 CC 16 SCAR 16.4
CC
16
Cov
0%
dip
6.0
dx
6.0
dz
6.0
CRAP 5.2
1 package App::SeismicUnixGui::sunix::migration::sumigprefd;
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 SUMIGPREFD --- The 2-D prestack common-shot 45-90 degree
25  
26 finite-difference depth migration.
27  
28  
29  
30 sumigprefd <indata >outfile [parameters] ",
31  
32  
33  
34 Required Parameters: ",
35  
36 nxo= number of total horizontal output samples
37  
38 nxshot= number of shot gathers to be migrated
39  
40 nz= number of depth sapmles
41  
42 dx= horizontal sampling interval ",
43  
44 dz= depth sampling interval
45  
46 vfile= velocity profile, it must be binary format (see Notes)
47  
48
49  
50 Optional Parameters:
51  
52 dip=79 the maximum dip to migrate, possible values are:
53  
54 45,65,79,80,87,89,90 degrees
55  
56 The computation cost is 45 equals 65equals 79<80<87<89<90
57  
58 fmax=25 peak frequency of Ricker wavelet used as source wavelet
59  
60 f1=5
61  
62 f2=10
63  
64 f3=40
65  
66 f4=50 frequencies to build a Hamming window
67  
68  
69  
70 lpad=9999
71  
72 rpad=9999 number of zero traces padded on both
73  
74 sides of depth section to determine the
75  
76 migration aperature, the default values
77  
78 are using the full aperature.
79  
80 verbose=0 silent, =1 additional runtime information
81  
82  
83  
84 Notes:
85  
86 The input velocity file \'vfile\' consists of C-style binary floats.
87  
88 The structure of this file is vfile[iz][ix]. Note that this means that
89  
90 the x-direction is the fastest direction instead of z-direction! Such a
91  
92 structure is more convenient for the downward continuation type
93  
94 migration algorithm than using z as fastest dimension as in other SU
95  
96 programs.
97  
98  
99  
100 Because most of the tools in the SU package (such as unif2, unisam2, ",
101  
102 and makevel) produce output with the structure vfile[ix][iz], you will
103  
104 need to transpose the velocity files created by these programs. You may
105  
106 use the SU program \'transp\' in SU to transpose such files into the
107  
108 required vfile[iz][ix] structure.
109  
110 (In C v[iz][ix] denotes a v(x,z) array, whereas v[ix][iz]
111  
112 denotes a v(z,x) array, the opposite of what Matlab and Fortran
113  
114 programmers may expect.) ",
115  
116  
117  
118 Also, sx must be monotonically increasing throughout the dataset, and
119  
120 and gx must be monotonically increasing within a shot. You may resort
121  
122 your data with \'susort\', accordingly.
123  
124  
125  
126 The scalco header field is honored so this field must be set correctly.
127  
128 See selfdocs of \'susort\', \'suchw\'. Also: sukeyword scalco
129  
130  
131  
132  
133  
134  
135  
136 Credits: CWP, Baoniu Han, bhan@dix.mines.edu, April 19th, 1998
137  
138 Modified: Chris Stolk, 11 Dec 2005, - changed data input
139  
140 to remove erroneous time delay.
141  
142 Modified: CWP, John Stockwell 26 Sept 2006 - replaced Han's
143  
144 "goto-loop" in two places with "do { }while loops".
145  
146 Fixed it so that sx, gx, and scalco are honored.
147  
148  
149  
150  
151  
152  
153  
154 Trace header fields accessed: ns, dt, delrt, d2, sx, gx,
155  
156 Trace header fields modified: ns, dt, delrt
157  
158  
159  
160  
161  
162 =head2 User's notes (Juan Lorenzo)
163 untested
164  
165 =cut
166  
167  
168 =head2 CHANGES and their DATES
169  
170 =cut
171  
172 use Moose;
173 our $VERSION = '0.0.1';
174  
175  
176 =head2 Import packages
177  
178 =cut
179  
180 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
181  
182 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
183 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
184  
185  
186 =head2 instantiation of packages
187  
188 =cut
189  
190 my $get = L_SU_global_constants->new();
191 my $Project = Project_config->new();
192 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
193 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
194 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
195  
196 my $PS_SEISMIC = $Project->PS_SEISMIC();
197  
198 my $var = $get->var();
199 my $on = $var->{_on};
200 my $off = $var->{_off};
201 my $true = $var->{_true};
202 my $false = $var->{_false};
203 my $empty_string = $var->{_empty_string};
204  
205 =head2 Encapsulated
206 hash of private variables
207  
208 =cut
209  
210 my $sumigprefd = {
211 _dip => '',
212 _dx => '',
213 _dz => '',
214 _f1 => '',
215 _f2 => '',
216 _f3 => '',
217 _f4 => '',
218 _fmax => '',
219 _lpad => '',
220 _nxo => '',
221 _nxshot => '',
222 _nz => '',
223 _rpad => '',
224 _verbose => '',
225 _vfile => '',
226 _Step => '',
227 _note => '',
228  
229 };
230  
231 =head2 sub Step
232  
233 collects switches and assembles bash instructions
234 by adding the program name
235  
236 =cut
237  
238 sub Step {
239  
240 $sumigprefd->{_Step} = 'sumigprefd'.$sumigprefd->{_Step};
241 return ( $sumigprefd->{_Step} );
242  
243 }
244  
245  
246 =head2 sub note
247  
248 collects switches and assembles bash instructions
249 by adding the program name
250  
251 =cut
252  
253 sub note {
254  
255 $sumigprefd->{_note} = 'sumigprefd'.$sumigprefd->{_note};
256 return ( $sumigprefd->{_note} );
257  
258 }
259  
260  
261  
262 =head2 sub clear
263  
264 =cut
265  
266 sub clear {
267  
268 $sumigprefd->{_dip} = '';
269 $sumigprefd->{_dx} = '';
270 $sumigprefd->{_dz} = '';
271 $sumigprefd->{_f1} = '';
272 $sumigprefd->{_f2} = '';
273 $sumigprefd->{_f3} = '';
274 $sumigprefd->{_f4} = '';
275 $sumigprefd->{_fmax} = '';
276 $sumigprefd->{_lpad} = '';
277 $sumigprefd->{_nxo} = '';
278 $sumigprefd->{_nxshot} = '';
279 $sumigprefd->{_nz} = '';
280 $sumigprefd->{_rpad} = '';
281 $sumigprefd->{_verbose} = '';
282 $sumigprefd->{_vfile} = '';
283 $sumigprefd->{_Step} = '';
284 $sumigprefd->{_note} = '';
285 }
286  
287  
288 =head2 sub dip
289  
290  
291 =cut
292  
293 sub dip {
294  
295 my ( $self,$dip ) = @_;
296 if ( $dip ne $empty_string ) {
297  
298 $sumigprefd->{_dip} = $dip;
299 $sumigprefd->{_note} = $sumigprefd->{_note}.' dip='.$sumigprefd->{_dip};
300 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' dip='.$sumigprefd->{_dip};
301  
302 } else {
303 print("sumigprefd, dip, missing dip,\n");
304 }
305 }
306  
307  
308 =head2 sub dx
309  
310  
311 =cut
312  
313 sub dx {
314  
315 my ( $self,$dx ) = @_;
316 if ( $dx ne $empty_string ) {
317  
318 $sumigprefd->{_dx} = $dx;
319 $sumigprefd->{_note} = $sumigprefd->{_note}.' dx='.$sumigprefd->{_dx};
320 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' dx='.$sumigprefd->{_dx};
321  
322 } else {
323 print("sumigprefd, dx, missing dx,\n");
324 }
325 }
326  
327  
328 =head2 sub dz
329  
330  
331 =cut
332  
333 sub dz {
334  
335 my ( $self,$dz ) = @_;
336 if ( $dz ne $empty_string ) {
337  
338 $sumigprefd->{_dz} = $dz;
339 $sumigprefd->{_note} = $sumigprefd->{_note}.' dz='.$sumigprefd->{_dz};
340 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' dz='.$sumigprefd->{_dz};
341  
342 } else {
343 print("sumigprefd, dz, missing dz,\n");
344 }
345 }
346  
347  
348 =head2 sub f1
349  
350  
351 =cut
352  
353 sub f1 {
354  
355 my ( $self,$f1 ) = @_;
356 if ( $f1 ne $empty_string ) {
357  
358 $sumigprefd->{_f1} = $f1;
359 $sumigprefd->{_note} = $sumigprefd->{_note}.' f1='.$sumigprefd->{_f1};
360 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' f1='.$sumigprefd->{_f1};
361  
362 } else {
363 print("sumigprefd, f1, missing f1,\n");
364 }
365 }
366  
367  
368 =head2 sub f2
369  
370  
371 =cut
372  
373 sub f2 {
374  
375 my ( $self,$f2 ) = @_;
376 if ( $f2 ne $empty_string ) {
377  
378 $sumigprefd->{_f2} = $f2;
379 $sumigprefd->{_note} = $sumigprefd->{_note}.' f2='.$sumigprefd->{_f2};
380 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' f2='.$sumigprefd->{_f2};
381  
382 } else {
383 print("sumigprefd, f2, missing f2,\n");
384 }
385 }
386  
387  
388 =head2 sub f3
389  
390  
391 =cut
392  
393 sub f3 {
394  
395 my ( $self,$f3 ) = @_;
396 if ( $f3 ne $empty_string ) {
397  
398 $sumigprefd->{_f3} = $f3;
399 $sumigprefd->{_note} = $sumigprefd->{_note}.' f3='.$sumigprefd->{_f3};
400 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' f3='.$sumigprefd->{_f3};
401  
402 } else {
403 print("sumigprefd, f3, missing f3,\n");
404 }
405 }
406  
407  
408 =head2 sub f4
409  
410  
411 =cut
412  
413 sub f4 {
414  
415 my ( $self,$f4 ) = @_;
416 if ( $f4 ne $empty_string ) {
417  
418 $sumigprefd->{_f4} = $f4;
419 $sumigprefd->{_note} = $sumigprefd->{_note}.' f4='.$sumigprefd->{_f4};
420 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' f4='.$sumigprefd->{_f4};
421  
422 } else {
423 print("sumigprefd, f4, missing f4,\n");
424 }
425 }
426  
427  
428 =head2 sub fmax
429  
430  
431 =cut
432  
433 sub fmax {
434  
435 my ( $self,$fmax ) = @_;
436 if ( $fmax ne $empty_string ) {
437  
438 $sumigprefd->{_fmax} = $fmax;
439 $sumigprefd->{_note} = $sumigprefd->{_note}.' fmax='.$sumigprefd->{_fmax};
440 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' fmax='.$sumigprefd->{_fmax};
441  
442 } else {
443 print("sumigprefd, fmax, missing fmax,\n");
444 }
445 }
446  
447  
448 =head2 sub lpad
449  
450  
451 =cut
452  
453 sub lpad {
454  
455 my ( $self,$lpad ) = @_;
456 if ( $lpad ne $empty_string ) {
457  
458 $sumigprefd->{_lpad} = $lpad;
459 $sumigprefd->{_note} = $sumigprefd->{_note}.' lpad='.$sumigprefd->{_lpad};
460 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' lpad='.$sumigprefd->{_lpad};
461  
462 } else {
463 print("sumigprefd, lpad, missing lpad,\n");
464 }
465 }
466  
467  
468 =head2 sub nxo
469  
470  
471 =cut
472  
473 sub nxo {
474  
475 my ( $self,$nxo ) = @_;
476 if ( $nxo ne $empty_string ) {
477  
478 $sumigprefd->{_nxo} = $nxo;
479 $sumigprefd->{_note} = $sumigprefd->{_note}.' nxo='.$sumigprefd->{_nxo};
480 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' nxo='.$sumigprefd->{_nxo};
481  
482 } else {
483 print("sumigprefd, nxo, missing nxo,\n");
484 }
485 }
486  
487  
488 =head2 sub nxshot
489  
490  
491 =cut
492  
493 sub nxshot {
494  
495 my ( $self,$nxshot ) = @_;
496 if ( $nxshot ne $empty_string ) {
497  
498 $sumigprefd->{_nxshot} = $nxshot;
499 $sumigprefd->{_note} = $sumigprefd->{_note}.' nxshot='.$sumigprefd->{_nxshot};
500 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' nxshot='.$sumigprefd->{_nxshot};
501  
502 } else {
503 print("sumigprefd, nxshot, missing nxshot,\n");
504 }
505 }
506  
507  
508 =head2 sub nz
509  
510  
511 =cut
512  
513 sub nz {
514  
515 my ( $self,$nz ) = @_;
516 if ( $nz ne $empty_string ) {
517  
518 $sumigprefd->{_nz} = $nz;
519 $sumigprefd->{_note} = $sumigprefd->{_note}.' nz='.$sumigprefd->{_nz};
520 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' nz='.$sumigprefd->{_nz};
521  
522 } else {
523 print("sumigprefd, nz, missing nz,\n");
524 }
525 }
526  
527  
528 =head2 sub rpad
529  
530  
531 =cut
532  
533 sub rpad {
534  
535 my ( $self,$rpad ) = @_;
536 if ( $rpad ne $empty_string ) {
537  
538 $sumigprefd->{_rpad} = $rpad;
539 $sumigprefd->{_note} = $sumigprefd->{_note}.' rpad='.$sumigprefd->{_rpad};
540 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' rpad='.$sumigprefd->{_rpad};
541  
542 } else {
543 print("sumigprefd, rpad, missing rpad,\n");
544 }
545 }
546  
547  
548 =head2 sub verbose
549  
550  
551 =cut
552  
553 sub verbose {
554  
555 my ( $self,$verbose ) = @_;
556 if ( $verbose ne $empty_string ) {
557  
558 $sumigprefd->{_verbose} = $verbose;
559 $sumigprefd->{_note} = $sumigprefd->{_note}.' verbose='.$sumigprefd->{_verbose};
560 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' verbose='.$sumigprefd->{_verbose};
561  
562 } else {
563 print("sumigprefd, verbose, missing verbose,\n");
564 }
565 }
566  
567  
568 =head2 sub vfile
569  
570  
571 =cut
572  
573 sub vfile {
574  
575 my ( $self,$vfile ) = @_;
576 if ( $vfile ne $empty_string ) {
577  
578 $sumigprefd->{_vfile} = $vfile;
579 $sumigprefd->{_note} = $sumigprefd->{_note}.' vfile='.$sumigprefd->{_vfile};
580 $sumigprefd->{_Step} = $sumigprefd->{_Step}.' vfile='.$sumigprefd->{_vfile};
581  
582 } else {
583 print("sumigprefd, vfile, missing vfile,\n");
584 }
585 }
586  
587  
588 =head2 sub get_max_index
589  
590 max index = number of input variables -1
591
592 =cut
593
594 sub get_max_index {
595 my ($self) = @_;
596 my $max_index = 14;
597  
598 return($max_index);
599 }
600
601
602 1;