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

filter: Statementstmt 0.0% 0 / 126 Branchbran 0.0% 0 / 26 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 21 Podpod 0.0% 0 / 17 totaltotal 0.0% 0 / 190 CC 14 SCAR 16.2
CC
14
Cov
0%
dx
6.0
dz
6.0
f2
6.0
CRAP 5.1
1 package App::SeismicUnixGui::sunix::migration::sumigpresp;
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 SUMIGPRESP - The 2-D prestack common-shot split-step Fourier ",
25  
26 migration
27  
28  
29  
30 sumigpresp <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=
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 values
69  
70 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 Modified: Chris Stolk, 11 Dec 2005, - changed data input
131  
132 to remove erroneous time delay.
133  
134 Modified: CWP, John Stockwell 26 Sept 2006 - replaced Han's
135  
136 "goto-loop" in two places with "do { }while loops".
137  
138 Fixed it so that sx, gx, and scalco are honored.
139  
140  
141  
142  
143  
144 Trace header fields accessed: ns, dt, delrt, d2, sx, gx, scalco
145  
146 Trace header fields modified: ns, dt, delrt
147  
148  
149  
150  
151  
152 =head2 User's notes (Juan Lorenzo)
153 untested
154  
155 =cut
156  
157  
158 =head2 CHANGES and their DATES
159  
160 =cut
161  
162 use Moose;
163 our $VERSION = '0.0.1';
164  
165  
166 =head2 Import packages
167  
168 =cut
169  
170 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
171  
172 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
173 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
174  
175  
176 =head2 instantiation of packages
177  
178 =cut
179  
180 my $get = L_SU_global_constants->new();
181 my $Project = Project_config->new();
182 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
183 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
184 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
185  
186 my $PS_SEISMIC = $Project->PS_SEISMIC();
187  
188 my $var = $get->var();
189 my $on = $var->{_on};
190 my $off = $var->{_off};
191 my $true = $var->{_true};
192 my $false = $var->{_false};
193 my $empty_string = $var->{_empty_string};
194  
195 =head2 Encapsulated
196 hash of private variables
197  
198 =cut
199  
200 my $sumigpresp = {
201 _dx => '',
202 _dz => '',
203 _f2 => '',
204 _f3 => '',
205 _f4 => '',
206 _fmax => '',
207 _lpad => '',
208 _nxo => '',
209 _nxshot => '',
210 _nz => '',
211 _rpad => '',
212 _verbose => '',
213 _vfile => '',
214 _Step => '',
215 _note => '',
216  
217 };
218  
219 =head2 sub Step
220  
221 collects switches and assembles bash instructions
222 by adding the program name
223  
224 =cut
225  
226 sub Step {
227  
228 $sumigpresp->{_Step} = 'sumigpresp'.$sumigpresp->{_Step};
229 return ( $sumigpresp->{_Step} );
230  
231 }
232  
233  
234 =head2 sub note
235  
236 collects switches and assembles bash instructions
237 by adding the program name
238  
239 =cut
240  
241 sub note {
242  
243 $sumigpresp->{_note} = 'sumigpresp'.$sumigpresp->{_note};
244 return ( $sumigpresp->{_note} );
245  
246 }
247  
248  
249  
250 =head2 sub clear
251  
252 =cut
253  
254 sub clear {
255  
256 $sumigpresp->{_dx} = '';
257 $sumigpresp->{_dz} = '';
258 $sumigpresp->{_f2} = '';
259 $sumigpresp->{_f3} = '';
260 $sumigpresp->{_f4} = '';
261 $sumigpresp->{_fmax} = '';
262 $sumigpresp->{_lpad} = '';
263 $sumigpresp->{_nxo} = '';
264 $sumigpresp->{_nxshot} = '';
265 $sumigpresp->{_nz} = '';
266 $sumigpresp->{_rpad} = '';
267 $sumigpresp->{_verbose} = '';
268 $sumigpresp->{_vfile} = '';
269 $sumigpresp->{_Step} = '';
270 $sumigpresp->{_note} = '';
271 }
272  
273  
274 =head2 sub dx
275  
276  
277 =cut
278  
279 sub dx {
280  
281 my ( $self,$dx ) = @_;
282 if ( $dx ne $empty_string ) {
283  
284 $sumigpresp->{_dx} = $dx;
285 $sumigpresp->{_note} = $sumigpresp->{_note}.' dx='.$sumigpresp->{_dx};
286 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' dx='.$sumigpresp->{_dx};
287  
288 } else {
289 print("sumigpresp, dx, missing dx,\n");
290 }
291 }
292  
293  
294 =head2 sub dz
295  
296  
297 =cut
298  
299 sub dz {
300  
301 my ( $self,$dz ) = @_;
302 if ( $dz ne $empty_string ) {
303  
304 $sumigpresp->{_dz} = $dz;
305 $sumigpresp->{_note} = $sumigpresp->{_note}.' dz='.$sumigpresp->{_dz};
306 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' dz='.$sumigpresp->{_dz};
307  
308 } else {
309 print("sumigpresp, dz, missing dz,\n");
310 }
311 }
312  
313  
314 =head2 sub f2
315  
316  
317 =cut
318  
319 sub f2 {
320  
321 my ( $self,$f2 ) = @_;
322 if ( $f2 ne $empty_string ) {
323  
324 $sumigpresp->{_f2} = $f2;
325 $sumigpresp->{_note} = $sumigpresp->{_note}.' f2='.$sumigpresp->{_f2};
326 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' f2='.$sumigpresp->{_f2};
327  
328 } else {
329 print("sumigpresp, f2, missing f2,\n");
330 }
331 }
332  
333  
334 =head2 sub f3
335  
336  
337 =cut
338  
339 sub f3 {
340  
341 my ( $self,$f3 ) = @_;
342 if ( $f3 ne $empty_string ) {
343  
344 $sumigpresp->{_f3} = $f3;
345 $sumigpresp->{_note} = $sumigpresp->{_note}.' f3='.$sumigpresp->{_f3};
346 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' f3='.$sumigpresp->{_f3};
347  
348 } else {
349 print("sumigpresp, f3, missing f3,\n");
350 }
351 }
352  
353  
354 =head2 sub f4
355  
356  
357 =cut
358  
359 sub f4 {
360  
361 my ( $self,$f4 ) = @_;
362 if ( $f4 ne $empty_string ) {
363  
364 $sumigpresp->{_f4} = $f4;
365 $sumigpresp->{_note} = $sumigpresp->{_note}.' f4='.$sumigpresp->{_f4};
366 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' f4='.$sumigpresp->{_f4};
367  
368 } else {
369 print("sumigpresp, f4, missing f4,\n");
370 }
371 }
372  
373  
374 =head2 sub fmax
375  
376  
377 =cut
378  
379 sub fmax {
380  
381 my ( $self,$fmax ) = @_;
382 if ( $fmax ne $empty_string ) {
383  
384 $sumigpresp->{_fmax} = $fmax;
385 $sumigpresp->{_note} = $sumigpresp->{_note}.' fmax='.$sumigpresp->{_fmax};
386 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' fmax='.$sumigpresp->{_fmax};
387  
388 } else {
389 print("sumigpresp, fmax, missing fmax,\n");
390 }
391 }
392  
393  
394 =head2 sub lpad
395  
396  
397 =cut
398  
399 sub lpad {
400  
401 my ( $self,$lpad ) = @_;
402 if ( $lpad ne $empty_string ) {
403  
404 $sumigpresp->{_lpad} = $lpad;
405 $sumigpresp->{_note} = $sumigpresp->{_note}.' lpad='.$sumigpresp->{_lpad};
406 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' lpad='.$sumigpresp->{_lpad};
407  
408 } else {
409 print("sumigpresp, lpad, missing lpad,\n");
410 }
411 }
412  
413  
414 =head2 sub nxo
415  
416  
417 =cut
418  
419 sub nxo {
420  
421 my ( $self,$nxo ) = @_;
422 if ( $nxo ne $empty_string ) {
423  
424 $sumigpresp->{_nxo} = $nxo;
425 $sumigpresp->{_note} = $sumigpresp->{_note}.' nxo='.$sumigpresp->{_nxo};
426 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' nxo='.$sumigpresp->{_nxo};
427  
428 } else {
429 print("sumigpresp, nxo, missing nxo,\n");
430 }
431 }
432  
433  
434 =head2 sub nxshot
435  
436  
437 =cut
438  
439 sub nxshot {
440  
441 my ( $self,$nxshot ) = @_;
442 if ( $nxshot ne $empty_string ) {
443  
444 $sumigpresp->{_nxshot} = $nxshot;
445 $sumigpresp->{_note} = $sumigpresp->{_note}.' nxshot='.$sumigpresp->{_nxshot};
446 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' nxshot='.$sumigpresp->{_nxshot};
447  
448 } else {
449 print("sumigpresp, nxshot, missing nxshot,\n");
450 }
451 }
452  
453  
454 =head2 sub nz
455  
456  
457 =cut
458  
459 sub nz {
460  
461 my ( $self,$nz ) = @_;
462 if ( $nz ne $empty_string ) {
463  
464 $sumigpresp->{_nz} = $nz;
465 $sumigpresp->{_note} = $sumigpresp->{_note}.' nz='.$sumigpresp->{_nz};
466 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' nz='.$sumigpresp->{_nz};
467  
468 } else {
469 print("sumigpresp, nz, missing nz,\n");
470 }
471 }
472  
473  
474 =head2 sub rpad
475  
476  
477 =cut
478  
479 sub rpad {
480  
481 my ( $self,$rpad ) = @_;
482 if ( $rpad ne $empty_string ) {
483  
484 $sumigpresp->{_rpad} = $rpad;
485 $sumigpresp->{_note} = $sumigpresp->{_note}.' rpad='.$sumigpresp->{_rpad};
486 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' rpad='.$sumigpresp->{_rpad};
487  
488 } else {
489 print("sumigpresp, rpad, missing rpad,\n");
490 }
491 }
492  
493  
494 =head2 sub verbose
495  
496  
497 =cut
498  
499 sub verbose {
500  
501 my ( $self,$verbose ) = @_;
502 if ( $verbose ne $empty_string ) {
503  
504 $sumigpresp->{_verbose} = $verbose;
505 $sumigpresp->{_note} = $sumigpresp->{_note}.' verbose='.$sumigpresp->{_verbose};
506 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' verbose='.$sumigpresp->{_verbose};
507  
508 } else {
509 print("sumigpresp, verbose, missing verbose,\n");
510 }
511 }
512  
513  
514 =head2 sub vfile
515  
516  
517 =cut
518  
519 sub vfile {
520  
521 my ( $self,$vfile ) = @_;
522 if ( $vfile ne $empty_string ) {
523  
524 $sumigpresp->{_vfile} = $vfile;
525 $sumigpresp->{_note} = $sumigpresp->{_note}.' vfile='.$sumigpresp->{_vfile};
526 $sumigpresp->{_Step} = $sumigpresp->{_Step}.' vfile='.$sumigpresp->{_vfile};
527  
528 } else {
529 print("sumigpresp, vfile, missing vfile,\n");
530 }
531 }
532  
533  
534 =head2 sub get_max_index
535  
536 max index = number of input variables -1
537
538 =cut
539
540 sub get_max_index {
541 my ($self) = @_;
542 my $max_index = 12;
543  
544 return($max_index);
545 }
546
547
548 1;