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